diff --git a/components/goodPopup.vue b/components/goodPopup.vue index 771fdc9..23d9d2d 100644 --- a/components/goodPopup.vue +++ b/components/goodPopup.vue @@ -20,20 +20,20 @@ 小计 ¥ {{subtotal}} - + 商品重量* - + - + 商品数量* - 取消 + 取消 - 确定 + 确定 diff --git a/pages/index/index.vue b/pages/index/index.vue index 95b516c..aaf6909 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -96,8 +96,8 @@ - - + + @@ -111,7 +111,7 @@ ¥{{item.sell}} - + @@ -215,29 +215,17 @@ getGoodList(); } - const cartList = reactive(new Map()); const addCart = (id, cart_num) => { //加入购物车 cartCreateApi({ cart_num: cart_num, is_new: 0, // 是否直接购买0否1是 goods_id: id }).then(res => { - console.log(res); - let now = cartList.get(id) || 0; - cartList.set(id, now + 1); getCartList(); - }) - } - const removeCart = (id) => { - let num = cartList.get(id) || 0; - if (num == 0) return; - cartChangeApi({ - goods_id: id, - cart_num: num-- - }).then(res => { - console.log(res); - cartList.set(id, num) - }) + }).catch(err=>{ + console.log(err); + uni.$u.toast('添加失败') + }) } const keyword = ref(''); diff --git a/pages/my/my.vue b/pages/my/my.vue index e683824..cd860fb 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -24,14 +24,9 @@ {{orderCount.no_pay}} - - 待发货 - {{orderCount.waiting}} - - 待收货 - {{orderCount.receiving}} + {{orderCount.waiting}}