Commit bbe1887939412bd682fa7df00fe3bb4b9006603b
1 parent
c8df3150
组件修改
Showing
1 changed file
with
15 additions
and
4 deletions
components/goods_list/goods_list.js
| ... | ... | @@ -24,25 +24,36 @@ Component({ |
| 24 | 24 | methods: { |
| 25 | 25 | |
| 26 | 26 | get_list:function(){ |
| 27 | - | |
| 27 | + | |
| 28 | 28 | var that = this; |
| 29 | + if(that.data.is_no_more==0) return false; | |
| 30 | + | |
| 31 | + | |
| 29 | 32 | var curPage = that.data.curPage; |
| 30 | 33 | getApp().request.get('/api/weshop/goods/page?page',{ |
| 31 | 34 | data: { is_mainshow: 1, isonsale: 1, |
| 32 | 35 | is_recommend: 1, is_on_sale: 1, |
| 33 | 36 | store_id: o.stoid, |
| 34 | 37 | page: curPage, |
| 35 | - pageSize:10, | |
| 38 | + pageSize:6, | |
| 36 | 39 | }, |
| 37 | 40 | success: function (res){ |
| 38 | 41 | |
| 39 | - that.data.curPage++; | |
| 42 | + | |
| 40 | 43 | var data=res.data; |
| 44 | + var total=data.data.total; | |
| 45 | + if (total <= curPage*6){ | |
| 46 | + that.setData({ is_no_more: 0 }); | |
| 47 | + }else{ | |
| 48 | + that.data.curPage++; | |
| 49 | + } | |
| 50 | + | |
| 51 | + /*-- | |
| 41 | 52 | if (res.data.data.pageData.length==0){ |
| 42 | 53 | that.setData({is_no_more:0}); |
| 43 | 54 | t.showWarning("加载完啦", null, 500, !1) |
| 44 | 55 | return false; |
| 45 | - } | |
| 56 | + }--*/ | |
| 46 | 57 | //加载完成 |
| 47 | 58 | if (data.data.pageData) { |
| 48 | 59 | that.setData({load_complete:1}); | ... | ... |