Commit f8a5226e81308957f12a0d99518ebb2bc8d7a636
1 parent
86c301d8
分组的第一次
Showing
1 changed file
with
11 additions
and
7 deletions
pages/goods/goodsList/goodsList.js
| ... | ... | @@ -42,6 +42,7 @@ Page({ |
| 42 | 42 | fil_brand_state:0, |
| 43 | 43 | fil_price_state:0, |
| 44 | 44 | limit_num:0, |
| 45 | + gr_fir:0, //分组第一次 | |
| 45 | 46 | }, |
| 46 | 47 | |
| 47 | 48 | onLoad: function(t) { |
| ... | ... | @@ -83,8 +84,8 @@ Page({ |
| 83 | 84 | if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } |
| 84 | 85 | if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; } |
| 85 | 86 | |
| 86 | - if (0 != t.group_id && t.group_id != undefined) { url += "&group_id=" + t.group_id; } | |
| 87 | - if (0 != t.gid && t.gid != undefined) { url += "&group_id=" + t.gid; } | |
| 87 | + if (0 != t.group_id && t.group_id != undefined) { url += "&group_id=" + t.group_id; this.data.gr_fir=1; } | |
| 88 | + if (0 != t.gid && t.gid != undefined) { url += "&group_id=" + t.gid; this.data.gr_fir=1; } | |
| 88 | 89 | |
| 89 | 90 | if (0 != t.max_price && t.max_price != undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price; } |
| 90 | 91 | |
| ... | ... | @@ -306,11 +307,14 @@ Page({ |
| 306 | 307 | var user_id=getApp().globalData.user_id; |
| 307 | 308 | if(!user_id) user_id=0; |
| 308 | 309 | |
| 309 | - //不是商品分组的,不是默认排序的 | |
| 310 | - // if(t.indexOf("group_id")==-1 ){ | |
| 311 | - t += "&orderField=" + e.data.tabname; | |
| 312 | - t += "&orderType=" + e.data.adname; | |
| 313 | - // } | |
| 310 | + | |
| 311 | + //不是商品分组的,不是默认排序的 | |
| 312 | + if (t.indexOf("group_id") == -1 || !this.data.gr_fir) { | |
| 313 | + t += "&orderField=" + e.data.tabname; | |
| 314 | + t += "&orderType=" + e.data.adname; | |
| 315 | + } | |
| 316 | + this.data.gr_fir=0; | |
| 317 | + | |
| 314 | 318 | |
| 315 | 319 | t +="&page=" + e.data.currentPage; |
| 316 | 320 | wx.showLoading({}); | ... | ... |