| @@ -77,6 +77,9 @@ var config = { | |||||
| * 获取券价格与库存 | * 获取券价格与库存 | ||||
| */ | */ | ||||
| couponPriceAndStock: "/wxCoupon/couponPriceAndStock", | couponPriceAndStock: "/wxCoupon/couponPriceAndStock", | ||||
| couponInfo: "/wxCoupon/couponInfo", | |||||
| /** | /** | ||||
| * 获取券适用门店List | * 获取券适用门店List | ||||
| */ | */ | ||||
| @@ -95,17 +95,11 @@ Page({ | |||||
| if (res.from === 'button') { | if (res.from === 'button') { | ||||
| console.log(this.data.cardDetail) | console.log(this.data.cardDetail) | ||||
| // 来自页面内转发按钮 | // 来自页面内转发按钮 | ||||
| const restData = JSON.stringify({ | |||||
| coverImg: _this.data.cardDetail.coverImg, | |||||
| avatarUrl: _this.data.avatarUrl, | |||||
| couponOrderId: _this.data.cardDetail.id, | |||||
| updateDate: _this.data.cardDetail.updateDate | |||||
| }) | |||||
| return { | return { | ||||
| title: _this.data.userName + '赠送您一张' + _this.data.cardDetail.title, | title: _this.data.userName + '赠送您一张' + _this.data.cardDetail.title, | ||||
| imageUrl: _this.data.cardDetail.coverImg, | imageUrl: _this.data.cardDetail.coverImg, | ||||
| path: `/pages/index/index?couponChannelId=${_this.data.cardDetail.couponChannelId}&avatarUrl=${_this.data.cardDetail.avatarUrl}&cuserId=${_this.data.cardDetail.ownerId}&userName=${_this.data.userName}&couponId=${_this.data.cardDetail.couponId}&couponOrderId=${_this.data.cardDetail.id}&updateDate=${_this.data.cardDetail.updateDate}&coverImg=${_this.data.cardDetail.coverImg}`, | |||||
| path: `/pages/index/index?couponChannelId=${_this.data.cardDetail.couponChannelId}&avatarUrl=${_this.data.cardDetail.avatarUrl}&cuserId=${_this.data.cardDetail.ownerId}&userName=${_this.data.userName}&couponId=${_this.data.cardDetail.couponId}&couponOrderId=${_this.data.cardDetail.id}&updateDate=${_this.data.cardDetail.updateDate}&coverImg=${_this.data.cardDetail.coverImg}&tenantId=${_this.data.cardDetail.tenantId}`, | |||||
| success: function (res) { | success: function (res) { | ||||
| // 转发成功 | // 转发成功 | ||||
| @@ -120,6 +120,9 @@ Page({ | |||||
| let timer | let timer | ||||
| let expiredSeconds = res.data.expiredSeconds | let expiredSeconds = res.data.expiredSeconds | ||||
| if (expiredSeconds) { | if (expiredSeconds) { | ||||
| this.setData({ | |||||
| expiredSeconds: expiredSeconds | |||||
| }) | |||||
| timer = setInterval(() => { | timer = setInterval(() => { | ||||
| if (expiredSeconds != 0) { | if (expiredSeconds != 0) { | ||||
| this.setData({ | this.setData({ | ||||
| @@ -95,7 +95,8 @@ Page({ | |||||
| contentType: 0, | contentType: 0, | ||||
| page: 1,//查询商户优惠券page | page: 1,//查询商户优惠券page | ||||
| idList: [], | idList: [], | ||||
| mallList: "" | |||||
| mallList: "", | |||||
| jumpToIndex: false | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 显示分享弹框 | * 显示分享弹框 | ||||
| @@ -298,9 +299,16 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| closeAlert() { | closeAlert() { | ||||
| this.setData({ | |||||
| showCardOffer: false | |||||
| }) | |||||
| if (this.data.jumpToIndex) { | |||||
| wx.switchTab({ | |||||
| url: '/pages/theme/index1/index', | |||||
| }) | |||||
| } else { | |||||
| this.setData({ | |||||
| showCardOffer: false | |||||
| }) | |||||
| } | |||||
| }, | }, | ||||
| goback: function () { | goback: function () { | ||||
| let this_ = this | let this_ = this | ||||
| @@ -530,12 +538,16 @@ Page({ | |||||
| that.setData({ | that.setData({ | ||||
| onshow: false | onshow: false | ||||
| }) | }) | ||||
| if (dealOptions && (dealOptions.couponChannelId || dealOptions.couponIds)) { | if (dealOptions && (dealOptions.couponChannelId || dealOptions.couponIds)) { | ||||
| if (dealOptions.couponIds) { | |||||
| if (dealOptions.couponChannelId == "undefined") { | |||||
| this.setData({ | this.setData({ | ||||
| couponIds: dealOptions.couponIds | |||||
| couponIds: dealOptions.couponIds, | |||||
| jumpToIndex: true | |||||
| }) | }) | ||||
| that.getDetail(dealOptions.couponIds, 'notendclock'); | that.getDetail(dealOptions.couponIds, 'notendclock'); | ||||
| // that.getCouponInfo(dealOptions.couponIds, dealOptions.tenantId) | |||||
| } else { | } else { | ||||
| that.getDetail(dealOptions.couponChannelId, 'notendclock'); | that.getDetail(dealOptions.couponChannelId, 'notendclock'); | ||||
| } | } | ||||
| @@ -581,6 +593,18 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| // getCouponInfo(couponId, mallTenantId) { | |||||
| // Http.get({ | |||||
| // url: config.api.couponInfo, | |||||
| // data: { | |||||
| // couponId: couponId, | |||||
| // mallTenantId: mallTenantId | |||||
| // } | |||||
| // }).then(res => { }).catch(err => { | |||||
| // }) | |||||
| // }, | |||||
| getCouponPriceAndStock(couponChannelId) {//获取券价格与库存 | getCouponPriceAndStock(couponChannelId) {//获取券价格与库存 | ||||
| Http.get({ | Http.get({ | ||||
| @@ -174,7 +174,7 @@ Page({ | |||||
| // 转赠判断 | // 转赠判断 | ||||
| if (options.cuserId) { | if (options.cuserId) { | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`, | |||||
| url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}&couponIds=${options.couponId}&tenantId=${options.tenantId}`, | |||||
| }) | }) | ||||
| } else { | } else { | ||||
| // 跳转普通券/消费卡/限时秒杀/砍价详情 | // 跳转普通券/消费卡/限时秒杀/砍价详情 | ||||
| @@ -659,8 +659,7 @@ Page({ | |||||
| }) | }) | ||||
| } | } | ||||
| } | } | ||||
| console.log(JSON.stringify(app.globalData.styleLsit), "styleLsit") | |||||
| // console.log(JSON.stringify(app.globalData.styleLsit), "styleLsit") | |||||
| this.ifShowSqare(); | this.ifShowSqare(); | ||||
| if (wx.getStorageSync("squareList") && wx.getStorageSync("selectedMall")) { | if (wx.getStorageSync("squareList") && wx.getStorageSync("selectedMall")) { | ||||