diff --git a/pages/voucher/voucher.js b/pages/voucher/voucher.js index fb69916..e8aee6a 100644 --- a/pages/voucher/voucher.js +++ b/pages/voucher/voucher.js @@ -121,44 +121,51 @@ Page({ title: "请选择购买洗车金额~", icon: "none" }), !1; - this.isSubmit = !0, wx.showLoading({ - title: "" - }); var i = this; - e.request('/miniprogram/recharge/create', { - id: i.data.selectItemID - }, !0).then(function (t) { - if (wx.hideLoading(), i.isSubmit = !1, 200 != t.code) return wx.showModal({ - title: "提示", - content: t.message - }), !1; - var r = t.data.result; - wx.requestPayment({ - timeStamp: r.timeStamp, - nonceStr: r.nonceStr, - package: r.package, - signType: r.signType, - paySign: r.paySign, - success: function (o) { + wx.showModal({ + title: "提示", + content: "购买洗车金额后不可退,请谨慎购买", + success: function (res) { + if (!res.confirm) return !1; + i.isSubmit = !0, wx.showLoading({ + title: "" + }); + e.request('/miniprogram/recharge/create', { + id: i.data.selectItemID + }, !0).then(function (t) { + if (wx.hideLoading(), i.isSubmit = !1, 200 != t.code) return wx.showModal({ + title: "提示", + content: t.message + }), !1; + var r = t.data.result; + wx.requestPayment({ + timeStamp: r.timeStamp, + nonceStr: r.nonceStr, + package: r.package, + signType: r.signType, + paySign: r.paySign, + success: function (o) { - if (t.data.notify_url) { - // 加载回调接口 - e.request(t.data.notify_url, { - orderid: t.data.orderid - }, !0).then(function (t) { - console.log('pay_success', t); - }).catch(function (t) { - console.log('pay_success', t); - }); - } + if (t.data.notify_url) { + // 加载回调接口 + e.request(t.data.notify_url, { + orderid: t.data.orderid + }, !0).then(function (t) { + console.log('pay_success', t); + }).catch(function (t) { + console.log('pay_success', t); + }); + } - getCurrentPages().length > 1 ? wx.navigateBack({}) : wx.redirectTo({ - url: "/pages/index/index" + getCurrentPages().length > 1 ? wx.navigateBack({}) : wx.redirectTo({ + url: "/pages/index/index" + }); + } }); - } - }); - }).catch(function (t) { - wx.hideLoading(), i.isSubmit = !1; + }).catch(function (t) { + wx.hideLoading(), i.isSubmit = !1; + }); + } }); }, showprovision: function () { @@ -172,4 +179,4 @@ Page({ approve: 1 == e }); } -}); \ No newline at end of file +}); diff --git a/pages/voucher/voucher.wxml b/pages/voucher/voucher.wxml index bbd5468..e781146 100644 --- a/pages/voucher/voucher.wxml +++ b/pages/voucher/voucher.wxml @@ -30,7 +30,7 @@ {{item.paymentamount}}元 - 赠送{{item.bonusamount*1}}元 + 赠送{{item.bonusamount*1}}洗车金额 diff --git a/template/serviceTel/serviceTel.wxml b/template/serviceTel/serviceTel.wxml index 1f5406d..9d8e70e 100644 --- a/template/serviceTel/serviceTel.wxml +++ b/template/serviceTel/serviceTel.wxml @@ -1,6 +1,5 @@ - - + \ No newline at end of file