Przeglądaj źródła

非药物治疗记录点击可以跳转到核销记录记忆去除页面中的打印

张田田 6 miesięcy temu
rodzic
commit
09aa512438

+ 3 - 22
miniprogram/module/care/pages/care/verifyRecord.ts

@@ -1,8 +1,6 @@
-import { Get, Post } from "../../../../lib/request/method";
-// import { getVerifyRecordMethod } from "../../../health/request";
+import {  Post } from "../../../../lib/request/method";
 Page({
   onLoad(options: { id: number }) {
-    console.log("options", options);
     if (options.id) {
       this.getVerifyRecordList(options.id);
     }
@@ -29,28 +27,11 @@ Page({
         });
       }
     } catch (error) {
-      console.log(error, "核销记录列表");
+      console.error("核销记录列表", error);
     }
   },
   data: {
     id: "",
-    recordList: [
-      // {
-      //   id: 1,
-      //   time: "2025-02-04 15:45:12",
-      //   doctor: "余医生",
-      //   feedback: "气喘症状有所缓解",
-      //   acupoint: "足三里、三阴交、气海、关元",
-      //   url: "https://wx.hzliuzhi.com/media/healthManager/wx/share.jpg"
-      // },
-      // {
-      //   id: 2,
-      //   time: "2025-02-11 15:45:12",
-      //   doctor: "余医生",
-      //   feedback: "气喘症状有所缓解",
-      //   acupoint: "足三里、三阴交、气海、关元",
-      //   url: "https://wx.hzliuzhi.com/media/healthManager/wx/share.jpg"
-      // }
-    ],
+    recordList: [],
   },
 });

+ 7 - 4
miniprogram/module/care/pages/offlineTreatment/offlineTreatment.ts

@@ -10,10 +10,13 @@ Page({
     this.getOfflineTreatmentList("");
   },
   // 跳转到核销记录
-  switchVerifyRecode() {
-    wx.navigateTo({
-      url: "/pages/care/verifyRecode",
-    });
+  onRecord(e: any) {
+    const id = e.currentTarget.dataset.id;
+    if (id) {
+      wx.navigateTo({
+        url: `/module/care/pages/care/verifyRecord?id=${id}`,
+      });
+    }
   },
   onTabChange(e: any) {
     const progress = e.detail.value;

+ 2 - 2
miniprogram/module/care/pages/offlineTreatment/offlineTreatment.wxml

@@ -9,9 +9,9 @@
     <view wx:if="{{isLoading}}">
       <t-loading theme="spinner" text="加载中..." size="24" />
     </view>
-    <view wx:elif="{{treatmentList.length>0}}">
+    <view wx:elif="{{treatmentList.length>0}}"> 
       <block wx:for="{{treatmentList}}" wx:key="id">
-        <view class="treatment-detail-card" bind:tap="switchVerifyRecode">
+        <view class="treatment-detail-card" bindtap="onRecord" data-id="{{item.id}}">
           <view>
             <view class="row between">
               <text class="label bold">项目:{{item.conditioningProgramName}}</text>

+ 19 - 2
miniprogram/module/health/components/nodrug-therapy/nodrug-therapy.ts

@@ -8,6 +8,24 @@ Component({
     },
   },
   methods: {
+    onRecord(e: any) {
+      const id = e.currentTarget.dataset.id;
+      if (id) {
+        // 跳转核销记录
+        wx.navigateTo({
+          url: `/module/care/pages/care/verifyRecord?id=${id}`,
+          success: () => {},
+          fail: (error) => {
+            console.error("跳转失败:", error);
+          },
+        });
+      } else {
+        wx.showToast({
+          title: "暂无核销记录",
+          icon: "none",
+        });
+      }
+    },
     // 更多记录
     onMore() {
       wx.navigateTo({
@@ -17,8 +35,7 @@ Component({
     async getOfflineTreatmentList() {
       // 0 进行中 1 已完成
       const res = await getOfflineTreatmentListMethod("0");
-      // console.log(res, "我的线下非药物治疗记录列表");
-      if(res && res.data && res.data.length > 0) {
+      if (res && res.data && res.data.length > 0) {
         this.setData({
           offlineTreatmentList: res.data,
         });

+ 2 - 2
miniprogram/module/health/components/nodrug-therapy/nodrug-therapy.wxml

@@ -20,7 +20,7 @@
     </view>
     <view class="table-box">
     <view class="nodrug-therapy-list" wx:if="{{offlineTreatmentList.length>0}}">
-      <block wx:for="{{offlineTreatmentList}}" wx:key="id">
+      <div wx:for="{{offlineTreatmentList}}" wx:key="id" bindtap="onRecord" data-id="{{item.id}}">
         <view class="therapy-card">
           <view class="therapy-title">{{item.conditioningProgramName}}</view>
           <view class="therapy-row">
@@ -32,7 +32,7 @@
             <text style="color:black">{{item.conditioningProgramSupplierName}}</text>
           </view>
         </view>
-      </block>
+      </div>
     </view>
     <view wx:else class="empty-data">
       暂无数据

+ 0 - 3
miniprogram/module/health/pages/home/home.ts

@@ -28,7 +28,6 @@ Component({
       this.setData({ 'healthPatient.loading': true, })
       try {
         const data = await healthPatientMethod();
-        console.log(data, "获取患者信息");
         this.setData({
           'healthPatient.data': data,
           'healthPatient.loading': false,
@@ -42,11 +41,9 @@ Component({
       }
     },
     async getHealthIndex(id?: string) {
-      console.log(id, "获取健康指数");
       this.setData({ 'healthIndex.loading': true, })
       try {
         const data = await healthIndexMethod(id);
-        console.log(data, "获取身体数据");
         this.setData({
           'healthIndex.data': healthIndex2Progress(data),
           'healthIndex.loading': false,

+ 0 - 1
miniprogram/module/health/pages/report/report.ts

@@ -28,7 +28,6 @@ Page({
         switchType: query.scene,
       });
     }
-    console.log(this.data.switchType, "这是onload页面report", query);
   },
 
   async _load(query: Record<"id" | "scene", string>) {

+ 0 - 1
miniprogram/pages/home/home.ts

@@ -186,7 +186,6 @@ Page({
     }
   },
   async onLoad(options) {
-    console.log("这是onload页面", options);
     appUpdate();
     const query = useRouteQuery(options.scene!);
     if (query.ys) wx.setStorageSync("doctorId", query.ys);

+ 32 - 16
miniprogram/pages/mine/mine.ts

@@ -43,7 +43,8 @@ Page({
   },
   // 读取缓存,若存在则直接渲染并返回已读到的数据
   hydrateFromCache() {
-    const cachedPatient = (wx.getStorageSync("patient") || null) as App.Patient.Model | null;
+    const cachedPatient = (wx.getStorageSync("patient") ||
+      null) as App.Patient.Model | null;
     const cachedPhone = (wx.getStorageSync("patientPhone") || "") as string;
     if (cachedPatient || cachedPhone) {
       this.setData({
@@ -66,19 +67,26 @@ Page({
     } catch {}
   },
   // 轻量对比(避免 JSON 深比较):患者用 patientId 或 name,对比手机号字符串
-  isDifferent(cachedPatient: App.Patient.Model | null, newPatient: App.Patient.Model | null, cachedPhone: string, newPhone: string) {
+  isDifferent(
+    cachedPatient: App.Patient.Model | null,
+    newPatient: App.Patient.Model | null,
+    cachedPhone: string,
+    newPhone: string
+  ) {
     const cachedId = cachedPatient?.patientId || "";
     const newId = newPatient?.patientId || "";
     const cachedName = cachedPatient?.name || "";
     const newName = newPatient?.name || "";
-    return cachedId !== newId || cachedName !== newName || (cachedPhone || "") !== (newPhone || "");
+    return (
+      cachedId !== newId ||
+      cachedName !== newName ||
+      (cachedPhone || "") !== (newPhone || "")
+    );
   },
   // 获取各状态调理记录数量
   async getRecordCount() {
-    console.log("获取各状态调理记录数量");
     try {
       const res = await getRecordCountMethod();
-      console.log(res.data, "获取各状态调理记录数量");
       if (res && res.data) {
         this.setData({
           "mineOrderList[0].count": res.data.pendingPayment,
@@ -87,9 +95,7 @@ Page({
           // "mineOrderList[3].count": res.data.total,
         });
       }
-      console.log(this.data.mineOrderList, "mineOrderList");
     } catch (error: any) {
-      console.error("获取各状态调理记录数量失败:", error);
       wx.showToast({
         title: error.message,
         icon: "none",
@@ -119,14 +125,28 @@ Page({
 
       // 2) 并行请求接口,完成后轻量对比,有变更再更新与回写缓存
       wx.showLoading({ title: "加载中" });
-      const [{ patient }, phoneRes] = await Promise.all([getPatients(), getPatientPhone()]);
+      const [{ patient }, phoneRes] = await Promise.all([
+        getPatients(),
+        getPatientPhone(),
+      ]);
       const latestPhone = phoneRes?.phone || "";
-      if (this.isDifferent(cachedPatient, patient || null, cachedPhone || "", latestPhone) || !this.data.loaded) {
-        this.setData({ patient: patient || null, phone: latestPhone, loaded: true });
+      if (
+        this.isDifferent(
+          cachedPatient,
+          patient || null,
+          cachedPhone || "",
+          latestPhone
+        ) ||
+        !this.data.loaded
+      ) {
+        this.setData({
+          patient: patient || null,
+          phone: latestPhone,
+          loaded: true,
+        });
         this.syncCache(patient || null, latestPhone);
       }
     } catch (error) {
-      console.error("加载失败:", error);
       wx.showToast({
         title: "加载失败",
         icon: "none",
@@ -169,7 +189,6 @@ Page({
 
   // 订单列表
   toOrderListPage(e: any) {
-    console.log("tab", e);
     const tab = e.currentTarget.dataset.tab;
     wx.navigateTo({
       url: `/module/article/pages/order-list/order-list?tab=${tab}`,
@@ -178,9 +197,7 @@ Page({
   // 获取全部订单列表
   async getOrderList() {
     const patientId = wx.getStorageSync("patientId");
-    console.log(patientId, "patientId");
-    const res = await getOrderList(patientId, "");
-    console.log(res, "获取订单列表");
+    await getOrderList(patientId, "");
   },
   onShow() {
     // 如果需要每次显示页面时刷新数据,可以在这里调用 load
@@ -203,7 +220,6 @@ Page({
     // });
   },
   onAddressTap() {
-    console.log("onAddressTap");
     // 跳转到收货地址页面
     wx.navigateTo({
       url: "/module/article/pages/manage-address/manage-address",