Commit 905775e3 authored by 罗超's avatar 罗超

1

parent 25f54dc9
...@@ -461,6 +461,9 @@ export default { ...@@ -461,6 +461,9 @@ export default {
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
goZhifuAli(item) { goZhifuAli(item) {
this.disabledBtn = true; this.disabledBtn = true;
uni.showLoading({
title: "支付中",
});
console.log(item, "item"); console.log(item, "item");
let url = "/api/WeChatPay/GetTravlePayInfo"; let url = "/api/WeChatPay/GetTravlePayInfo";
this.price = item.preferPrice; this.price = item.preferPrice;
...@@ -475,7 +478,15 @@ export default { ...@@ -475,7 +478,15 @@ export default {
}, },
}, },
(res) => { (res) => {
if (res.data) {
this.goPayAli(res.data, item); this.goPayAli(res.data, item);
} else {
uni.hideLoading();
uni.showToast({
title: "获取交易号失败",
duration: 2000,
});
}
} }
); );
}, },
...@@ -494,6 +505,7 @@ export default { ...@@ -494,6 +505,7 @@ export default {
}; };
that.payAliCallback(obj); that.payAliCallback(obj);
} else { } else {
uni.hideLoading();
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
...@@ -503,6 +515,7 @@ export default { ...@@ -503,6 +515,7 @@ export default {
fail: function (err) { fail: function (err) {
console.log("fail:", err); console.log("fail:", err);
this.disabledBtn = false; this.disabledBtn = false;
uni.hideLoading();
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
...@@ -525,6 +538,7 @@ export default { ...@@ -525,6 +538,7 @@ export default {
}, },
(res) => { (res) => {
console.log("cb", res); console.log("cb", res);
uni.hideLoading();
this.disabledBtn = false; this.disabledBtn = false;
uni.redirectTo({ uni.redirectTo({
url: url:
...@@ -536,6 +550,7 @@ export default { ...@@ -536,6 +550,7 @@ export default {
(err) => { (err) => {
console.log("cb2", err); console.log("cb2", err);
this.disabledBtn = false; this.disabledBtn = false;
uni.hideLoading();
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
......
...@@ -841,6 +841,9 @@ export default { ...@@ -841,6 +841,9 @@ export default {
//支付宝支付 //支付宝支付
goZhifuAli() { goZhifuAli() {
this.submit = true; this.submit = true;
uni.showLoading({
title: "支付中",
});
let url = "/api/WeChatPay/GetTravlePayInfo"; let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.orderData.model.Title; let GoodsName = this.orderData.model.Title;
this.request2( this.request2(
...@@ -857,6 +860,7 @@ export default { ...@@ -857,6 +860,7 @@ export default {
if (res.data) { if (res.data) {
this.goPayAli(res.data); this.goPayAli(res.data);
} else { } else {
uni.hideLoading();
uni.showToast({ uni.showToast({
title: "获取交易号失败", title: "获取交易号失败",
duration: 2000, duration: 2000,
...@@ -880,6 +884,7 @@ export default { ...@@ -880,6 +884,7 @@ export default {
}; };
that.payAliCallback(obj); that.payAliCallback(obj);
} else { } else {
uni.hideLoading();
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
...@@ -888,6 +893,7 @@ export default { ...@@ -888,6 +893,7 @@ export default {
}, },
fail: function (err) { fail: function (err) {
console.log("fail:", err); console.log("fail:", err);
uni.hideLoading();
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
...@@ -913,6 +919,7 @@ export default { ...@@ -913,6 +919,7 @@ export default {
}, },
(res) => { (res) => {
that.submit = false; that.submit = false;
uni.hideLoading();
uni.redirectTo({ uni.redirectTo({
url: url:
"/pages/jiuzhai/paysuccess?PreferPrice=" + "/pages/jiuzhai/paysuccess?PreferPrice=" +
...@@ -922,6 +929,7 @@ export default { ...@@ -922,6 +929,7 @@ export default {
}, },
(err) => { (err) => {
console.log("err", err); console.log("err", err);
uni.hideLoading();
that.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment