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; },