浏览代码

适用门店新模式#3

soldDate
HolyKnightIX 2 年前
父节点
当前提交
a0aa2e7452
共有 3 个文件被更改,包括 177 次插入287 次删除
  1. +2
    -107
      components/shop/shop.ttml
  2. +164
    -164
      index/index.js
  3. +11
    -16
      pages/couponorder/detail/index.js

+ 2
- 107
components/shop/shop.ttml 查看文件

@@ -15,7 +15,7 @@


<!-- 当商户数量不大于三个时 --> <!-- 当商户数量不大于三个时 -->
<view class="goExpand" catchtap="expandList" data-index="{{index}}"> <view class="goExpand" catchtap="expandList" data-index="{{index}}">
<view tt:if="{{item.merchantVoList.length<=3}}">
<view>
<view>{{item.merchantVoList.length+'家门店适用'}}</view> <view>{{item.merchantVoList.length+'家门店适用'}}</view>
<image tt:if="{{!item.expand}}" src="../../assets/itemImg/chevron.png" mode="widthFix" <image tt:if="{{!item.expand}}" src="../../assets/itemImg/chevron.png" mode="widthFix"
class="rightArrowDown"> class="rightArrowDown">
@@ -25,7 +25,7 @@
</view> </view>


<!-- 当item.expand为true且商户数量不大于三个时 --> <!-- 当item.expand为true且商户数量不大于三个时 -->
<view class="shop" tt:if="{{item.expand&&item.merchantVoList.length<=3}}">
<view class="shop" tt:if="{{item.expand}}">
<view class='posi' tt:for="{{item.merchantVoList}}" tt:key="index"> <view class='posi' tt:for="{{item.merchantVoList}}" tt:key="index">
<view class='posi_logo'> <view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'> <view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
@@ -57,110 +57,5 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 当商户数量不大于三个时 -->
<view class="shop" tt:if="{{item.merchantVoList.length>3}}">
<!-- 当item.expand为true时 -->
<view class='posi' tt:if="{{item.expand}}" tt:for="{{item.merchantVoList}}" tt:key="index">
<view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view tt:for="{{item.shopVoList}}" tt:key="{{index}}" tt:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<view class="telBox" tt:if="{{item.linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg"
src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goCertification"
data-id="{{item.id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}">
<view class="siteText">{{item.addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>
</view>
<!-- 当item.expand为true时 -->
<view class='posi' tt:if="{{item.expand}}" tt:for="{{item.merchantVoList}}" tt:key="index">
<view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view tt:for="{{item.shopVoList}}" tt:key="{{index}}" tt:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<view class="telBox" tt:if="{{item.linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg"
src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goCertification"
data-id="{{item.id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}">
<view class="siteText">{{item.addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>
</view>
<!-- 当item.expand为false时 -->
<view class='posi' tt:else tt:for="{{item.merchantVoList}}" tt:key="index">
<view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view tt:for="{{item.shopVoList}}" tt:key="{{index}}" tt:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<view class="telBox" tt:if="{{item.linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg"
src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goCertification"
data-id="{{item.id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}">
<view class="siteText">{{item.addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>
</view>
</view>

<!-- 当商户数量不小于三个时 -->
<view tt:if="{{item.merchantVoList.length>3}}">
<view>{{item.merchantVoList.length+'家门店适用,展开全部'}}</view>
<image tt:if="{{!item.expand}}" src="../../assets/itemImg/chevron.png" mode="widthFix"
class="rightArrowDown">
</image>
<image tt:else src="../../assets/itemImg/chevron.png" mode="widthFix" class="rightArrowUp"></image>
</view>
</view> </view>
</view> </view>

+ 164
- 164
index/index.js 查看文件

@@ -31,7 +31,7 @@ Page({
marketName: "", //商场名称 marketName: "", //商场名称
mouldType: null, mouldType: null,
navLineHeight: ((app.statusBarHeight + app.statusBarHeight) + 50) + "px", navLineHeight: ((app.statusBarHeight + app.statusBarHeight) + 50) + "px",
navImgHeight:(((app.statusBarHeight + app.statusBarHeight) + 34)/2) + "px",
navImgHeight: (((app.statusBarHeight + app.statusBarHeight) + 34) / 2) + "px",
huanlechengImgurl: "https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/", huanlechengImgurl: "https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/",
// mch_id: mch_id, // mch_id: mch_id,
goUrl: "", //商圈跳转链接 goUrl: "", //商圈跳转链接
@@ -116,15 +116,15 @@ Page({
moduleList: [], //按钮列表 moduleList: [], //按钮列表
}, },


getCongig(){//获取小程序是否开通授权手机号
getCongig() { //获取小程序是否开通授权手机号
Http.get({ Http.get({
url:config.api.getConfig,
data:{
key:"douyinPhoneStatus"
url: config.api.getConfig,
data: {
key: "douyinPhoneStatus"
} }
}).then(res=>{
app.globalData.ifCongPh = res.data?res.data:1
}).catch(err=>{
}).then(res => {
app.globalData.ifCongPh = res.data ? res.data : 1
}).catch(err => {
app.globalData.ifCongPh = 1 app.globalData.ifCongPh = 1
}) })
}, },
@@ -187,8 +187,8 @@ Page({
url: config.api.couponChannelList, url: config.api.couponChannelList,
data: param data: param
}).then(res => { }).then(res => {
if (res.data.list&&res.data.list.length != 0) {
if (res.data.list && res.data.list.length != 0) {
let tempLsit = this.data.businessData let tempLsit = this.data.businessData
let data = res.data.list let data = res.data.list
data.map(item => { data.map(item => {
@@ -209,7 +209,7 @@ Page({
businessData: data businessData: data
}) })
} }
}else{
} else {
this.setData({ this.setData({
noDataFlag: true noDataFlag: true
}) })
@@ -257,7 +257,7 @@ Page({
//获取按钮列表 //获取按钮列表
getModule() { getModule() {
Http.get({ Http.get({
url: config.api.wxCustomizeModule
url: config.api.wxCustomizeModule
}).then(res => { }).then(res => {
this.setData({ this.setData({
moduleList: res.data, moduleList: res.data,
@@ -518,7 +518,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onLoad: function (options) { onLoad: function (options) {
let that = this; let that = this;
let optionss; let optionss;


@@ -603,10 +603,10 @@ Page({
// this.uesrInfo() // this.uesrInfo()
this.ifShowSqare(); this.ifShowSqare();
if (tt.getStorageSync("squareList") && tt.getStorageSync("selectedMall")) { if (tt.getStorageSync("squareList") && tt.getStorageSync("selectedMall")) {
var temp = tt.getStorageSync("squareList").filter(item => item.tenantId == tt.getStorageSync("selectedMall"))[0].name
this.setData({
squareName: temp
})
// var temp = tt.getStorageSync("squareList").filter(item => item.tenantId == tt.getStorageSync("selectedMall"))[0].name
// this.setData({
// squareName: temp
// })
} }
if (typeof this.getTabBar === 'function' && if (typeof this.getTabBar === 'function' &&
this.getTabBar()) { this.getTabBar()) {
@@ -656,25 +656,25 @@ Page({
getmemberId: function (token) { getmemberId: function (token) {
let that = this; let that = this;
Http.get({ Http.get({
url: config.api.getScore,
data: {
token: token
}
}).then(res => {
if(res.data.avatarUrl||res.data.nickName){
app.globalData.avatarUrl = res.data.avatarUrl
app.globalData.nickName = res.data.nickName
}
that.setData({
levelName: res.data.levelName,
upgradePercent: res.data.upgradePercent,
upgradeScore: res.data.upgradeScore,
memberId: res.data.id,
credit: res.data.credit,
userAvatarUrl: res.data.avatarUrl ? res.data.avatarUrl:'',
userName: res.data.nickName ? res.data.nickName:'',
url: config.api.getScore,
data: {
token: token
}
}).then(res => {
if (res.data.avatarUrl || res.data.nickName) {
app.globalData.avatarUrl = res.data.avatarUrl
app.globalData.nickName = res.data.nickName
}
that.setData({
levelName: res.data.levelName,
upgradePercent: res.data.upgradePercent,
upgradeScore: res.data.upgradeScore,
memberId: res.data.id,
credit: res.data.credit,
userAvatarUrl: res.data.avatarUrl ? res.data.avatarUrl : '',
userName: res.data.nickName ? res.data.nickName : '',
})
}) })
})
.catch(err => { .catch(err => {
tt.showModal({ tt.showModal({
title: '提示', title: '提示',
@@ -738,7 +738,7 @@ Page({
if (app.globalData.token) { if (app.globalData.token) {
// 登录 // 登录
console.log(app.globalData.token) console.log(app.globalData.token)
that.getCongig()//获取小程序是否开通授权手机号
that.getCongig() //获取小程序是否开通授权手机号
that.setData({ that.setData({
mouldType: app.globalData.mouldType, mouldType: app.globalData.mouldType,
marketName: app.globalData.marketName, marketName: app.globalData.marketName,
@@ -780,11 +780,11 @@ Page({
app.businessListCallback(app.globalData.token); app.businessListCallback(app.globalData.token);
} }
Http.get({ Http.get({
url: config.api.getWeapNote,
data: {
appId: app.globalData.appId,
}
})
url: config.api.getWeapNote,
data: {
appId: app.globalData.appId,
}
})
.then(res => { .then(res => {
console.log(33333333333) console.log(33333333333)
console.log(app.globalData.token) console.log(app.globalData.token)
@@ -814,7 +814,7 @@ Page({
app.tokenCallback = token => { app.tokenCallback = token => {
// 登录 // 登录
console.log(app.globalData.token) console.log(app.globalData.token)
that.getCongig()//获取小程序是否开通授权手机号
that.getCongig() //获取小程序是否开通授权手机号
that.setData({ that.setData({
mouldType: app.globalData.mouldType, mouldType: app.globalData.mouldType,
marketName: app.globalData.marketName, marketName: app.globalData.marketName,
@@ -852,11 +852,11 @@ Page({
} }


Http.get({ Http.get({
url: config.api.getWeapNote,
data: {
appId: app.globalData.appId,
}
})
url: config.api.getWeapNote,
data: {
appId: app.globalData.appId,
}
})
.then(res => { .then(res => {
console.log(33333333333) console.log(33333333333)
console.log(app.globalData.token) console.log(app.globalData.token)
@@ -889,26 +889,26 @@ Page({
getStaticGame(token) { getStaticGame(token) {
let _this = this; let _this = this;
Http.get({ Http.get({
url: config.api.getGame,
data: {
triggleAction: 2, // 固定入口
token: token
}
}).then(res => {
if (res.data.id) {
_this.setData({
showIf: true,
newUrl: res.data.imgUrl
})
} else {
url: config.api.getGame,
data: {
triggleAction: 2, // 固定入口
token: token
}
}).then(res => {
if (res.data.id) {
_this.setData({
showIf: true,
newUrl: res.data.imgUrl
})
} else {
_this.setData({
showIf: false
})
}
_this.setData({ _this.setData({
showIf: false
staticGamedata: res.data
}) })
}
_this.setData({
staticGamedata: res.data
}) })
})
.catch(err => { .catch(err => {
_this.setData({ _this.setData({
showIf: false showIf: false
@@ -919,25 +919,25 @@ Page({
getGameOne: function (token) { getGameOne: function (token) {
let _this = this; let _this = this;
Http.get({ Http.get({
url: config.api.getGame,
data: {
triggleAction: 1, // 登录触发
token: token
}
}).then(res => {
if (res.data.id) {
_this.setData({
showGame: true,
})
} else {
url: config.api.getGame,
data: {
triggleAction: 1, // 登录触发
token: token
}
}).then(res => {
if (res.data.id) {
_this.setData({
showGame: true,
})
} else {
_this.setData({
showGame: false
})
}
_this.setData({ _this.setData({
showGame: false
gamedata: res.data
}) })
}
_this.setData({
gamedata: res.data
}) })
})
.catch(err => { .catch(err => {
_this.setData({ _this.setData({
showGame: false showGame: false
@@ -951,18 +951,18 @@ Page({
getMallInfo: function (token) { getMallInfo: function (token) {
let that = this; let that = this;
Http.get({ Http.get({
url: config.api.getMallInfo,
data: {
token: token,
}
}).then(res => {
that.setData({
liveFlag: res.data.liveSupport,
weappShareTitle: res.data.weappShareTitle ? res.data.weappShareTitle : null,
weappShareCoverImg: res.data.weappShareCoverImg ? res.data.weappShareCoverImg : null,
});
console.log(that.data.liveFlag, "||||")
})
url: config.api.getMallInfo,
data: {
token: token,
}
}).then(res => {
that.setData({
liveFlag: res.data.liveSupport,
weappShareTitle: res.data.weappShareTitle ? res.data.weappShareTitle : null,
weappShareCoverImg: res.data.weappShareCoverImg ? res.data.weappShareCoverImg : null,
});
console.log(that.data.liveFlag, "||||")
})
.catch(err => { .catch(err => {
// 不需要错误提示 // 不需要错误提示
}); });
@@ -971,24 +971,24 @@ Page({
getxsList() { getxsList() {
let that = this; let that = this;
Http.get({ Http.get({
url: config.api.couponChannelList,
data: {
pageNum: 1,
pageSize: 3,
targetAd: 2
}
}).then(res => {
if (res && res.data.total > 0) {
that.setData({
xslist: res.data.list,
showQg: true
});
} else {
that.setData({
showQg: false
})
}
})
url: config.api.couponChannelList,
data: {
pageNum: 1,
pageSize: 3,
targetAd: 2
}
}).then(res => {
if (res && res.data.total > 0) {
that.setData({
xslist: res.data.list,
showQg: true
});
} else {
that.setData({
showQg: false
})
}
})
.catch(err => { .catch(err => {
console.log(err) console.log(err)
tt.showToast({ tt.showToast({
@@ -1005,19 +1005,19 @@ Page({
getBannerlist: function () { getBannerlist: function () {
let that = this; let that = this;
Http.get({ Http.get({
url: config.api.bannerlist,
data: {
pageNum: 1,
pageSize: 7,
plat:3
}
}).then(res => {
that.getmemberId(app.globalData.token);
// that.checkUserCarStatus();
that.setData({
list: res.data.list
});
})
url: config.api.bannerlist,
data: {
pageNum: 1,
pageSize: 7,
plat: 3
}
}).then(res => {
that.getmemberId(app.globalData.token);
// that.checkUserCarStatus();
that.setData({
list: res.data.list
});
})
.catch(err => { .catch(err => {
that.getmemberId(app.globalData.token); that.getmemberId(app.globalData.token);
// that.checkUserCarStatus(); // that.checkUserCarStatus();
@@ -1117,24 +1117,24 @@ Page({
topicShow: function () { topicShow: function () {
let that = this; let that = this;
Http.get({ Http.get({
url: config.api.topicShow,
data: {
token: app.globalData.token
}
}).then(res => {
if (res && res.data) {
that.setData({
name: res.data.name,
cover: res.data.cover,
id: res.data.id,
showTopic: true
})
} else {
that.setData({
showTopic: false
})
}
})
url: config.api.topicShow,
data: {
token: app.globalData.token
}
}).then(res => {
if (res && res.data) {
that.setData({
name: res.data.name,
cover: res.data.cover,
id: res.data.id,
showTopic: true
})
} else {
that.setData({
showTopic: false
})
}
})
.catch(err => { .catch(err => {
console.log(err); console.log(err);
}) })
@@ -1218,30 +1218,30 @@ Page({


let that = this let that = this
Http.get({ Http.get({
url: config.api.getGg,
data: {
token: token,
appId: app.globalData.appId,
openId: "" // tt.getStorageSync('openId')
}
}).then(res => {
console.log(res)
if (res.data.id) {
that.setData({
showGg: true,
})
console.log(that.data.showGg, 1111111111111)
} else {
url: config.api.getGg,
data: {
token: token,
appId: app.globalData.appId,
openId: "" // tt.getStorageSync('openId')
}
}).then(res => {
console.log(res)
if (res.data.id) {
that.setData({
showGg: true,
})
console.log(that.data.showGg, 1111111111111)
} else {
that.setData({
showGg: false
})
// that.getGameOne(app.globalData.token)
console.log(that.data.showGg, 222222222222222222)
}
that.setData({ that.setData({
showGg: false
ggdata: res.data
}) })
// that.getGameOne(app.globalData.token)
console.log(that.data.showGg, 222222222222222222)
}
that.setData({
ggdata: res.data
}) })
})
.catch(err => { .catch(err => {
this.setData({ this.setData({
showGg: false showGg: false
@@ -1264,7 +1264,7 @@ Page({
topicObj4: null, //欢乐城首页拼团 topicObj4: null, //欢乐城首页拼团
topicObj5: null, //欢乐城首页消费卡 topicObj5: null, //欢乐城首页消费卡
topicObj6: null, //欢乐城首页积分商城 topicObj6: null, //欢乐城首页积分商城
specialLsit: null,//专题
specialLsit: null, //专题
}) })
// that.getWeapNote(); // that.getWeapNote();
that.setData({ that.setData({
@@ -1310,7 +1310,7 @@ Page({
page: that.data.page, page: that.data.page,
businePageNum: that.data.businePageNum + 1 businePageNum: that.data.businePageNum + 1
}); });
console.log("加载更多页数" + that.data.page,);
console.log("加载更多页数" + that.data.page, );
console.log("加载更多key" + that.data.code); console.log("加载更多key" + that.data.code);
if (that.data.mouldType == 0) { //富茂源模板 if (that.data.mouldType == 0) { //富茂源模板
//父组件获得子组件的方法 //父组件获得子组件的方法


+ 11
- 16
pages/couponorder/detail/index.js 查看文件

@@ -28,7 +28,8 @@ Page({
couponTenantId: '', couponTenantId: '',
templTiem: "", templTiem: "",
curHtml: "", curHtml: "",
tenantId: ''
tenantId: '',
mallList: ''
}, },
showId() { showId() {
let this_ = this; let this_ = this;
@@ -61,7 +62,8 @@ Page({


}, },


getCouponMerchant(couponChannelId) { //获取适用门店
//获取适用门店
getCouponMerchant(couponChannelId) {
Http.get({ Http.get({
url: config.api.couponMerchant, url: config.api.couponMerchant,
data: { data: {
@@ -83,20 +85,9 @@ Page({
this.setData({ this.setData({
mallList: mallList mallList: mallList
}) })
// if (res.data && res.data.length) {
// let merchantVoList = res.data
// let idList = []
// merchantVoList.map(item => {
// idList.push(item.id)
// })
// this.setData({
// idList: idList
// })
// this.getCouponList(idList) //获取推荐列表
// }
// this.setData({
// merchantVoList: res.data
// })
console.log(this.mallList, 'mallList');
}).catch(err => {

}) })
}, },


@@ -117,6 +108,7 @@ Page({
} }
}) })
}, },

onLoad: function (options) { onLoad: function (options) {
let that = this; let that = this;
console.log(options); console.log(options);
@@ -143,11 +135,13 @@ Page({
tenantId: res.data.tenantId tenantId: res.data.tenantId
}) })
that.setRq() that.setRq()
that.getCouponMerchant(res.data.id)
} }
that.setData({ that.setData({
couponorderstatus: res.data.couponOrderStatus, couponorderstatus: res.data.couponOrderStatus,
data: res.data, data: res.data,
}); });

that.setData({ that.setData({
expiredTime: util.formatTime(that.data.data.expiredTime, "yyyy-MM-dd hh:mm:ss"), expiredTime: util.formatTime(that.data.data.expiredTime, "yyyy-MM-dd hh:mm:ss"),
updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"), updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"),
@@ -170,6 +164,7 @@ Page({
} }


}).catch(err => { }).catch(err => {
console.log(err, 'err');
tt.showToast({ tt.showToast({
title: err.message ? err.message : err.data, title: err.message ? err.message : err.data,
icon: 'none', icon: 'none',


正在加载...
取消
保存