diff --git a/pages/couponorder/detail/index.js b/pages/couponorder/detail/index.js index 1aa173d..1325578 100644 --- a/pages/couponorder/detail/index.js +++ b/pages/couponorder/detail/index.js @@ -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, diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index b62fda4..24a3206 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -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 diff --git a/pages/paySnapshoot/paySnapshoot.js b/pages/paySnapshoot/paySnapshoot.js index 514e8c0..1ae3349 100644 --- a/pages/paySnapshoot/paySnapshoot.js +++ b/pages/paySnapshoot/paySnapshoot.js @@ -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, diff --git a/pages/paySnapshoot/paySnapshoot.ttml b/pages/paySnapshoot/paySnapshoot.ttml index f389e4e..4ee78e8 100644 --- a/pages/paySnapshoot/paySnapshoot.ttml +++ b/pages/paySnapshoot/paySnapshoot.ttml @@ -40,9 +40,9 @@ {{data.title}}电子卡 - - - + + + 定金: @@ -73,7 +73,7 @@ - + {{data.salePriceStr}} {{data.pressLimitNum+'人可砍至底价'}} {{data.priceStr}}元 @@ -83,7 +83,7 @@ {{data.subTitle}} - + @@ -98,12 +98,12 @@ 团购详情 - + - + {{item.group_name}} - + {{itemChi.name}}({{itemChi.count}}份) ¥{{itemChi.price/100}} @@ -111,47 +111,51 @@ - + + - 购买须知 + 购买须知 有效期 • {{validStartDate}}至{{validEndDate}} 可用时间 • 商家营业时间内到店使用 • 周末不支持使用 - • 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用 - + • 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用 + + 购买限制 • 每个用户限购{{data.useLimitQuantity}}单 - + 预约消费 • 无需预约,高峰时段可能等位 • {{data.subscribeSing}} - + 适用人数 • 该团购劵最多{{data.rec_person_num_max}}人使用 - + 温馨提示 • 团购券不支持配送或外卖 • 该团购商品{{data.pack=='false'?'不支持':'支持'}}打包 • {{data.besides=="false"?'不可以':'可以'}}外带餐食 - - • {{data.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠 + + • + {{data.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠 • {{data.private_room=="false"?'不可以使用':'可以使用'}}包间 - + 使用规则 - - + + {{item.title}} {{item.content}} - + 其他活动 + style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;font-weight: bold;"> + 其他活动