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