From bfad163e8a76eda8a88e279f7862b8e9af5de6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Sat, 15 Oct 2022 00:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=94=AF=E4=BB=98=E7=95=8C=E9=9D=A2=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E6=95=88=E6=9E=9C=EF=BC=8C=E5=BC=B9=E7=AA=97=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=A4=B1=E8=B4=A5=EF=BC=8C=E6=94=B9=E4=B8=BA?= =?UTF-8?q?loading=E9=81=AE=E7=BD=A9=E5=B1=82=E6=95=88=E6=9E=9C=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E7=BD=91=E7=BB=9C=E5=A0=B5=E5=A1=9E=E6=9D=9C?= =?UTF-8?q?=E8=83=BD=E9=80=A0=E6=88=90=E5=A4=9A=E6=AC=A1=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/coreshop-paymentsByWx.vue | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/payment/components/coreshop-paymentsByWx.vue b/CoreCms.Net.Uni-App/CoreShop/pages/payment/components/coreshop-paymentsByWx.vue index 21e04f4a..03b4acd8 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/payment/components/coreshop-paymentsByWx.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/payment/components/coreshop-paymentsByWx.vue @@ -123,7 +123,11 @@ }, // 用户点击支付方式处理 toPayHandler(e) { - this.popShow = true; + //this.popShow = true; + uni.showLoading({ + title: '加载中', + mask: true + }); let code = e.target.value.code; let data = { @@ -158,17 +162,21 @@ signType: res.data.paymentParameters.signType, paySign: res.data.paymentParameters.paySign, success: function (e) { - console.log(e); if (e.errMsg === 'requestOrderPayment:ok') { _this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId }); } + setTimeout(function () { + uni.hideLoading(); + }, 500); }, fail: function (res) { if (res.errMsg === 'requestPayment:fail cancel') { - _this.popHide(); + //_this.popHide(); _this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。") } - console.log(res); + setTimeout(function () { + uni.hideLoading(); + }, 500); } }); } else { @@ -181,23 +189,30 @@ signType: res.data.signType, paySign: res.data.paySign, success: function (e) { - console.log(e); if (e.errMsg === 'requestPayment:ok') { _this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId }); } + setTimeout(function () { + uni.hideLoading(); + }, 500); }, fail: function (res) { if (res.errMsg === 'requestPayment:fail cancel') { - _this.popHide(); + //_this.popHide(); _this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。") } - console.log(res); + setTimeout(function () { + uni.hideLoading(); + }, 500); } }); } } else { - _this.$u.toast(res.msg) - _this.popHide(); + //_this.popHide(); + setTimeout(function () { + uni.hideLoading(); + _this.$u.toast(res.msg) + }, 500); } }) break @@ -209,9 +224,15 @@ this.$u.api.pay(data).then(res => { if (res.status) { this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId }); + setTimeout(function () { + uni.hideLoading(); + }, 500); } else { - this.$u.toast(res.msg) - this.popHide(); + //this.popHide(); + setTimeout(function () { + _this.$u.toast(res.msg) + uni.hideLoading(); + }, 500); } }) break