微信小程序---上拉加载

// 上拉加载
  onReachBottom() {
    var page = this.data.page,
      ifPage = this.data.ifPage,
      list = this.data.list
    page++;
    app.ajax("/Goods/integral_index", {
      user_id: wx.getStorageSync('userId'),
      page,
    }, (e) => {
      if (e.data.res == 1 && e.data.data.mall_goods.length) {
        list = list.concat(e.data.data.mall_goods);
        this.setData({
          list,
          ifPage: true,
          page
        })
      } else {
        this.setData({
          ifPage: false,
        })
      }
    })
  },

 

posted on 2021-05-21 11:25  天空中的云~飞起来了  阅读(116)  评论(0)    收藏  举报