From 8135b7501016942f0596f521692a8d0fa7160ada Mon Sep 17 00:00:00 2001 From: kola-web Date: Tue, 5 Nov 2024 17:51:18 +0800 Subject: [PATCH] =?UTF-8?q?bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/module1/pages/cHostipalResult/index.ts | 16 ++++++++++++++-- src/module1/pages/setInfoResult/index.ts | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) 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 {};