下单页面加控制
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
coins: "",
|
||||
platform: ['dtpay'],
|
||||
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
|
||||
}
|
||||
},
|
||||
@@ -61,74 +61,79 @@
|
||||
},
|
||||
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') {
|
||||
if(this.canpay){
|
||||
this.canpay = false
|
||||
dtPAY(this.payNo).then(res => {
|
||||
if (res.state === 'warning') {
|
||||
uni.showModal({
|
||||
title: '支付成功',
|
||||
content: '该订单已支付成功',
|
||||
confirmText: ' 返回订单',
|
||||
title: '当前DT积分不足',
|
||||
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: '再逛逛',
|
||||
cancelText: '放弃支付',
|
||||
cancelColor: "#666666",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.$Router.push({
|
||||
name: "Order",
|
||||
params: {
|
||||
index: 0
|
||||
},
|
||||
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,
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
mask: true,
|
||||
})
|
||||
this.canpay = true
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
getALPAY(payType) {
|
||||
alPAY(this.payNo).then(res => {
|
||||
|
||||
@@ -65,11 +65,9 @@
|
||||
total : 0,
|
||||
freight : 0,
|
||||
address : "",
|
||||
remark : ""
|
||||
remark : "",
|
||||
canApply :true
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
|
||||
},
|
||||
onShow(){
|
||||
if(JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
|
||||
@@ -114,24 +112,34 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
verify({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
qty : this.qty,
|
||||
address_id : this.address.address_id,
|
||||
remark : this.remark || ''
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
this.$store.commit('setAddress', {})
|
||||
this.$Router.replace({
|
||||
name: 'Pay',
|
||||
params: {
|
||||
orderNo: res.order_no,
|
||||
price : res.total,
|
||||
coins : res.coins,
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
if(this.canApply){
|
||||
this.canApply = false;
|
||||
verify({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
qty : this.qty,
|
||||
address_id : this.address.address_id,
|
||||
remark : this.remark || ''
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
this.$store.commit('setAddress', {})
|
||||
this.$Router.replace({
|
||||
name: 'Pay',
|
||||
params: {
|
||||
orderNo: res.order_no,
|
||||
price : res.total,
|
||||
coins : res.coins,
|
||||
}
|
||||
})
|
||||
this.canApply = true
|
||||
}).catch(err=>{
|
||||
this.canApply = true
|
||||
})
|
||||
}else{
|
||||
this.canApply = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -302,10 +302,7 @@
|
||||
background-color: $text-price;
|
||||
display: inline-block;
|
||||
}
|
||||
// .card-title{
|
||||
// font-weight: normal;
|
||||
// font-size: 28rpx!important;
|
||||
// }
|
||||
|
||||
.card-box {
|
||||
// &-item{
|
||||
// background: #fff !important;
|
||||
|
||||
1052
unpackage/dist/dev/app-plus/app-service.js
vendored
1052
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
162
unpackage/dist/dev/app-plus/app-view.js
vendored
162
unpackage/dist/dev/app-plus/app-view.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user