Procházet zdrojové kódy

进入对话管家判断用户是否存在,否则进入建档页面

cc12458 před 1 rokem
rodič
revize
8ce0e0016c
1 změnil soubory, kde provedl 10 přidání a 2 odebrání
  1. 10 2
      miniprogram/pages/home/home.ts

+ 10 - 2
miniprogram/pages/home/home.ts

@@ -21,7 +21,7 @@ Page({
   ],
   ],
   onLoad(options) {
   onLoad(options) {
     appUpdate();
     appUpdate();
-    
+
     const query = useRouteQuery(options.scene!);
     const query = useRouteQuery(options.scene!);
     if (query.ys) wx.setStorageSync('doctorId', query.ys);
     if (query.ys) wx.setStorageSync('doctorId', query.ys);
 
 
@@ -208,7 +208,15 @@ Page({
       if (offset.value > 0) offset.value = 72
       if (offset.value > 0) offset.value = 72
     })
     })
   },
   },
-  toChatsPage() {
+  async toChatsPage() {
+    if (!this.data.patient?.patientId) {
+      try {
+        await this.load();
+      } catch (error) {
+        wx.showModal({ title: '出错了', content: error?.errMsg ?? error?.message ?? '错误,请重试', showCancel: false })
+        return;
+      }
+    }
     wx.navigateTo({ url: `/module/chats/pages/index/index` })
     wx.navigateTo({ url: `/module/chats/pages/index/index` })
   },
   },
   toHealthPage() {
   toHealthPage() {