|
@@ -15,6 +15,7 @@ Page({
|
|
|
limit: 20, //一页20条数据
|
|
|
requestState: true, //默认是可以向下请求的
|
|
|
loginStatic: false, //登陆状态,默认为false
|
|
|
+ reachBottomState:true,//判断是否有上拉加载状态
|
|
|
tabBar: {
|
|
|
"color": "#2d2d2d",
|
|
|
"selectedColor": "#e81021",
|
|
@@ -115,7 +116,17 @@ Page({
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
-
|
|
|
+ console.log('开始上拉')
|
|
|
+ let that = this;
|
|
|
+ if (that.data.reachBottomState){
|
|
|
+ that.setData({
|
|
|
+ page: ++that.data.page
|
|
|
+ })
|
|
|
+ that.getGiftList(that)
|
|
|
+ } else {
|
|
|
+ console.log('已经到底')
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -136,6 +147,11 @@ Page({
|
|
|
data: data,
|
|
|
success(res) {
|
|
|
let dataArray = that.data.goodsList;
|
|
|
+ if (res.data.rows.length < 20){
|
|
|
+ that.setData({
|
|
|
+ reachBottomState:false,
|
|
|
+ })
|
|
|
+ }
|
|
|
res.data.rows.forEach(el => {
|
|
|
el.logo = el.commodity_logo.split(",")
|
|
|
})
|