This commit is contained in:
Mr.jiang 2024-07-16 17:40:41 +08:00
parent 0237af3c38
commit 3aaacf98f0
2 changed files with 523 additions and 431 deletions

View File

@ -607,7 +607,6 @@
payJZ() {
let that = this;
if (that.openWay == 1) { //
uni.showModal({
title: '付款提示',
content: '确认支付' + that.tpayMoney + '元吗?',
@ -615,16 +614,18 @@
if (re.confirm) {
that.$queue.showLoading('支付中...')
// console.log('');
if (that.openWay == 1) { //
that.$Request.post("/app/artificer/payOrders", {
ordersId: that.ordersId,
}).then(ret => {
uni.hideLoading();
if (ret.code == 0) {
uni.showToast({
title: '支付成功',
icon: 'none'
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
// that.getOrder()
} else {
uni.showToast({
@ -633,11 +634,6 @@
})
}
});
} else if (re.cancel) {
// that.getOrder()
}
}
})
} else if (that.openWay == 2) { //
// #ifdef MP-WEIXIN
let data = {
@ -656,10 +652,11 @@
signType: ret.data.signType,
paySign: ret.data.sign,
success: function(ret) {
console.log(ret)
uni.showToast({
title: '支付成功',
icon: 'none'
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
// that.getOrder()
// this.$queue.showToast('');
@ -691,6 +688,12 @@
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
that.showpay = false
if (rea.code == 0) {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.callPay(rea.data);
} else {
uni.showToast({
@ -707,6 +710,12 @@
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
that.showpay = false
if (rea.code == 0) {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
const urlArr = window.location.href;
const hostUrl = urlArr.split("/");
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
@ -744,6 +753,12 @@
}
that.$Request.post('/app/aliPay/payOrder', data).then(
rea => {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.showpay = false
const div = document.createElement('div')
div.innerHTML = rea.data //form
@ -759,12 +774,24 @@
}
that.$Request.post('/app/aliPay/payOrder', data).then(
rea => {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.showpay = false
that.setPayment('alipay', rea.data);
});
// #endif
}
} else if (re.cancel) {
// that.getOrder()
}
}
})
},
saveJZ(classifyId) {
let data = {
@ -928,7 +955,6 @@
this.payJZ();
return;
}
if (that.openWay == 1) { //
uni.showModal({
title: '付款提示',
content: '确认支付' + that.tpayMoney + '元吗?',
@ -936,6 +962,7 @@
if (re.confirm) {
that.$queue.showLoading('支付中...')
console.log('用户点击确定');
if (that.openWay == 1) { //
that.$Request.post("/app/artificer/payOrders", {
ordersId: that.ordersId,
}).then(res => {
@ -944,7 +971,10 @@
uni.showToast({
title: '支付成功'
})
// that.getOrder()
uni.switchTab({
url: '/pages/my/index'
})
that.getOrder()
} else {
uni.showToast({
title: res.msg,
@ -952,13 +982,6 @@
})
}
});
} else if (re.cancel) {
uni.hideLoading();
console.log('用户点击取消');
}
}
})
} else if (that.openWay == 2) { //
that.$queue.showLoading('支付中...')
// #ifdef MP-WEIXIN
@ -978,17 +1001,17 @@
signType: ret.data.signType,
paySign: ret.data.sign,
success: function(ret) {
console.log(ret)
uni.showToast({
title: '支付成功',
icon: 'none'
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.getOrder()
// that.getOrder()
// this.$queue.showToast('');
// uni.switchTab({
// url: '/pages/my/index'
// })
},
fail: function(err) {
// this.$queue.showToast('');
@ -1013,6 +1036,12 @@
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
that.showpay = false
if (rea.code == 0) {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.callPay(rea.data);
} else {
uni.showToast({
@ -1035,6 +1064,12 @@
// window.location = rea.mweb_url + url
that.showpay = false
if (rea.code == 0) {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
const urlArr = window.location.href;
const hostUrl = urlArr.split("/");
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
@ -1073,6 +1108,12 @@
}
that.$Request.post('/app/aliPay/payOrder', data).then(
rea => {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
const div = document.createElement('div')
div.innerHTML = rea.data //form
document.body.appendChild(div)
@ -1087,10 +1128,25 @@
}
that.$Request.post('/app/aliPay/payOrder', data).then(
rea => {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.setPayment('alipay', rea.data);
});
// #endif
}
} else if (re.cancel) {
uni.hideLoading();
console.log('用户点击取消');
}
}
})
},
callPay: function(response) {
if (typeof WeixinJSBridge === "undefined") {

View File

@ -957,11 +957,10 @@
pay() {
let that = this
this.showpay = false
if (this.paySel != 0) {
this.payJZ();
return;
}
if (that.openWay == 1) { //
// if (this.paySel != 0) {
// this.payJZ();
// return;
// }
uni.showModal({
title: '付款提示',
content: '确认支付' + that.tpayMoney + '元吗?',
@ -969,6 +968,7 @@
if (re.confirm) {
that.$queue.showLoading('支付中...')
console.log('用户点击确定');
if (that.openWay == 1) { //
that.$Request.post("/app/artificer/payOrders", {
ordersId: that.ordersId,
}).then(res => {
@ -977,6 +977,9 @@
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
// that.getOrder()
} else {
uni.showToast({
@ -985,13 +988,6 @@
})
}
});
} else if (re.cancel) {
uni.hideLoading();
console.log('用户点击取消');
}
}
})
} else if (that.openWay == 2) { //
that.$queue.showLoading('支付中...')
// #ifdef MP-WEIXIN
@ -1011,10 +1007,11 @@
signType: ret.data.signType,
paySign: ret.data.sign,
success: function(ret) {
console.log(ret)
uni.showToast({
title: '支付成功',
icon: 'none'
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
// that.getOrder()
// this.$queue.showToast('');
@ -1046,6 +1043,12 @@
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
that.showpay = false
if (rea.code == 0) {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.callPay(rea.data);
} else {
uni.showToast({
@ -1068,6 +1071,12 @@
// window.location = rea.mweb_url + url
that.showpay = false
if (rea.code == 0) {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
const urlArr = window.location.href;
const hostUrl = urlArr.split("/");
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
@ -1093,6 +1102,12 @@
console.log(rea)
that.showpay = false
if (rea.code == 0) {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data));
}
});
@ -1106,6 +1121,12 @@
}
that.$Request.post('/app/aliPay/payOrder', data).then(
rea => {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
const div = document.createElement('div')
div.innerHTML = rea.data //form
document.body.appendChild(div)
@ -1120,10 +1141,25 @@
}
that.$Request.post('/app/aliPay/payOrder', data).then(
rea => {
uni.showToast({
title: '支付成功'
})
uni.switchTab({
url: '/pages/my/index'
})
that.setPayment('alipay', rea.data);
});
// #endif
}
} else if (re.cancel) {
uni.hideLoading();
console.log('用户点击取消');
}
}
})
},
callPay: function(response) {
if (typeof WeixinJSBridge === "undefined") {