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