// pages/my/activityInfo/activityInfo.js const App = getApp() const util = require('../../utils/util') Page({ /** * 页面的初始数据 */ data: { activityId: null, num: 0, list: [], willnum: 0, queryParams: { page: 1, limit: 10 }, page: { total: null, currPage: null, totalPage: null, }, nodata: util.nodata(), }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { console.log(options, 111) if (options && options.activityId) { this.setData({ activityId: options.activityId, willnum: options.willnum }) this.getlist() } }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, getlist() { if (this.data.queryParams.page > 1) { if (this.data.page.currPage == this.data.page.totalPage) { wx.showToast({ icon: 'none', title: '没有更多哦~', }) return false } } wx.showLoading({ title: '努力加载中...', }) App._get('activitystu/list', { ...this.data.queryParams, pid: this.data.activityId }, res => { if (res.code === 0) { this.setData({ list: res.page.list, page: { total: res.page.totalCount, currPage: res.page.currPage, totalPage: res.page.totalPage } }) } }, err => {}, complete => { setTimeout(() => { wx.hideLoading() }, 500) }) }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { this.setData({ queryParams: { page: ++this.data.queryParams.page, limit: 10 } }) this.getlist() }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })