学生列表页显示

首先写一个方法

const app = getApp()
var page = 1;
var isfinish = false;
function loadmore(that){
  if(isfinish) return;

  wx.showLoading({
    title: '正在加载中',
  })
  wx.request({
    url: '',
    header: {
      Cookie: wx.getStorageSync('session_id')
    },
    data:{
      page:page,
      condition:that.data.condition
    },
    
    success:(res)=>{
      wx.hideLoading();

      if(res.data.student.length>0){
        var list = that.data.student;

        for(var i = 0; i

data写

 data: {
    student: [],
    condition:'',
    inputShowed: false,
  },
/**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    // console.log(e);
    page = 1;
    isFinite = false;
    this.setData({student:[]});
    loadmore(this);
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    var that = this;
    loadmore(that);
    console.log(page);
  },


你可能感兴趣的:(学生列表页显示)