const app = getApp(); Page({ data: { phone_number:'18888888888', from: '', preid: '', hiddenThis: true, appid: 0 }, onLoad: function (options) { var that = this, tel = options.tel, preid = options.preid || 0, from = options.from; // console.log(tel); that.setData({phone_number: tel, preid: preid, from: from}) }, goApply () { var id = this.data.preid, from = this.data.from, appid = ''; if (from == 'card') { appid = 'X_' + id }else{ console.log(from); appid = 'Y_' + id; wx.request({ url: app.globalData.HOST + '/user/wx/known', method: "POST", data: Object.assign({}, app.globalData.common, {id: id}), success: function (res) { }, complete: function () { } }); } this.setData({hiddenThis: false, appid: appid}) }, onReady: function () { }, onShow: function () { }, onHide: function () { this.setData({hiddenThis: true}) }, onUnload: function () { } })