下单页面加控制

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

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

View File

@@ -65,11 +65,9 @@
total : 0, total : 0,
freight : 0, freight : 0,
address : "", address : "",
remark : "" remark : "",
canApply :true
}; };
},
computed:{
}, },
onShow(){ onShow(){
if(JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress if(JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
@@ -114,24 +112,34 @@
}) })
return return
} }
verify({ if(this.canApply){
goods_sku_id: this.$Route.query.skuId, this.canApply = false;
qty : this.qty, verify({
address_id : this.address.address_id, goods_sku_id: this.$Route.query.skuId,
remark : this.remark || '' qty : this.qty,
}).then(res => { address_id : this.address.address_id,
console.log(res); remark : this.remark || ''
this.$store.commit('setAddress', {}) }).then(res => {
this.$Router.replace({ console.log(res);
name: 'Pay', this.$store.commit('setAddress', {})
params: { this.$Router.replace({
orderNo: res.order_no, name: 'Pay',
price : res.total, params: {
coins : res.coins, orderNo: res.order_no,
} price : res.total,
}) coins : res.coins,
}) }
} })
this.canApply = true
}).catch(err=>{
this.canApply = true
})
}else{
this.canApply = true
}
}
} }
} }
</script> </script>

View File

@@ -302,10 +302,7 @@
background-color: $text-price; background-color: $text-price;
display: inline-block; display: inline-block;
} }
// .card-title{
// font-weight: normal;
// font-size: 28rpx!important;
// }
.card-box { .card-box {
// &-item{ // &-item{
// background: #fff !important; // background: #fff !important;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long