下单页面加控制
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user