const app = getApp(); Page({ data: { isFollow: 0, InviteDoctorName: "", codeUrl: "", }, onLoad(options) { app.waitLogin(true).then(() => { this.setData({ isFollow: Number(options.isf), InviteDoctorName: options.iname === "null" ? "" : options.iname, }); this.getCodeUrl(); if (!options.iname) { this.getApplyDoctor(); } }); }, getApplyDoctor() { app.getApplyDoctor().then((res) => { this.setData({ InviteDoctorName: res.InviteDoctorName, }); }); }, getCodeUrl() { wx.ajax({ method: "GET", url: "?r=takeda/common/get-channel-wx-code", data: { ChannelType: 2, }, }).then((res) => { this.setData({ codeUrl: res, }); }); }, handleLoginOut() { wx.showModal({ confirmColor: "#00B4C5", cancelColor: "#141515", title: "确认退出登录?", success(res) { if (res.confirm) { wx.ajax({ method: "POST", url: "?r=takeda/account/reg-logout", }).then(() => { wx.reLaunch({ url: "/module1/pages/login/index", }); }); } }, }); }, }); export {};