// pages/index/index.js const Http = require("../../utils/HttpBasics"); const config = require("../../config/config.js"); Page({ /** * 跳转到其他小程序 * 接受唯一参数 appId * */ goPlaza(event) { let appid = event.currentTarget.dataset.appid wx.navigateToMiniProgram({ appId: appid, success(res) { // 打开成功 } }) }, /** * 页面的初始数据 */ data: { plazaAppid: 'wx8e5cab05e850bc91' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { //测试发送请求 // this.getInfo(); }, //获取用户信息 getInfo() { Http.post({ url: config.api.login, data: { } }).then(res => { console.log(res) }) }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })