index.js 1.36 KB
const restapi = require('../restapi');
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    shebList: [],
    shopType: 6,
    marketType: 2,
    loading:true
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.showLoading({
      title: '加载中',
    })
    var self = this;
    let activityRequestVO = {
      shopType: this.data.shopType,
      marketType: this.data.marketType,
      pageSize: 50
    }

    restapi.loadMoreActivities(activityRequestVO, function (response) {
      console.log(response);
      wx.hideLoading();
      self.setData({
        loading:false
      });
      if (response && response.returnCode == '0') {
        let list = response.data.list;
        if (list && list.length > 0) {
          self.setData({
            shebList: list
          });
        }
      }
      
    }, function () {});
  },
  toDetail: function (e) {
    let userId = app.globalData.selectedDevice.userId;
    let id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/packageIndex/pages/remindService/activity/activity?id=' + id 
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  }
})