feat:添加购物车

merge-requests/42/merge
张征 3 years ago
parent 83dd6c4a3f
commit fe4465369a

@ -265,7 +265,14 @@ export default {
},
methods: {
addCart() {
this.$router.push(`/orderSubmit?mode=cart&ids=` + [this.detailData.id])
let ids = [this.detailData.id];
this.$router.push({
path: `/orderSubmit`,
query: {
mode: "cart",
ids,
},
});
},
isStock() {
return this.skuData.some((item) => item.stock > 0);
@ -440,13 +447,13 @@ export default {
const { error, result } = await ApiPutAddCart({
productSkuId: this.curSku.skuId,
productId: this.detailData.id,
number : this.curBuyNum
number: this.curBuyNum,
});
if (error) {
this.$message.error(error.message);
return false;
}
this.$message.success('加入购物车成功~');
this.$message.success("加入购物车成功~");
// this.$Router.push('/cart');
},
},

Loading…
Cancel
Save