@@ -63,29 +63,30 @@ Page({ | |||||
}, | }, | ||||
//获取适用门店 | //获取适用门店 | ||||
getCouponMerchant(couponChannelId) { | |||||
getCouponMerchant(couponId) { | |||||
Http.get({ | Http.get({ | ||||
url: config.api.couponMerchant, | |||||
data: { | |||||
couponChannelId: couponChannelId | |||||
} | |||||
url: `/wxCoupon/couponMerchantByCouponId?couponId=${couponId}`, | |||||
}).then(res => { | }).then(res => { | ||||
const keys = Object.keys(res.data) | const keys = Object.keys(res.data) | ||||
const mallList = [] | const mallList = [] | ||||
let i = 0 | |||||
keys.forEach(item => { | keys.forEach(item => { | ||||
const arr = item.split('|') | const arr = item.split('|') | ||||
const obj = { | const obj = { | ||||
tenantId: arr[0], | tenantId: arr[0], | ||||
mallName: arr[1], | mallName: arr[1], | ||||
merchantVoList: res.data[item], | merchantVoList: res.data[item], | ||||
expand: true | |||||
expand: false | |||||
} | |||||
if (i == 0) { | |||||
obj.expand = true | |||||
} | } | ||||
mallList.push(obj) | mallList.push(obj) | ||||
i++ | |||||
}) | }) | ||||
this.setData({ | this.setData({ | ||||
mallList: mallList | mallList: mallList | ||||
}) | }) | ||||
console.log(this.mallList, 'mallList'); | |||||
}).catch(err => { | }).catch(err => { | ||||
}) | }) | ||||
@@ -135,7 +136,7 @@ Page({ | |||||
tenantId: res.data.tenantId | tenantId: res.data.tenantId | ||||
}) | }) | ||||
that.setRq() | that.setRq() | ||||
that.getCouponMerchant(res.data.id) | |||||
that.getCouponMerchant(res.data.couponId) | |||||
} | } | ||||
that.setData({ | that.setData({ | ||||
couponorderstatus: res.data.couponOrderStatus, | couponorderstatus: res.data.couponOrderStatus, | ||||
@@ -162,15 +162,20 @@ Page({ | |||||
}).then(res => { | }).then(res => { | ||||
const keys = Object.keys(res.data) | const keys = Object.keys(res.data) | ||||
const mallList = [] | const mallList = [] | ||||
let i = 0 | |||||
keys.forEach(item => { | keys.forEach(item => { | ||||
const arr = item.split('|') | const arr = item.split('|') | ||||
const obj = { | const obj = { | ||||
tenantId: arr[0], | tenantId: arr[0], | ||||
mallName: arr[1], | mallName: arr[1], | ||||
merchantVoList: res.data[item], | merchantVoList: res.data[item], | ||||
expand: true | |||||
expand: false | |||||
} | |||||
if (i == 0) { | |||||
obj.expand = true | |||||
} | } | ||||
mallList.push(obj) | mallList.push(obj) | ||||
i++ | |||||
}) | }) | ||||
this.setData({ | this.setData({ | ||||
mallList: mallList | mallList: mallList | ||||
@@ -6,7 +6,7 @@ const util = require("../../utils/util"); | |||||
const imgurl = require("../../utils/imgurl"); | const imgurl = require("../../utils/imgurl"); | ||||
Page({ | Page({ | ||||
data: { | data: { | ||||
isGetUser: true,//判断是否授权抖音 | |||||
isGetUser: true, //判断是否授权抖音 | |||||
mouldType: 0, | mouldType: 0, | ||||
navigationBarHeight, | navigationBarHeight, | ||||
homeSelectedO: imgurl.homeSelectedO.url, | homeSelectedO: imgurl.homeSelectedO.url, | ||||
@@ -90,9 +90,9 @@ Page({ | |||||
//图文混排 | //图文混排 | ||||
curHtml: '', | curHtml: '', | ||||
contentType: 0, | contentType: 0, | ||||
page: 1,//查询商户优惠券page | |||||
page: 1, //查询商户优惠券page | |||||
idList: [], | idList: [], | ||||
showBox: false,//手机号授权框 | |||||
showBox: false, //手机号授权框 | |||||
}, | }, | ||||
/** | /** | ||||
@@ -104,7 +104,7 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
setPhone(paramData) {//子组件调用这个方法说明手机号已经授权成功 | |||||
setPhone(paramData) { //子组件调用这个方法说明手机号已经授权成功 | |||||
this.setData({ | this.setData({ | ||||
showBox: paramData.detail, | showBox: paramData.detail, | ||||
}) | }) | ||||
@@ -200,9 +200,9 @@ Page({ | |||||
let that = this; | let that = this; | ||||
// 获取用户信息 | // 获取用户信息 | ||||
Http.get({ | Http.get({ | ||||
url: config.api.getScore, | |||||
data: {} | |||||
}) | |||||
url: config.api.getScore, | |||||
data: {} | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
console.log(res) | console.log(res) | ||||
that.getQueryCardStatus() | that.getQueryCardStatus() | ||||
@@ -223,9 +223,9 @@ Page({ | |||||
updateDate: util.formatTime(Number(that.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss") | updateDate: util.formatTime(Number(that.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss") | ||||
} | } | ||||
Http.get({ | Http.get({ | ||||
url: config.api.queryCardStatus, | |||||
data: param | |||||
}) | |||||
url: config.api.queryCardStatus, | |||||
data: param | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
console.log(res, 333333333333) | console.log(res, 333333333333) | ||||
}) | }) | ||||
@@ -248,9 +248,9 @@ Page({ | |||||
receivedDisabled: true | receivedDisabled: true | ||||
}) | }) | ||||
Http.post({ | Http.post({ | ||||
url: config.api.cardAccept, | |||||
data: param | |||||
}) | |||||
url: config.api.cardAccept, | |||||
data: param | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
tt.showToast({ | tt.showToast({ | ||||
title: '领取成功!', | title: '领取成功!', | ||||
@@ -305,12 +305,12 @@ Page({ | |||||
console.log(answserIs) | console.log(answserIs) | ||||
console.log(e.currentTarget.dataset.questionid) | console.log(e.currentTarget.dataset.questionid) | ||||
Http.post({ | Http.post({ | ||||
url: config.api.answerQuestion, | |||||
data: { | |||||
answer: answserIs, | |||||
questionId: e.currentTarget.dataset.questionid | |||||
} | |||||
}) | |||||
url: config.api.answerQuestion, | |||||
data: { | |||||
answer: answserIs, | |||||
questionId: e.currentTarget.dataset.questionid | |||||
} | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
that.closeQuestion(); | that.closeQuestion(); | ||||
}) | }) | ||||
@@ -350,8 +350,7 @@ Page({ | |||||
data: { | data: { | ||||
token: app.globalData.token | token: app.globalData.token | ||||
} | } | ||||
}).then(res => { | |||||
}).catch(err => { | |||||
}).then(res => {}).catch(err => { | |||||
if (err.code == 11004) { | if (err.code == 11004) { | ||||
this.setData({ | this.setData({ | ||||
isGetUser: false | isGetUser: false | ||||
@@ -440,11 +439,40 @@ Page({ | |||||
that.getDetail(options.id, 'notendclock'); | that.getDetail(options.id, 'notendclock'); | ||||
} | } | ||||
that.setData({ | that.setData({ | ||||
couponChannelId: options.id, | couponChannelId: options.id, | ||||
}); | }); | ||||
this.getCouponMerchant(options.id) | |||||
}, | |||||
getCouponMerchant(couponChannelId) { //获取适用门店 | |||||
Http.get({ | |||||
url: config.api.couponMerchant, | |||||
data: { | |||||
couponChannelId: couponChannelId | |||||
} | |||||
}).then(res => { | |||||
const keys = Object.keys(res.data) | |||||
const mallList = [] | |||||
let i = 0 | |||||
keys.forEach(item => { | |||||
const arr = item.split('|') | |||||
const obj = { | |||||
tenantId: arr[0], | |||||
mallName: arr[1], | |||||
merchantVoList: res.data[item], | |||||
expand: false | |||||
} | |||||
if (i == 0) { | |||||
obj.expand = true | |||||
} | |||||
mallList.push(obj) | |||||
i++ | |||||
}) | |||||
this.setData({ | |||||
mallList: mallList | |||||
}) | |||||
}) | |||||
}, | }, | ||||
getHtml(couponChannelId) { | getHtml(couponChannelId) { | ||||
Http.get({ | Http.get({ | ||||
@@ -467,7 +495,9 @@ Page({ | |||||
let that = this; | let that = this; | ||||
var parmer = { | var parmer = { | ||||
url: config.api.getSnapshot, | url: config.api.getSnapshot, | ||||
data: {orderId:couponChannelId} | |||||
data: { | |||||
orderId: couponChannelId | |||||
} | |||||
}; | }; | ||||
Http.get(parmer) | Http.get(parmer) | ||||
.then(res => { | .then(res => { | ||||
@@ -597,13 +627,13 @@ Page({ | |||||
} | } | ||||
if(res.data.itemGroup){ | |||||
if (res.data.itemGroup) { | |||||
let tempObj = that.data.data | let tempObj = that.data.data | ||||
tempObj.itemGroup = JSON.parse(tempObj.itemGroup) | tempObj.itemGroup = JSON.parse(tempObj.itemGroup) | ||||
that.setData({ | that.setData({ | ||||
data:tempObj | |||||
data: tempObj | |||||
}) | }) | ||||
console.log(that.data.data,"data"); | |||||
console.log(that.data.data, "data"); | |||||
} | } | ||||
@@ -612,7 +642,7 @@ Page({ | |||||
tempObj.productAttrs = JSON.parse(tempObj.productAttrs) | tempObj.productAttrs = JSON.parse(tempObj.productAttrs) | ||||
tempObj.skuAttrs = JSON.parse(tempObj.skuAttrs) | tempObj.skuAttrs = JSON.parse(tempObj.skuAttrs) | ||||
tempObj.productAttrs.map(item => { | tempObj.productAttrs.map(item => { | ||||
if (item.key == "appointment") { | if (item.key == "appointment") { | ||||
let tempAppoinObj = JSON.parse(item.data) | let tempAppoinObj = JSON.parse(item.data) | ||||
if (tempAppoinObj.need_appointment) { | if (tempAppoinObj.need_appointment) { | ||||
@@ -681,11 +711,11 @@ Page({ | |||||
}); | }); | ||||
}) | }) | ||||
}, | }, | ||||
onShow() { | onShow() { | ||||
this.ifGetUser()//判断是否授权抖音 | |||||
this.ifGetUser() //判断是否授权抖音 | |||||
this.setData({ | this.setData({ | ||||
mouldType: app.globalData.mouldType, | mouldType: app.globalData.mouldType, | ||||
showbutton: false, | showbutton: false, | ||||
@@ -40,9 +40,9 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<text class='title'>{{data.title}}<text class="elecard" tt:if="{{data.type==100}}">电子卡</text></text> | <text class='title'>{{data.title}}<text class="elecard" tt:if="{{data.type==100}}">电子卡</text></text> | ||||
<!-- 预购 --> | <!-- 预购 --> | ||||
<view class="moneyBox" tt:if="{{data.type==10}}"> | <view class="moneyBox" tt:if="{{data.type==10}}"> | ||||
<view class="earnest">定金:</view> | <view class="earnest">定金:</view> | ||||
@@ -73,7 +73,7 @@ | |||||
</view> | </view> | ||||
<view class="fl" tt:if="{{data.type==8}}"> | <view class="fl" tt:if="{{data.type==8}}"> | ||||
<text class="pri01">{{data.salePriceStr}}</text> | <text class="pri01">{{data.salePriceStr}}</text> | ||||
<text class='presslimit' tt:if="{{data.type==8}}"><text>{{data.pressLimitNum+'人可砍至底价'}}</text></text> | <text class='presslimit' tt:if="{{data.type==8}}"><text>{{data.pressLimitNum+'人可砍至底价'}}</text></text> | ||||
<text class='throgh'>{{data.priceStr}}元</text> | <text class='throgh'>{{data.priceStr}}元</text> | ||||
@@ -83,7 +83,7 @@ | |||||
<view class="subTitleBox"> | <view class="subTitleBox"> | ||||
<text class="subTitle">{{data.subTitle}}</text> | <text class="subTitle">{{data.subTitle}}</text> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -98,12 +98,12 @@ | |||||
<vieW class="groupTitleBox"> | <vieW class="groupTitleBox"> | ||||
<view class="groupTitle" tt:if="{{data.itemGroup.length>0}}">团购详情</view> | <view class="groupTitle" tt:if="{{data.itemGroup.length>0}}">团购详情</view> | ||||
</vieW> | </vieW> | ||||
<view class="groupTextBox" tt:if="{{data.itemGroup.length>0}}" tt:for="{{data.itemGroup}}"> | <view class="groupTextBox" tt:if="{{data.itemGroup.length>0}}" tt:for="{{data.itemGroup}}"> | ||||
<view class="groupTitleS">{{item.group_name}}</view> | <view class="groupTitleS">{{item.group_name}}</view> | ||||
<view class="groupDetailsBox" tt:for="{{item.item_list}}" tt:for-item="itemChi"> | <view class="groupDetailsBox" tt:for="{{item.item_list}}" tt:for-item="itemChi"> | ||||
<view class="groupTiemBox" > | |||||
<view class="groupTiemBox"> | |||||
<view class="yuandian"></view> | <view class="yuandian"></view> | ||||
<view class="groupTiemName">{{itemChi.name}}({{itemChi.count}}份)</view> | <view class="groupTiemName">{{itemChi.name}}({{itemChi.count}}份)</view> | ||||
<view class="groupTiemPay">¥{{itemChi.price/100}}</view> | <view class="groupTiemPay">¥{{itemChi.price/100}}</view> | ||||
@@ -111,47 +111,51 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<!-- 适用门店 --> | <!-- 适用门店 --> | ||||
<store merchantVoList="{{merchantVoList}}" tt:if="{{data.type!=12}}"></store> | |||||
<!-- <store merchantVoList="{{merchantVoList}}" tt:if="{{data.type!=12}}"></store> --> | |||||
<shop tt:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop> | |||||
<view class='notes'> | <view class='notes'> | ||||
<view class="notesH">购买须知</view> | |||||
<view class="notesH">购买须知</view> | |||||
<view class="timeText">有效期</view> | <view class="timeText">有效期</view> | ||||
<view class="Hchild">• {{validStartDate}}至{{validEndDate}}</view> | <view class="Hchild">• {{validStartDate}}至{{validEndDate}}</view> | ||||
<view class="timeText">可用时间</view> | <view class="timeText">可用时间</view> | ||||
<view class="Hchild">• 商家营业时间内到店使用</view> | <view class="Hchild">• 商家营业时间内到店使用</view> | ||||
<view class="Hchild" tt:if="{{data.can_no_use_date.weekend}}">• 周末不支持使用</view> | <view class="Hchild" tt:if="{{data.can_no_use_date.weekend}}">• 周末不支持使用</view> | ||||
<view class="Hchild" tt:if="{{data.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用</view> | |||||
<view class="Hchild" tt:if="{{data.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用 | |||||
</view> | |||||
<view class="timeText">购买限制</view> | <view class="timeText">购买限制</view> | ||||
<view class="Hchild">• 每个用户限购{{data.useLimitQuantity}}单</view> | <view class="Hchild">• 每个用户限购{{data.useLimitQuantity}}单</view> | ||||
<view class="timeText">预约消费</view> | <view class="timeText">预约消费</view> | ||||
<view class="Hchild" tt:if="{{!data.subscribeSing}}">• 无需预约,高峰时段可能等位</view> | <view class="Hchild" tt:if="{{!data.subscribeSing}}">• 无需预约,高峰时段可能等位</view> | ||||
<view class="Hchild" tt:if="{{data.subscribeSing}}">• {{data.subscribeSing}}</view> | <view class="Hchild" tt:if="{{data.subscribeSing}}">• {{data.subscribeSing}}</view> | ||||
<view class="timeText" tt:if="{{data.rec_person_num_max}}">适用人数</view> | <view class="timeText" tt:if="{{data.rec_person_num_max}}">适用人数</view> | ||||
<view class="Hchild" tt:if="{{data.rec_person_num_max}}">• 该团购劵最多{{data.rec_person_num_max}}人使用</view> | <view class="Hchild" tt:if="{{data.rec_person_num_max}}">• 该团购劵最多{{data.rec_person_num_max}}人使用</view> | ||||
<view class="timeText">温馨提示</view> | <view class="timeText">温馨提示</view> | ||||
<view class="Hchild">• 团购券不支持配送或外卖</view> | <view class="Hchild">• 团购券不支持配送或外卖</view> | ||||
<view class="Hchild" tt:if="{{data.pack}}">• 该团购商品{{data.pack=='false'?'不支持':'支持'}}打包</view> | <view class="Hchild" tt:if="{{data.pack}}">• 该团购商品{{data.pack=='false'?'不支持':'支持'}}打包</view> | ||||
<view class="Hchild" tt:if="{{data.besides}}">• {{data.besides=="false"?'不可以':'可以'}}外带餐食</view> | <view class="Hchild" tt:if="{{data.besides}}">• {{data.besides=="false"?'不可以':'可以'}}外带餐食</view> | ||||
<view class="Hchild" tt:if="{{data.superimposed_discounts}}">• {{data.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠</view> | |||||
<view class="Hchild" tt:if="{{data.superimposed_discounts}}">• | |||||
{{data.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠</view> | |||||
<view class="Hchild" tt:if="{{data.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view> | <view class="Hchild" tt:if="{{data.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view> | ||||
<view class="notesH" tt:if="{{data.curLsit}}">使用规则</view> | <view class="notesH" tt:if="{{data.curLsit}}">使用规则</view> | ||||
<view tt:if="{{data.curLsit}}" tt:for="{{data.curLsit}}" tt:key="{{index}}"> | <view tt:if="{{data.curLsit}}" tt:for="{{data.curLsit}}" tt:key="{{index}}"> | ||||
<view class="timeText" tt:if="{{item.title!=''}}">{{item.title}}</view> | <view class="timeText" tt:if="{{item.title!=''}}">{{item.title}}</view> | ||||
<text class="Hchild">{{item.content}}</text> | <text class="Hchild">{{item.content}}</text> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view tt:if="{{couponList.length!=0}}" | <view tt:if="{{couponList.length!=0}}" | ||||
style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;font-weight: bold;">其他活动 | |||||
style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;font-weight: bold;"> | |||||
其他活动 | |||||
</view> | </view> | ||||
<view class='couponsL clearfix'> | <view class='couponsL clearfix'> | ||||
<c-coupons tt:if="{{couponList.length!=0}}" tt:for="{{couponList}}" from="fromMerchant" paramAtoB="{{loading}}" | <c-coupons tt:if="{{couponList.length!=0}}" tt:for="{{couponList}}" from="fromMerchant" paramAtoB="{{loading}}" | ||||