diff --git a/src/module1/pages/cHostipalResult/index.ts b/src/module1/pages/cHostipalResult/index.ts index 0e0e8fa..db963d9 100644 --- a/src/module1/pages/cHostipalResult/index.ts +++ b/src/module1/pages/cHostipalResult/index.ts @@ -7,10 +7,9 @@ Page({ }, onLoad(options) { app.waitLogin(true).then(() => { - const { url, loginState } = app.globalData; + this.getCodeUrl(); this.setData({ isf: Number(options.isf), - codeUrl: `${url}?r=takeda/common/get-channel-wx-code&ChannelType=1&loginState=${loginState}`, }); }); }, @@ -19,6 +18,19 @@ Page({ url: "/module1/pages/setInfo/index", }); }, + getCodeUrl() { + wx.ajax({ + method: "GET", + url: "?r=takeda/common/get-channel-wx-code", + data: { + ChannelType: 1, + }, + }).then((res) => { + this.setData({ + codeUrl: res, + }); + }); + }, }); export {}; diff --git a/src/module1/pages/setInfoResult/index.ts b/src/module1/pages/setInfoResult/index.ts index 9f137d4..f6b88f7 100644 --- a/src/module1/pages/setInfoResult/index.ts +++ b/src/module1/pages/setInfoResult/index.ts @@ -8,12 +8,11 @@ Page({ }, onLoad(options) { app.waitLogin(true).then(() => { - const { url, loginState } = app.globalData; this.setData({ isFollow: Number(options.isf), InviteDoctorName: options.iname === "null" ? "" : options.iname, - codeUrl: `${url}?r=takeda/common/get-channel-wx-code&ChannelType=2&loginState=${loginState}`, }); + this.getCodeUrl() if (!options.iname) { this.getApplyDoctor(); } @@ -26,6 +25,19 @@ Page({ }); }); }, + getCodeUrl() { + wx.ajax({ + method: "GET", + url: "?r=takeda/common/get-channel-wx-code", + data: { + ChannelType: 2, + }, + }).then((res) => { + this.setData({ + codeUrl: res, + }); + }); + }, }); export {};