Commit 921ab91a1d266592e94d0ed2c6f430fae5e7db75
1 parent
8b0cc8ca
搜索商品为空 优化
Showing
1 changed file
with
4 additions
and
6 deletions
pages/goods/search/search.js
| ... | ... | @@ -146,7 +146,6 @@ Page({ |
| 146 | 146 | for(let i in res.data.data.pageData){ |
| 147 | 147 | let item=res.data.data.pageData[i]; |
| 148 | 148 | item.original_img = th.data.url + item.original_img; |
| 149 | - | |
| 150 | 149 | var url="/api/weshop/activitylist/getGoodActInfo"; |
| 151 | 150 | var req_data={ |
| 152 | 151 | store_id:oo.stoid,goodsidlist:item.goods_id,is_detail:1 |
| ... | ... | @@ -184,7 +183,7 @@ Page({ |
| 184 | 183 | var rd= { |
| 185 | 184 | store_id: oo.stoid, |
| 186 | 185 | presell_id: presell_id, |
| 187 | - goods_id: val.goods_id | |
| 186 | + goods_id: item.goods_id | |
| 188 | 187 | } |
| 189 | 188 | //------获取预售从表---------- |
| 190 | 189 | await getApp().request.promiseGet(url1, { |
| ... | ... | @@ -220,14 +219,13 @@ Page({ |
| 220 | 219 | } |
| 221 | 220 | th.data.requestData.push(item); |
| 222 | 221 | e.setData({requestData: e.data.requestData}); |
| 223 | - e.closeSearchModal(); | |
| 224 | 222 | } |
| 225 | 223 | } |
| 226 | - | |
| 224 | + e.closeSearchModal(); | |
| 227 | 225 | }) |
| 228 | - | |
| 229 | 226 | }, |
| 230 | 227 | onReachBottom: function() { |
| 228 | + this.data.currentPage++ | |
| 231 | 229 | this.data.openSearchModal || e.canloadMore() && this.requestSearch(this.data.requestUrl); |
| 232 | 230 | }, |
| 233 | 231 | openFilterModal: function() { |
| ... | ... | @@ -289,7 +287,7 @@ Page({ |
| 289 | 287 | search: function(t) { |
| 290 | 288 | if ("string" != typeof t || "" == t) return a.showWarning("请输入搜索关键词"); |
| 291 | 289 | this.data.key_str=t; |
| 292 | - this.historyRecord(); | |
| 290 | + this.historyRecord(); | |
| 293 | 291 | this.resetData(), this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t)); |
| 294 | 292 | }, |
| 295 | 293 | ... | ... |