Commit 6278b2ca6be630051eb67b806b383e678776fb17
1 parent
6da2f40e
分类的点击无效果的bug优化
Showing
1 changed file
with
18 additions
and
16 deletions
pages/goods/categoryList/categoryList.js
| ... | ... | @@ -614,23 +614,25 @@ Page({ |
| 614 | 614 | |
| 615 | 615 | // 新的版本分类点击一级分类 |
| 616 | 616 | click_classify:function(e){ |
| 617 | + // 在风格三的时候,才会有current | |
| 617 | 618 | let cur = e.currentTarget.dataset.current; |
| 618 | - if (this.data.currentTab == cur ) { | |
| 619 | - if(this.data.select_classify_on!=220&&this.data.select_classify_on!=223) { | |
| 620 | - return false; | |
| 621 | - } | |
| 622 | - else if(cur!=0){ | |
| 623 | - return false; | |
| 624 | - } | |
| 625 | - } else { | |
| 626 | - wx.pageScrollTo({ | |
| 627 | - scrollTop: 0 | |
| 628 | - }) | |
| 629 | - this.setData({ | |
| 630 | - currentTab: cur, | |
| 631 | - select_classify_on:cur | |
| 632 | - }) | |
| 633 | - this.checkCor(); | |
| 619 | + if(cur) { | |
| 620 | + if (this.data.currentTab == cur) { | |
| 621 | + if (this.data.select_classify_on != 220 && this.data.select_classify_on != 223) { | |
| 622 | + return false; | |
| 623 | + } else if (cur != 0) { | |
| 624 | + return false; | |
| 625 | + } | |
| 626 | + } else { | |
| 627 | + wx.pageScrollTo({ | |
| 628 | + scrollTop: 0 | |
| 629 | + }) | |
| 630 | + this.setData({ | |
| 631 | + currentTab: cur, | |
| 632 | + select_classify_on: cur | |
| 633 | + }) | |
| 634 | + this.checkCor(); | |
| 635 | + } | |
| 634 | 636 | } |
| 635 | 637 | // if(e.currentTarget.dataset.index == 223){ |
| 636 | 638 | // this.setData({ status_show: 1}); | ... | ... |