fix : 修改商城首页商品加入购物车时的购物车的数量显示问题
This commit is contained in:
parent
fdd5bbfb3b
commit
dfbfb0440e
@ -176,7 +176,7 @@
|
||||
<u-number-box
|
||||
:min="0"
|
||||
v-model="items.quantity"
|
||||
@change="handleQuantityChange(items)"
|
||||
@change="(value) => handleQuantityChange(value,items)"
|
||||
>
|
||||
<view slot="minus" class="minus">
|
||||
<u-icon name="minus" size="20"></u-icon>
|
||||
@ -244,7 +244,7 @@
|
||||
<u-number-box
|
||||
v-model="ite.quantity"
|
||||
:min="0"
|
||||
@change="handleQuantityChange(ite)"
|
||||
@change="(value) => handleQuantityChange(value,ite)"
|
||||
>
|
||||
<view slot="minus" class="minus">
|
||||
<u-icon name="minus" size="20"></u-icon>
|
||||
@ -452,9 +452,7 @@ export default {
|
||||
this.getGoodsList();
|
||||
},
|
||||
//商品数量变化
|
||||
handleQuantityChange(item) {
|
||||
console.log("🚀 ~ handleQuantityChange ~ value:", item);
|
||||
const goodsId = "";
|
||||
handleQuantityChange(val,item) {
|
||||
if (item.commodity_goods_info_list.length) {
|
||||
this.goodsId = item.commodity_goods_info_list[0].id;
|
||||
} else {
|
||||
@ -465,19 +463,16 @@ export default {
|
||||
goods_id_and_count: [
|
||||
{
|
||||
goods_id: this.goodsId,
|
||||
count: item.quantity ? item.quantity + 1 : 1,
|
||||
count: val.value,
|
||||
},
|
||||
],
|
||||
};
|
||||
console.log("🚀 ~ handleQuantityChange ~ params:", params);
|
||||
request(apiArr.updateCar, "POST", params).then((res) => {
|
||||
console.log(res);
|
||||
this.getShopCarList();
|
||||
uni.showToast({
|
||||
title: "操作成功!",
|
||||
success() {
|
||||
// setTimeout(() => {
|
||||
// that.getBanlance()
|
||||
// }, 1500)
|
||||
},
|
||||
});
|
||||
});
|
||||
@ -488,6 +483,9 @@ export default {
|
||||
this.top = meun.top;
|
||||
this.localHeight = meun.height;
|
||||
this.getCateList();
|
||||
// this.getShopCarList();
|
||||
},
|
||||
onShow() {
|
||||
this.getShopCarList();
|
||||
},
|
||||
onReachBottom() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user