下单页面加控制

This commit is contained in:
2022-06-11 13:58:59 +08:00
parent aae33064bf
commit e8cad443b3
5 changed files with 714 additions and 704 deletions

View File

@@ -19,7 +19,8 @@
price: "",
coins: "",
platform: ['dtpay'],
oepnType: '',
oepnType: '',
canpay:true,
}
},
mounted() {
@@ -27,7 +28,6 @@
this.price = Number(this.$Route.query.price).toFixed(2)
this.coins = this.$Route.query.coins
if (this.$Route.query.oepnType === 'order') {
console.log('order....');
this.oepnType = this.$Route.query.oepnType
}
},
@@ -60,75 +60,80 @@
})
},
getDTPAY() {
console.log('dt 支付。。。')
dtPAY(this.payNo).then(res => {
console.log(res);
// this.callPay(res, payType)
if (res.state === 'warning') {
uni.showModal({
title: '当前DT积分不足',
content: '不能支付该订单,是否放弃当前支付',
confirmText: '立即充值',
confirmColor: "#34CE98",
cancelText: '放弃支付',
cancelColor: "#666666",
success: (res) => {
if (res.confirm) {
this.$Router.push({
name: "AccountRecharge"
})
} else {
uni.navigateBack();
}
}
})
} else {
if (this.oepnType === 'order') {
uni.showModal({
title: '支付成功',
content: '该订单已支付成功',
confirmText: ' 返回订单',
confirmColor: "#34CE98",
showCancel: false,
success: (res) => {
if (res.confirm) {
this.$Router.back();
eventBus.$emit('paySuccess', this.payNo);
}
}
})
} else {
uni.showModal({
title: '支付成功',
content: '该订单已支付成功',
confirmText: '我的订单',
confirmColor: "#34CE98",
cancelText: '再逛逛',
cancelColor: "#666666",
success: (res) => {
if (res.confirm) {
this.$Router.push({
name: "Order",
params: {
index: 0
},
})
} else {
uni.navigateBack();
}
}
})
}
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true,
})
})
console.log('dt 支付。。。')
if(this.canpay){
this.canpay = false
dtPAY(this.payNo).then(res => {
if (res.state === 'warning') {
uni.showModal({
title: '当前DT积分不足',
content: '不能支付该订单,是否放弃当前支付',
confirmText: '立即充值',
confirmColor: "#34CE98",
cancelText: '放弃支付',
cancelColor: "#666666",
success: (res) => {
if (res.confirm) {
this.$Router.push({
name: "AccountRecharge"
})
} else {
uni.navigateBack();
}
this.canpay = true
}
})
} else {
if (this.oepnType === 'order') {
uni.showModal({
title: '支付成功',
content: '该订单已支付成功',
confirmText: ' 返回订单',
confirmColor: "#34CE98",
showCancel: false,
success: (res) => {
if (res.confirm) {
this.$Router.back();
eventBus.$emit('paySuccess', this.payNo);
}
this.canpay = true
}
})
} else {
uni.showModal({
title: '支付成功',
content: '该订单已支付成功',
confirmText: '我的订单',
confirmColor: "#34CE98",
cancelText: '再逛逛',
cancelColor: "#666666",
success: (res) => {
if (res.confirm) {
this.$Router.push({
name: "Order",
params: {
index: 0
},
})
} else {
uni.navigateBack();
}
this.canpay = true
}
})
}
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true,
})
this.canpay = true
})
}
},
getALPAY(payType) {
alPAY(this.payNo).then(res => {