From 76839f36849f842f3721c823f33ce5b0305df308 Mon Sep 17 00:00:00 2001 From: xiaofeng Date: Tue, 16 Jul 2019 23:50:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile-web/src/page/product/detail.vue | 20 ++- mobile-web/src/page/user/favorite/list.vue | 180 +++++++++++---------- 2 files changed, 111 insertions(+), 89 deletions(-) diff --git a/mobile-web/src/page/product/detail.vue b/mobile-web/src/page/product/detail.vue index 55e073ed..1a50657b 100644 --- a/mobile-web/src/page/product/detail.vue +++ b/mobile-web/src/page/product/detail.vue @@ -292,6 +292,20 @@ } }); }, + initHasUserSpuFavorite(spuId){ + if (!checkLogin()) { + this.hasCollectionType = 0; + return; + } + //初始化验证商品收藏 + hasUserSpuFavorite(spuId).then(data => { + let hasCollection = data; + // alert("是否收藏==" + hasCollection); + if (hasCollection) { + this.hasCollectionType = 1; + } + }); + }, onClickCart() { this.$router.push('/cart'); @@ -430,6 +444,7 @@ // 初始化 attrValueMap this.attrValueMap.set(attr.attrValueId, attr.attrValueName); } + } // debugger; this.vanSku = vanSku; @@ -439,6 +454,9 @@ this.initialSku.quantity = 1; // 执行 sku 价格计算 this.doCalcSkuPrice(this.initialSku.id); + + this.initHasUserSpuFavorite(id); + }); // 获得购物车数量 if (checkLogin()) { @@ -453,7 +471,7 @@