下单页面加控制

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: "", price: "",
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
} }
}, },
@@ -60,75 +60,80 @@
}) })
}, },
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({ uni.showModal({
title: '当前DT积分不足', title: '当前DT积分不足',
content: '不能支付该订单,是否放弃当前支付', content: '不能支付该订单,是否放弃当前支付',
confirmText: '立即充值', confirmText: '立即充值',
confirmColor: "#34CE98", confirmColor: "#34CE98",
cancelText: '放弃支付', cancelText: '放弃支付',
cancelColor: "#666666", cancelColor: "#666666",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.$Router.push({ this.$Router.push({
name: "AccountRecharge" name: "AccountRecharge"
}) })
} else { } else {
uni.navigateBack(); uni.navigateBack();
} }
} this.canpay = true
}) }
} else { })
if (this.oepnType === 'order') { } else {
uni.showModal({ if (this.oepnType === 'order') {
title: '支付成功', uni.showModal({
content: '该订单已支付成功', title: '支付成功',
confirmText: ' 返回订单', content: '该订单已支付成功',
confirmColor: "#34CE98", confirmText: ' 返回订单',
showCancel: false, confirmColor: "#34CE98",
success: (res) => { showCancel: false,
if (res.confirm) { success: (res) => {
this.$Router.back(); if (res.confirm) {
eventBus.$emit('paySuccess', this.payNo); this.$Router.back();
} eventBus.$emit('paySuccess', this.payNo);
} }
}) this.canpay = true
} else { }
uni.showModal({ })
title: '支付成功', } else {
content: '该订单已支付成功', uni.showModal({
confirmText: '我的订单', title: '支付成功',
confirmColor: "#34CE98", content: '该订单已支付成功',
cancelText: '再逛逛', confirmText: '我的订单',
cancelColor: "#666666", confirmColor: "#34CE98",
success: (res) => { cancelText: '再逛逛',
if (res.confirm) { cancelColor: "#666666",
this.$Router.push({ success: (res) => {
name: "Order", if (res.confirm) {
params: { this.$Router.push({
index: 0 name: "Order",
}, params: {
}) index: 0
} else { },
uni.navigateBack(); })
} } else {
} uni.navigateBack();
}) }
} this.canpay = true
}
} })
}).catch(err => { }
uni.showToast({
title: err.message, }
icon: "none", }).catch(err => {
mask: true, uni.showToast({
}) title: err.message,
}) 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