const tool = require('../../utils/tool.js'); const app = require('../../utils/util.js'); Page({ data: { }, go() { wx.navigateTo({ url: '/pages/onSiteActivity/onSiteActivity', }) }, 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/actives/{openId}/{activeId}/sign wx.request({ url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/sign', method: "get", success: (res) => { if (res.data.code == 0) { console.log(res.data, '我签到成功了'); this.getNum(); } } }) }, onLoad: function (options) { console.log(options) tool.openidStatus().then(result => { this.setData({ openid: result[0], sessionkey: result[1], activeId:options.id }) this.sign(); }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })