This commit is contained in:
parent
0237af3c38
commit
3aaacf98f0
|
@ -607,7 +607,6 @@
|
||||||
|
|
||||||
payJZ() {
|
payJZ() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (that.openWay == 1) { //零钱支付
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '付款提示',
|
title: '付款提示',
|
||||||
content: '确认支付' + that.tpayMoney + '元吗?',
|
content: '确认支付' + that.tpayMoney + '元吗?',
|
||||||
|
@ -615,16 +614,18 @@
|
||||||
if (re.confirm) {
|
if (re.confirm) {
|
||||||
that.$queue.showLoading('支付中...')
|
that.$queue.showLoading('支付中...')
|
||||||
// console.log('用户点击确定');
|
// console.log('用户点击确定');
|
||||||
|
if (that.openWay == 1) { //零钱支付
|
||||||
that.$Request.post("/app/artificer/payOrders", {
|
that.$Request.post("/app/artificer/payOrders", {
|
||||||
ordersId: that.ordersId,
|
ordersId: that.ordersId,
|
||||||
}).then(ret => {
|
}).then(ret => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (ret.code == 0) {
|
if (ret.code == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付成功',
|
title: '支付成功'
|
||||||
icon: 'none'
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
})
|
})
|
||||||
// that.getOrder()
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -633,11 +634,6 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (re.cancel) {
|
|
||||||
// that.getOrder()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else if (that.openWay == 2) { //微信支付
|
} else if (that.openWay == 2) { //微信支付
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
let data = {
|
let data = {
|
||||||
|
@ -656,10 +652,11 @@
|
||||||
signType: ret.data.signType,
|
signType: ret.data.signType,
|
||||||
paySign: ret.data.sign,
|
paySign: ret.data.sign,
|
||||||
success: function(ret) {
|
success: function(ret) {
|
||||||
console.log(ret)
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付成功',
|
title: '支付成功'
|
||||||
icon: 'none'
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
})
|
})
|
||||||
// that.getOrder()
|
// that.getOrder()
|
||||||
// this.$queue.showToast('支付成功');
|
// this.$queue.showToast('支付成功');
|
||||||
|
@ -691,6 +688,12 @@
|
||||||
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
|
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
if (rea.code == 0) {
|
if (rea.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
that.callPay(rea.data);
|
that.callPay(rea.data);
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -707,6 +710,12 @@
|
||||||
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
|
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
if (rea.code == 0) {
|
if (rea.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
const urlArr = window.location.href;
|
const urlArr = window.location.href;
|
||||||
const hostUrl = urlArr.split("/");
|
const hostUrl = urlArr.split("/");
|
||||||
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
|
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
|
||||||
|
@ -744,6 +753,12 @@
|
||||||
}
|
}
|
||||||
that.$Request.post('/app/aliPay/payOrder', data).then(
|
that.$Request.post('/app/aliPay/payOrder', data).then(
|
||||||
rea => {
|
rea => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div')
|
||||||
div.innerHTML = rea.data //此处form就是后台返回接收到的数据
|
div.innerHTML = rea.data //此处form就是后台返回接收到的数据
|
||||||
|
@ -759,12 +774,24 @@
|
||||||
}
|
}
|
||||||
that.$Request.post('/app/aliPay/payOrder', data).then(
|
that.$Request.post('/app/aliPay/payOrder', data).then(
|
||||||
rea => {
|
rea => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
that.setPayment('alipay', rea.data);
|
that.setPayment('alipay', rea.data);
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (re.cancel) {
|
||||||
|
// that.getOrder()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
saveJZ(classifyId) {
|
saveJZ(classifyId) {
|
||||||
let data = {
|
let data = {
|
||||||
|
@ -928,7 +955,6 @@
|
||||||
this.payJZ();
|
this.payJZ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (that.openWay == 1) { //零钱支付
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '付款提示',
|
title: '付款提示',
|
||||||
content: '确认支付' + that.tpayMoney + '元吗?',
|
content: '确认支付' + that.tpayMoney + '元吗?',
|
||||||
|
@ -936,6 +962,7 @@
|
||||||
if (re.confirm) {
|
if (re.confirm) {
|
||||||
that.$queue.showLoading('支付中...')
|
that.$queue.showLoading('支付中...')
|
||||||
console.log('用户点击确定');
|
console.log('用户点击确定');
|
||||||
|
if (that.openWay == 1) { //零钱支付
|
||||||
that.$Request.post("/app/artificer/payOrders", {
|
that.$Request.post("/app/artificer/payOrders", {
|
||||||
ordersId: that.ordersId,
|
ordersId: that.ordersId,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -944,7 +971,10 @@
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付成功'
|
title: '支付成功'
|
||||||
})
|
})
|
||||||
// that.getOrder()
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
|
that.getOrder()
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
|
@ -952,13 +982,6 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (re.cancel) {
|
|
||||||
uni.hideLoading();
|
|
||||||
console.log('用户点击取消');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
} else if (that.openWay == 2) { //微信支付
|
} else if (that.openWay == 2) { //微信支付
|
||||||
that.$queue.showLoading('支付中...')
|
that.$queue.showLoading('支付中...')
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
@ -978,17 +1001,17 @@
|
||||||
signType: ret.data.signType,
|
signType: ret.data.signType,
|
||||||
paySign: ret.data.sign,
|
paySign: ret.data.sign,
|
||||||
success: function(ret) {
|
success: function(ret) {
|
||||||
console.log(ret)
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付成功',
|
title: '支付成功'
|
||||||
icon: 'none'
|
|
||||||
})
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
|
that.getOrder()
|
||||||
// that.getOrder()
|
// that.getOrder()
|
||||||
// this.$queue.showToast('支付成功');
|
// this.$queue.showToast('支付成功');
|
||||||
|
|
||||||
// uni.switchTab({
|
|
||||||
// url: '/pages/my/index'
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
fail: function(err) {
|
fail: function(err) {
|
||||||
// this.$queue.showToast('支付失败');
|
// this.$queue.showToast('支付失败');
|
||||||
|
@ -1013,6 +1036,12 @@
|
||||||
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
|
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
if (rea.code == 0) {
|
if (rea.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
that.callPay(rea.data);
|
that.callPay(rea.data);
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -1035,6 +1064,12 @@
|
||||||
// window.location = rea.mweb_url + url
|
// window.location = rea.mweb_url + url
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
if (rea.code == 0) {
|
if (rea.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
const urlArr = window.location.href;
|
const urlArr = window.location.href;
|
||||||
const hostUrl = urlArr.split("/");
|
const hostUrl = urlArr.split("/");
|
||||||
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
|
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
|
||||||
|
@ -1073,6 +1108,12 @@
|
||||||
}
|
}
|
||||||
that.$Request.post('/app/aliPay/payOrder', data).then(
|
that.$Request.post('/app/aliPay/payOrder', data).then(
|
||||||
rea => {
|
rea => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div')
|
||||||
div.innerHTML = rea.data //此处form就是后台返回接收到的数据
|
div.innerHTML = rea.data //此处form就是后台返回接收到的数据
|
||||||
document.body.appendChild(div)
|
document.body.appendChild(div)
|
||||||
|
@ -1087,10 +1128,25 @@
|
||||||
}
|
}
|
||||||
that.$Request.post('/app/aliPay/payOrder', data).then(
|
that.$Request.post('/app/aliPay/payOrder', data).then(
|
||||||
rea => {
|
rea => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
that.setPayment('alipay', rea.data);
|
that.setPayment('alipay', rea.data);
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (re.cancel) {
|
||||||
|
uni.hideLoading();
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
callPay: function(response) {
|
callPay: function(response) {
|
||||||
if (typeof WeixinJSBridge === "undefined") {
|
if (typeof WeixinJSBridge === "undefined") {
|
||||||
|
|
|
@ -957,11 +957,10 @@
|
||||||
pay() {
|
pay() {
|
||||||
let that = this
|
let that = this
|
||||||
this.showpay = false
|
this.showpay = false
|
||||||
if (this.paySel != 0) {
|
// if (this.paySel != 0) {
|
||||||
this.payJZ();
|
// this.payJZ();
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (that.openWay == 1) { //零钱支付
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '付款提示',
|
title: '付款提示',
|
||||||
content: '确认支付' + that.tpayMoney + '元吗?',
|
content: '确认支付' + that.tpayMoney + '元吗?',
|
||||||
|
@ -969,6 +968,7 @@
|
||||||
if (re.confirm) {
|
if (re.confirm) {
|
||||||
that.$queue.showLoading('支付中...')
|
that.$queue.showLoading('支付中...')
|
||||||
console.log('用户点击确定');
|
console.log('用户点击确定');
|
||||||
|
if (that.openWay == 1) { //零钱支付
|
||||||
that.$Request.post("/app/artificer/payOrders", {
|
that.$Request.post("/app/artificer/payOrders", {
|
||||||
ordersId: that.ordersId,
|
ordersId: that.ordersId,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -977,6 +977,9 @@
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付成功'
|
title: '支付成功'
|
||||||
})
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
// that.getOrder()
|
// that.getOrder()
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -985,13 +988,6 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (re.cancel) {
|
|
||||||
uni.hideLoading();
|
|
||||||
console.log('用户点击取消');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
} else if (that.openWay == 2) { //微信支付
|
} else if (that.openWay == 2) { //微信支付
|
||||||
that.$queue.showLoading('支付中...')
|
that.$queue.showLoading('支付中...')
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
@ -1011,10 +1007,11 @@
|
||||||
signType: ret.data.signType,
|
signType: ret.data.signType,
|
||||||
paySign: ret.data.sign,
|
paySign: ret.data.sign,
|
||||||
success: function(ret) {
|
success: function(ret) {
|
||||||
console.log(ret)
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付成功',
|
title: '支付成功'
|
||||||
icon: 'none'
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
})
|
})
|
||||||
// that.getOrder()
|
// that.getOrder()
|
||||||
// this.$queue.showToast('支付成功');
|
// this.$queue.showToast('支付成功');
|
||||||
|
@ -1046,6 +1043,12 @@
|
||||||
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
|
that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
if (rea.code == 0) {
|
if (rea.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
that.callPay(rea.data);
|
that.callPay(rea.data);
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -1068,6 +1071,12 @@
|
||||||
// window.location = rea.mweb_url + url
|
// window.location = rea.mweb_url + url
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
if (rea.code == 0) {
|
if (rea.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
const urlArr = window.location.href;
|
const urlArr = window.location.href;
|
||||||
const hostUrl = urlArr.split("/");
|
const hostUrl = urlArr.split("/");
|
||||||
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
|
const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
|
||||||
|
@ -1093,6 +1102,12 @@
|
||||||
console.log(rea)
|
console.log(rea)
|
||||||
that.showpay = false
|
that.showpay = false
|
||||||
if (rea.code == 0) {
|
if (rea.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data));
|
that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1106,6 +1121,12 @@
|
||||||
}
|
}
|
||||||
that.$Request.post('/app/aliPay/payOrder', data).then(
|
that.$Request.post('/app/aliPay/payOrder', data).then(
|
||||||
rea => {
|
rea => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
const div = document.createElement('div')
|
const div = document.createElement('div')
|
||||||
div.innerHTML = rea.data //此处form就是后台返回接收到的数据
|
div.innerHTML = rea.data //此处form就是后台返回接收到的数据
|
||||||
document.body.appendChild(div)
|
document.body.appendChild(div)
|
||||||
|
@ -1120,10 +1141,25 @@
|
||||||
}
|
}
|
||||||
that.$Request.post('/app/aliPay/payOrder', data).then(
|
that.$Request.post('/app/aliPay/payOrder', data).then(
|
||||||
rea => {
|
rea => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功'
|
||||||
|
})
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/my/index'
|
||||||
|
})
|
||||||
that.setPayment('alipay', rea.data);
|
that.setPayment('alipay', rea.data);
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (re.cancel) {
|
||||||
|
uni.hideLoading();
|
||||||
|
console.log('用户点击取消');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
callPay: function(response) {
|
callPay: function(response) {
|
||||||
if (typeof WeixinJSBridge === "undefined") {
|
if (typeof WeixinJSBridge === "undefined") {
|
||||||
|
|
Loading…
Reference in New Issue