From 6278b2ca6be630051eb67b806b383e678776fb17 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Tue, 30 Jun 2020 14:53:06 +0800 Subject: [PATCH] 分类的点击无效果的bug优化 --- pages/goods/categoryList/categoryList.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index 100d151..22a2279 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -614,23 +614,25 @@ Page({ // 新的版本分类点击一级分类 click_classify:function(e){ + // 在风格三的时候,才会有current let cur = e.currentTarget.dataset.current; - if (this.data.currentTab == cur ) { - if(this.data.select_classify_on!=220&&this.data.select_classify_on!=223) { - return false; - } - else if(cur!=0){ - return false; - } - } else { - wx.pageScrollTo({ - scrollTop: 0 - }) - this.setData({ - currentTab: cur, - select_classify_on:cur - }) - this.checkCor(); + if(cur) { + if (this.data.currentTab == cur) { + if (this.data.select_classify_on != 220 && this.data.select_classify_on != 223) { + return false; + } else if (cur != 0) { + return false; + } + } else { + wx.pageScrollTo({ + scrollTop: 0 + }) + this.setData({ + currentTab: cur, + select_classify_on: cur + }) + this.checkCor(); + } } // if(e.currentTarget.dataset.index == 223){ // this.setData({ status_show: 1}); -- libgit2 0.21.4