下单页面加控制

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

@@ -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>