123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- // 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() {
- }
- })
|