Authored by 肖亚东

筛选不显示修改 — review by 黄敬囿

@@ -49,12 +49,12 @@ Page({ @@ -49,12 +49,12 @@ Page({
49 onLoad: function (option) { 49 onLoad: function (option) {
50 try{ 50 try{
51 if(option){ 51 if(option){
52 - let categoryId = option.categoryId;  
53 - let firstProductSkn = option.firstProductSkn ? option.firstProductSkn : ''; 52 + let categoryId = option.categoryId || '';
  53 + let firstProductSkn = option.firstProductSkn || '';
54 let sort = option.sort ? option.sort : ''; 54 let sort = option.sort ? option.sort : '';
55 - let subCategoryId = option.subCategoryId ? option.subCategoryId : '';  
56 - let title = option.title ? option.title : '';  
57 - let gender = option.gender ? option.gender : ''; 55 + let subCategoryId = option.subCategoryId || '';
  56 + let title = option.title || '';
  57 + let gender = option.gender || '';
58 console.log("categoryId:"+categoryId+"==subCategoryId:"+subCategoryId+"==sort:"+sort+"==firstProductSkn:"+firstProductSkn); 58 console.log("categoryId:"+categoryId+"==subCategoryId:"+subCategoryId+"==sort:"+sort+"==firstProductSkn:"+firstProductSkn);
59 59
60 this.data.categoryId = categoryId; 60 this.data.categoryId = categoryId;
@@ -124,11 +124,11 @@ Page({ @@ -124,11 +124,11 @@ Page({
124 if(tabData && tabData.page){ 124 if(tabData && tabData.page){
125 page = tabData.page; 125 page = tabData.page;
126 } 126 }
127 - this.fechProductList(tab,page); 127 + this.fechProductList(tab, page);
128 } 128 }
129 129
130 }, 130 },
131 - fechProductList: function (tab,currentPage) { 131 + fechProductList: function (tab, currentPage) {
132 let filterParams = this.data.filterParams; 132 let filterParams = this.data.filterParams;
133 let id = tab.id; 133 let id = tab.id;
134 let orderType = tab.iconType; 134 let orderType = tab.iconType;
@@ -167,6 +167,7 @@ Page({ @@ -167,6 +167,7 @@ Page({
167 let param = { 167 let param = {
168 method: "app.search.category", 168 method: "app.search.category",
169 firstProductSkn: firstProductSkn, 169 firstProductSkn: firstProductSkn,
  170 + order,
170 gender, 171 gender,
171 limit: 60, 172 limit: 60,
172 page: currentPage, 173 page: currentPage,
@@ -207,6 +208,9 @@ Page({ @@ -207,6 +208,9 @@ Page({
207 // tablist[id].iconUrl = iconUrl; 208 // tablist[id].iconUrl = iconUrl;
208 // console.log("id:"+id) 209 // console.log("id:"+id)
209 210
  211 + console.log('====================================');
  212 + console.log(tabs);
  213 + console.log('====================================');
210 that.setData({ 214 that.setData({
211 tabs: tabs, 215 tabs: tabs,
212 activeIndex: id, 216 activeIndex: id,
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 <tabCell id="tabCell" tabs="{{tabs}}" bind:onTabClick="onTabClick"/> 2 <tabCell id="tabCell" tabs="{{tabs}}" bind:onTabClick="onTabClick"/>
3 <view style="position: absolute;top: 92rpx;width: {{contentWidth}}px;height:{{contentHeight}}px;"> 3 <view style="position: absolute;top: 92rpx;width: {{contentWidth}}px;height:{{contentHeight}}px;">
4 <swiper current="{{activeIndex}}"> 4 <swiper current="{{activeIndex}}">
5 - <swiper-item tt:for="{{tabs}}" tt:for-item="tab" tt:key="{{tabs[activeIndex].id}}" catchtouchmove='catchTouchMove'>  
6 - <block tt:if="{{tab && tab.data && tab.data.product_list && tab.data.product_list.length >0}}"> 5 + <swiper-item tt:for="{{tabs}}" tt:for-item="tab" tt:key="{{index}}" catchtouchmove='catchTouchMove'>
  6 + <block tt:if="{{tab && tab.data && tab.data.product_list && tab.data.product_list .length > 0}}">
7 <scroll-view style="height:{{contentHeight}}px" scroll-y="true" bindscrolltolower="onLoadMore"> 7 <scroll-view style="height:{{contentHeight}}px" scroll-y="true" bindscrolltolower="onLoadMore">
8 <view class="scroll-content"> 8 <view class="scroll-content">
9 <block tt:for="{{tab.data.product_list}}" tt:for-item="product" tt:key="{{index}}"> 9 <block tt:for="{{tab.data.product_list}}" tt:for-item="product" tt:key="{{index}}">