From bbe1887939412bd682fa7df00fe3bb4b9006603b Mon Sep 17 00:00:00 2001 From: cheng.xu Date: Mon, 23 Sep 2019 11:23:52 +0800 Subject: [PATCH] 组件修改 --- components/goods_list/goods_list.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/components/goods_list/goods_list.js b/components/goods_list/goods_list.js index 549d54c..da9799b 100644 --- a/components/goods_list/goods_list.js +++ b/components/goods_list/goods_list.js @@ -24,25 +24,36 @@ Component({ methods: { get_list:function(){ - + var that = this; + if(that.data.is_no_more==0) return false; + + var curPage = that.data.curPage; getApp().request.get('/api/weshop/goods/page?page',{ data: { is_mainshow: 1, isonsale: 1, is_recommend: 1, is_on_sale: 1, store_id: o.stoid, page: curPage, - pageSize:10, + pageSize:6, }, success: function (res){ - that.data.curPage++; + var data=res.data; + var total=data.data.total; + if (total <= curPage*6){ + that.setData({ is_no_more: 0 }); + }else{ + that.data.curPage++; + } + + /*-- if (res.data.data.pageData.length==0){ that.setData({is_no_more:0}); t.showWarning("加载完啦", null, 500, !1) return false; - } + }--*/ //加载完成 if (data.data.pageData) { that.setData({load_complete:1}); -- libgit2 0.21.4