|
|
@@ -24,7 +24,7 @@ import {
|
|
|
getPatientDescription,
|
|
|
getNotDealLists,
|
|
|
getCareList,
|
|
|
- getChronicDiseaseManageVisible,
|
|
|
+ getChronicDiseaseManageName,
|
|
|
getChronicDiseaseManageUrl,
|
|
|
} from "./request";
|
|
|
import { toCertificationPage, toChats } from "./router";
|
|
|
@@ -43,12 +43,7 @@ Page({
|
|
|
NoteTitle: "",
|
|
|
isShowComplete: true,
|
|
|
careList: [],
|
|
|
- // 慢病管理入口:showFlag 控制按钮显示,url 为 H5 跳转链接
|
|
|
- // 慢病管理:两个独立接口分别取值
|
|
|
- // 接口一 isShowChronicDisease 控制按钮显示;接口二 chronicDiseaseUrl 为 H5 链接
|
|
|
- // TODO(临时): 真实接口一就绪后改回 false,由接口返回值控制显示
|
|
|
- isShowChronicDisease: true,
|
|
|
- chronicDiseaseUrl: "",
|
|
|
+ chronicDiseaseName: "",
|
|
|
displayList: [] as {
|
|
|
id: number;
|
|
|
conditioningProgramType: string;
|
|
|
@@ -468,12 +463,14 @@ Page({
|
|
|
}
|
|
|
// 加载健康宣教的文章
|
|
|
this.loadScienceList(true);
|
|
|
- // 接口一:判断慢病管理按钮是否显示
|
|
|
- getChronicDiseaseManageVisible()
|
|
|
- .then((showFlag) => {
|
|
|
- this.setData({ isShowChronicDisease: showFlag });
|
|
|
+ //获取慢病管理按钮名称:为空则不显示按钮,非空则作为按钮文案
|
|
|
+ getChronicDiseaseManageName()
|
|
|
+ .then((name) => {
|
|
|
+ this.setData({ chronicDiseaseName: name });
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch((error) => {
|
|
|
+ wx.showToast({ title: error.message || "加载失败" });
|
|
|
+ });
|
|
|
if (!this.data._loaded) {
|
|
|
getSolarTerms()
|
|
|
.then((solarTerms) => {
|
|
|
@@ -705,24 +702,21 @@ Page({
|
|
|
toSciencePage() {
|
|
|
wx.navigateTo({ url: `/module/article/pages/science-list/science-list` });
|
|
|
},
|
|
|
- // 跳转慢病管理 H5(点击时按需获取链接,已获取则直接跳转)
|
|
|
+ //获取跳转慢病管理链接(每次点击都拉取最新链接,避免链接过期)
|
|
|
async goChronicDisease() {
|
|
|
- let url = this.data.chronicDiseaseUrl;
|
|
|
- if (!url) {
|
|
|
- wx.showLoading({ title: "加载中" });
|
|
|
- try {
|
|
|
- url = await getChronicDiseaseManageUrl();
|
|
|
- this.setData({ chronicDiseaseUrl: url });
|
|
|
- } catch (error: any) {
|
|
|
- wx.hideLoading();
|
|
|
- wx.showToast({
|
|
|
- title: error?.errMsg || "加载失败",
|
|
|
- icon: "none",
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
+ wx.showLoading({ title: "加载中" });
|
|
|
+ let url = "";
|
|
|
+ try {
|
|
|
+ url = await getChronicDiseaseManageUrl();
|
|
|
+ } catch (error: any) {
|
|
|
wx.hideLoading();
|
|
|
+ wx.showToast({
|
|
|
+ title: error?.errMsg || "加载失败",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
+ wx.hideLoading();
|
|
|
if (!url) {
|
|
|
wx.showToast({ title: "暂无链接", icon: "none" });
|
|
|
return;
|
|
|
@@ -730,7 +724,7 @@ Page({
|
|
|
wx.navigateTo({
|
|
|
url: "/module/article/pages/science-info/science-info",
|
|
|
success: (res) => {
|
|
|
- res.eventChannel?.emit?.("load", { title: "慢病管理", url });
|
|
|
+ res.eventChannel?.emit?.("load", { title: this.data.chronicDiseaseName, url });
|
|
|
},
|
|
|
});
|
|
|
},
|