const tool = require('../../utils/tool.js'); const app = require('../../utils/util.js'); Page({ data: { }, go() { // + this.data.activeId, wx.navigateTo({ url: '/pages/onSiteActivity/onSiteActivity?id=' + this.data.activeId }) }, // getNum() { // wx.request({ // url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/members', // method: "get", // success: (res) => { // if (res.data.code == 0) { // console.log(res.data.members, '我获取人员名单') // for (let i = 0; i < res.data.members.length; i++) { // if (res.data.members[i].openId == this.data.openid) { // this.setData({ // myNum: res.data.members[i].activeNumber // }) // } // } // } // } // }) // }, sign() { wx.request({ url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/sign', method: "get", success: (res) => { console.log(res, '我签到的结果') if (res.data.code == 0) { if (res.data.activeNumber == 0) { wx.showModal({ title: '您未报名此活动', content: '请联系客服呦', showCancel: false, success(res) { if (res.confirm) { wx.redirectTo({ url: '/pages/index/index', }) } } }) } else { this.setData({ myNum: res.data.activeNumber }) } } } }) }, onLoad: function (options) { console.log(decodeURIComponent(options.q), '我是签到页带过来的参数'); let url = decodeURIComponent(options.q); let after = url.split('id=')[1]; tool.openidStatus().then(result => { this.setData({ openid: result[0], sessionkey: result[1], activeId: after }) this.sign(); }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })