From 1eaf229d433c1812eb05727b329ed0eac2a82a53 Mon Sep 17 00:00:00 2001 From: yangsai Date: Wed, 23 Oct 2024 17:24:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods_cate/goods_cate.vue | 17 ++++++++++------- pages/goods_cate/template/template3.vue | 12 +++++++++--- pages/user/index.vue | 1 - 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/pages/goods_cate/goods_cate.vue b/pages/goods_cate/goods_cate.vue index 38dbad1..fe87f53 100644 --- a/pages/goods_cate/goods_cate.vue +++ b/pages/goods_cate/goods_cate.vue @@ -73,13 +73,16 @@ index: 3 }) } - setTimeout((res)=>{ - if(this.showTemplateTwo){ - this.$refs.classTwo.getCartNum() - }else if(this.showTemplateThree){ - this.$refs.classThree.getCartNum() - } - },100) + if (this.isLogin) { + setTimeout((res)=>{ + if(this.showTemplateTwo){ + this.$refs.classTwo.getCartNum() + }else if(this.showTemplateThree){ + this.$refs.classThree.getCartNum() + } + },100) + } + }, data() { return { diff --git a/pages/goods_cate/template/template3.vue b/pages/goods_cate/template/template3.vue index 8bf913e..7619128 100644 --- a/pages/goods_cate/template/template3.vue +++ b/pages/goods_cate/template/template3.vue @@ -344,6 +344,7 @@ topNavShow: true, selectSku: {}, skuArr: [], + store_id:0, getHeight: this.$util.getWXStatusHeight(), footerOpen: true } @@ -361,13 +362,16 @@ }), ...mapGetters(['isLogin', 'uid', 'cartNum']), }, + mounted() { - this.getUserInfo() + this.store_id=uni.getStorageSync('mendianstore_id') + this.getAllCategory(); setTimeout(() => { this.getScrollHeight(); }, 500) if (this.isLogin) { + this.getUserInfo() this.getCartList(1); } uni.$off('newAttrNum'); @@ -406,7 +410,7 @@ }) }, methods: { - + openCart() { if (this.footerOpen) { this.getCartList(0) @@ -458,7 +462,9 @@ type: 1, cid: that.cid, sid: that.sid, - tid: that.tid + tid: that.tid, + store_id:that.store_id, + relation_id:that.store_id, }).then(res => { let list = res.data, loadend = list.length < that.limit; diff --git a/pages/user/index.vue b/pages/user/index.vue index f183f76..9ff66c7 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -238,7 +238,6 @@ export default { onShow() { if (!this.isLogin) { this.userInfo = ''; - toLogin(); return; } if (this.cartNum > 0) {