const app = require('../../utils/util.js'); const tool = require('../../utils/tool.js'); Page({ data: { currentIndex: 0, arr: [], arr1: [] }, handleChange: function (e) { this.setData({ currentIndex: e.detail.current }) }, goActive(e) { console.log(e) let id = e.currentTarget.dataset.id let openId = e.currentTarget.dataset.openid wx.navigateTo({ url: '/pages/activeDetail/activeDetail?id=' + id + '&openId=' + openId, }) }, async onLoad() { const getOpenid = await tool.openidStatus(); this.setData({ openid: getOpenid[0], sessionkey: getOpenid[1] }) wx.request({ url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/actives', method: "get", data: { activeStatus: 0 }, success: (res) => { console.log(res) if (res.data.code == 0) { this.setData({ arr1: res.data.actives }) } } }) wx.request({ url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/actives', method: "get", data: { activeStatus: 1 }, success: (res) => { console.log(res) if (res.data.code == 0) { this.setData({ arr: this.data.arr1.concat(res.data.actives) }) } } }) } })