|
@@ -24,6 +24,8 @@ import {
|
|
|
getPatientDescription,
|
|
getPatientDescription,
|
|
|
getNotDealLists,
|
|
getNotDealLists,
|
|
|
getCareList,
|
|
getCareList,
|
|
|
|
|
+ getChronicDiseaseManageVisible,
|
|
|
|
|
+ getChronicDiseaseManageUrl,
|
|
|
} from "./request";
|
|
} from "./request";
|
|
|
import { toCertificationPage, toChats } from "./router";
|
|
import { toCertificationPage, toChats } from "./router";
|
|
|
import { Post } from "../../lib/request/method";
|
|
import { Post } from "../../lib/request/method";
|
|
@@ -40,6 +42,12 @@ Page({
|
|
|
NoteTitle: "",
|
|
NoteTitle: "",
|
|
|
isShowComplete: true,
|
|
isShowComplete: true,
|
|
|
careList: [],
|
|
careList: [],
|
|
|
|
|
+ // 慢病管理入口:showFlag 控制按钮显示,url 为 H5 跳转链接
|
|
|
|
|
+ // 慢病管理:两个独立接口分别取值
|
|
|
|
|
+ // 接口一 isShowChronicDisease 控制按钮显示;接口二 chronicDiseaseUrl 为 H5 链接
|
|
|
|
|
+ // TODO(临时): 真实接口一就绪后改回 false,由接口返回值控制显示
|
|
|
|
|
+ isShowChronicDisease: true,
|
|
|
|
|
+ chronicDiseaseUrl: "",
|
|
|
displayList: [] as {
|
|
displayList: [] as {
|
|
|
id: number;
|
|
id: number;
|
|
|
conditioningProgramType: string;
|
|
conditioningProgramType: string;
|
|
@@ -459,6 +467,12 @@ Page({
|
|
|
}
|
|
}
|
|
|
// 加载健康宣教的文章
|
|
// 加载健康宣教的文章
|
|
|
this.loadScienceList(true);
|
|
this.loadScienceList(true);
|
|
|
|
|
+ // 接口一:判断慢病管理按钮是否显示
|
|
|
|
|
+ getChronicDiseaseManageVisible()
|
|
|
|
|
+ .then((showFlag) => {
|
|
|
|
|
+ this.setData({ isShowChronicDisease: showFlag });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
if (!this.data._loaded) {
|
|
if (!this.data._loaded) {
|
|
|
getSolarTerms()
|
|
getSolarTerms()
|
|
|
.then((solarTerms) => {
|
|
.then((solarTerms) => {
|
|
@@ -690,6 +704,35 @@ Page({
|
|
|
toSciencePage() {
|
|
toSciencePage() {
|
|
|
wx.navigateTo({ url: `/module/article/pages/science-list/science-list` });
|
|
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.hideLoading();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!url) {
|
|
|
|
|
+ wx.showToast({ title: "暂无链接", icon: "none" });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
|
+ url: "/module/article/pages/science-info/science-info",
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ res.eventChannel?.emit?.("load", { title: "慢病管理", url });
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
async toReportPage() {
|
|
async toReportPage() {
|
|
|
// const { patient } = await getPatients(/*this.data.patientId*/);
|
|
// const { patient } = await getPatients(/*this.data.patientId*/);
|
|
|
if (!this.data.patient) await toCertificationPage();
|
|
if (!this.data.patient) await toCertificationPage();
|