From 86df2a2950b7695fc2f88463b79a94899ab5a484 Mon Sep 17 00:00:00 2001 From: 1154079537 <1154079537@qq.com> Date: Sat, 18 May 2024 19:41:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E5=AD=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order_addcart/order_addcart.vue | 2 +- pages/store/home/index.vue | 2 ++ utils/util.js | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pages/order_addcart/order_addcart.vue b/pages/order_addcart/order_addcart.vue index 71d0740..b804fdf 100644 --- a/pages/order_addcart/order_addcart.vue +++ b/pages/order_addcart/order_addcart.vue @@ -91,7 +91,7 @@ ¥{{goods.productAttr.price}} /{{goods.productAttr.sku || goods.product.unit_name}} + class="money-unit">/{{goods.product.unit_name || goods.product.unit_name}} diff --git a/pages/store/home/index.vue b/pages/store/home/index.vue index 803e8aa..32913bc 100644 --- a/pages/store/home/index.vue +++ b/pages/store/home/index.vue @@ -516,6 +516,8 @@ }, watch: { tabActive: function(value, old) { + if (!value || !old) return; + switch (value) { case 1: if (this.goods.length == 0 && this.isCoupon == 0) { diff --git a/utils/util.js b/utils/util.js index 816ad4b..cdd1a3d 100644 --- a/utils/util.js +++ b/utils/util.js @@ -865,7 +865,10 @@ export default { if (typeof list != 'object') return []; if (sp === undefined) sp = []; for (var i = 0; i < list.length; i++) { - sp.push(list[i]); + let product = sp.find(item => item.product_id == list[i].product_id); + console.log(product); + if (!product) + sp.push(list[i]); } return sp; },