const app = getApp(); Page({ /** * 页面的初始数据 */ data: { }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var that = this; var params = { 'wid': app.wid, 'method': 'weixin.config.info' }; var ignores = []; app.jsapi.memberApi(app.globalData.appMemberKey, app.globalData.appMemberSecret, app.globalData.serverMemberUrl).ajax(params, ignores, function (json) { console.log(json); var result = json.data; if (result.status == 1) { var memBenefits = result.data.memBenefits.split("\n"); that.setData({ des: memBenefits }) } else { that.setData({ hidden: true }); app.msg.showMsg("提示", "付款码获取失败"); } }, function (error) { app.msg.showMsg("提示", "网络连接失败"); } ); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, })