From 166e2f77b513495009b244a674e868e932bdac81 Mon Sep 17 00:00:00 2001 From: congzc Date: Tue, 11 Apr 2023 13:40:32 +0800 Subject: [PATCH] 1 --- .../payIntegcoupondetail/index.js | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/pages/integralmall/payIntegcoupondetail/index.js b/pages/integralmall/payIntegcoupondetail/index.js index 52f7888..8e9138c 100644 --- a/pages/integralmall/payIntegcoupondetail/index.js +++ b/pages/integralmall/payIntegcoupondetail/index.js @@ -21,7 +21,8 @@ Page({ showErr: false, showAlert: false, remainingPoints:0, - submitAble:true + submitAble:true, + couponChannelDetail:null }, getUserInfo: function () { let that = this; @@ -221,6 +222,7 @@ Page({ } } }) + }, /** * 支付订单更新 @@ -239,9 +241,26 @@ Page({ }) .then(res => { wx.hideLoading() - wx.navigateTo({ - url: '/pages/integralmall/payIntegcouponStatus/index?title=' + _this.data.data.title + '&coverImg=' + _this.data.data.coverImg + '&remainingPoints=' + _this.data.remainingPoints + '&type=' + _this.data.data.type, - }) + // 如果是停车券直接跳往停车页 + if (_this.couponChannelDetail.type == 51 ||_this.couponChannelDetail.type== 5) { + wx.showModal({ + title: '兑换成功', + cancelText: '我知道了', + confirmText: '去使用', + content: '即将前往停车页面', + success(res) { + if (res.confirm) { + wx.switchTab({ + url: '/index/passCar' + }); + } + } + }) + } else { + wx.navigateTo({ + url: '/pages/integralmall/payIntegcouponStatus/index?title=' + _this.data.data.title + '&coverImg=' + _this.data.data.coverImg + '&remainingPoints=' + _this.data.remainingPoints + '&type=' + _this.data.data.type, + }) + } }) .catch(err => { if (err.code != 12002) { @@ -262,6 +281,8 @@ Page({ couponChannelId: couponChannelId } }).then(res => { + that.couponChannelDetail=res.data + console.log(that.couponChannelDetail.merchantVoList[0].merchantName,'that.couponChannelDetail'); wx.stopPullDownRefresh(); that.getUserInfo() let data = res.data; @@ -279,5 +300,5 @@ Page({ this.setData({ submitAble: true }) - } + }, }) \ No newline at end of file