张田田 4 месяцев назад
Родитель
Сommit
99c6c360da
2 измененных файлов с 32 добавлено и 24 удалено
  1. 27 14
      miniprogram/pages/home/home.ts
  2. 5 10
      miniprogram/pages/home/home.wxml

+ 27 - 14
miniprogram/pages/home/home.ts

@@ -7,7 +7,7 @@ import { login } from "../../lib/logic";
 import { useRouteQuery } from "../../utils/route-query";
 import { appUpdate } from "../../lib/wx/update";
 import { addPatientOnlineRecordClockIn } from "./request";
-
+import { Get } from "../../lib/request/method";
 const { shared, Easing, timing } = wx.worklet;
 const offset = shared(0);
 
@@ -328,14 +328,12 @@ Page({
     });
   },
   // 诊疗随访提醒
-  goComplete(e: {
+  async goComplete(e: {
     currentTarget: { dataset: { page: string; id: number; title: string } };
   }) {
     const { title } = e.currentTarget.dataset;
     let page = e.currentTarget.dataset.page;
     let id = e.currentTarget.dataset.id;
-    // let page = '/module/chats/pages/index/index';
-    // let id = 1;
     if (page === "/module/chats/pages/index/index") {
       if (title === "健康评估") {
         wx.setStorageSync("isAnalysis", 4);
@@ -347,9 +345,26 @@ Page({
           url: `${page}?component=questionnaire&messageType=1&id=${id}`,
         });
       }
+    } else if (page === "/module/article/pages/science-info/science-info") {
+      try {
+        const res = await Get(`/psarticle/clickPsaNotice`, {
+          params: { noticeSendRecordId: id },
+        });
+        const url = res?.data;
+        const item = {
+          url,
+        };
+        wx.navigateTo({
+          url: `${page}`,
+        }).then((res) => {
+          res.eventChannel.emit("load", item);
+        });
+      } catch (error) {
+        console.log(error);
+      }
     } else {
+      // 随访
       wx.redirectTo({ url: `${page}?id=${id}` });
-      // wx.navigateTo({ url: `/module/follow/pages/evaluation/report?id=${id}` });
     }
   },
   // 随访评估报告已出
@@ -383,7 +398,7 @@ Page({
           showCancel: false,
           confirmText: `重新加载`,
         })
-        .catch(() => {});
+        .catch(() => { });
       await this.load(true);
       return;
     }
@@ -399,7 +414,7 @@ Page({
         .then((solarTerms) => {
           this.setData({ solarTerms });
         })
-        .catch(() => {});
+        .catch(() => { });
       this.setData({ _loaded: true });
     }
   },
@@ -582,17 +597,15 @@ Page({
     (<any>this).applyAnimatedStyle(".fab-2", () => {
       "worklet";
       return {
-        transform: `translateX(${-offset.value}px) translateY(${
-          -offset.value / 2
-        }px)`,
+        transform: `translateX(${-offset.value}px) translateY(${-offset.value / 2
+          }px)`,
       };
     });
     (<any>this).applyAnimatedStyle(".fab-3", () => {
       "worklet";
       return {
-        transform: `translateX(${-offset.value}px) translateY(${
-          offset.value / 2
-        }px)`,
+        transform: `translateX(${-offset.value}px) translateY(${offset.value / 2
+          }px)`,
       };
     });
     (<any>this).applyAnimatedStyle(".fab-4", () => {
@@ -676,7 +689,7 @@ Page({
       const { data } = await getShortScienceList();
       this.setData({ scienceList: data });
       console.log(data, "data===scienceList");
-    } catch (error) {}
+    } catch (error) { }
   },
 
   observerPatient(model: { patientId: string; sex: "0" | "1" }) {

+ 5 - 10
miniprogram/pages/home/home.wxml

@@ -88,12 +88,7 @@
                   <!-- 轮播媒体容器 -->
                   <view class="carousel-container" wx:if="{{item.carouselMediaList && item.carouselMediaList.length > 0}}">
                     <!-- 轮播组件 -->
-                    <media-carousel
-                      mediaList="{{item.carouselMediaList}}" 
-                      showIndicator="{{true}}" autoplay="{{true}}"
-                      interval="{{4000}}" circular="{{true}}"
-                      bind:fullscreenchange="onCarouselFullscreenChange"
-                      itemId="{{item.id}}" />
+                    <media-carousel mediaList="{{item.carouselMediaList}}" showIndicator="{{true}}" autoplay="{{true}}" interval="{{4000}}" circular="{{true}}" bind:fullscreenchange="onCarouselFullscreenChange" itemId="{{item.id}}" />
                   </view>
                   <view class="item-box">
                     <view class="flex" wx:if="{{item.arrangeDate && item.isOffline==='Y'}}"><text>下一次时间:</text><text>{{item.arrangeDate}}</text></view>
@@ -132,7 +127,7 @@
       <view class="waterfall-container">
         <waterfall-card wx:for="{{scienceList}}" wx:key="id" item="{{item}}" index="{{index}}"></waterfall-card>
       </view>
-       <!--<science-card wx:for="{{scienceList}}" wx:key="id" item="{{item}}" index="{{index}}"></science-card>-->
+      <!--<science-card wx:for="{{scienceList}}" wx:key="id" item="{{item}}" index="{{index}}"></science-card>-->
     </view>
     <science-card style="display: none;">
       <!--?-->
@@ -226,13 +221,13 @@
 
   <tabbar tabbarValue="{{tabbarValue}}" patientId="{{patient.patientId}}" wx:if="{{!tabbarHidden}}"></tabbar>
 
-  <t-popup visible="{{isShowPopup}}" usingCustomNavbar bind:visible-change="onVisibleChange" placement="center">
+  <t-popup visible="{{isShowPopup}}" placement="center">
     <view class="popup-container">
       <view class="popup-block">
         <scroll-view class="scroll_live" scroll-y="{{true}}" show-scrollbar="{{false}}" enhanced="{{true}}" animation="{{animationData}}">
-          <view class="popup-item" wx:for="{{popupList}}" wx:key="{{id}}">
+          <view class="popup-item" wx:for="{{popupList}}" wx:key="{{id}}" catch:tap="goComplete" data-page="{{item.page}}" data-id="{{item.pendingWorkId}}" data-title="{{item.title}}">
             <text class="popup-text">{{index+1}}.{{item.title}}</text>
-            <text class="popup-action" bind:tap="goComplete" data-page="{{item.page}}" data-id="{{item.pendingWorkId}}" data-title="{{item.title}}">{{item.button}}</text>
+            <text class="popup-action">{{item.button}}</text>
           </view>
         </scroll-view>
       </view>