cc12458 6 месяцев назад
Родитель
Сommit
ef87ece55e
37 измененных файлов с 242 добавлено и 225 удалено
  1. 3 0
      miniprogram/app.config.ts
  2. 0 5
      miniprogram/components/button/button.ts
  3. 0 3
      miniprogram/lib/use/use-phone.ts
  4. 0 1
      miniprogram/module/article/components/diet-card/diet-card.ts
  5. 0 1
      miniprogram/module/article/components/science-card/science-card.ts
  6. 3 22
      miniprogram/module/care/pages/care/verifyRecord.ts
  7. 1 1
      miniprogram/module/care/pages/care/verifyRecord.wxml
  8. 1 1
      miniprogram/module/care/pages/careDetail/careDetail.wxml
  9. 7 4
      miniprogram/module/care/pages/offlineTreatment/offlineTreatment.ts
  10. 2 2
      miniprogram/module/care/pages/offlineTreatment/offlineTreatment.wxml
  11. 0 2
      miniprogram/module/charts/components/record-index/request.ts
  12. 0 1
      miniprogram/module/charts/record-care/record-care.ts
  13. 0 2
      miniprogram/module/charts/record-index/health-index.ts
  14. 0 2
      miniprogram/module/charts/record-index/request.ts
  15. 0 1
      miniprogram/module/chats/components/message-analysis/message-analysis.ts
  16. 0 1
      miniprogram/module/chats/components/message-follow/message-follow.ts
  17. 0 2
      miniprogram/module/chats/components/message-report/message-report.ts
  18. 19 30
      miniprogram/module/chats/components/message-select/message-select.ts
  19. 1 19
      miniprogram/module/chats/components/questionnaire/questionnaire.ts
  20. 0 2
      miniprogram/module/chats/pages/analysis/analysis.ts
  21. 0 7
      miniprogram/module/chats/pages/index/index.ts
  22. 0 1
      miniprogram/module/health/components/follow-evaluation/follow-evaluation.ts
  23. 0 2
      miniprogram/module/health/components/follow-record/follow-record.ts
  24. 0 2
      miniprogram/module/health/components/horizontal-scrollable/horizontal-scrollable.ts
  25. 19 2
      miniprogram/module/health/components/nodrug-therapy/nodrug-therapy.ts
  26. 2 2
      miniprogram/module/health/components/nodrug-therapy/nodrug-therapy.wxml
  27. 8 2
      miniprogram/module/health/pages/analysis/analysis.ts
  28. 0 3
      miniprogram/module/health/pages/home/home.ts
  29. 39 27
      miniprogram/module/health/pages/report/report.ts
  30. 1 1
      miniprogram/module/health/pages/scheme/scheme.wxml
  31. 2 2
      miniprogram/module/health/router.ts
  32. 8 30
      miniprogram/module/user/pages/user-certification/user-certification.ts
  33. 8 0
      miniprogram/pages/home/home.scss
  34. 40 17
      miniprogram/pages/home/home.ts
  35. 7 4
      miniprogram/pages/home/home.wxml
  36. 69 19
      miniprogram/pages/mine/mine.ts
  37. 2 2
      miniprogram/pages/mine/mine.wxml

+ 3 - 0
miniprogram/app.config.ts

@@ -2,12 +2,15 @@ import { getAccountInfoSync } from "./lib/wx/open-api";
 
 const miniProgram = getAccountInfoSync();
 const env = miniProgram.envVersion;
+console.log("env",env)
 let host = "wx2.hzliuzhi.com";
 if (env === "trial") {
   host = "test.hzliuzhi.com";
 } else if (env === "develop") {
+  // host = "wx2.hzliuzhi.com";
   host = "wx.hzliuzhi.com:4433";
 }
+console.log("host",host)
 export const Base_URL = `https://${host}/manager/fdhb-mobile`;
 export const Upload_URL = `https://${host}/manager/file`;
 

+ 0 - 5
miniprogram/components/button/button.ts

@@ -9,7 +9,6 @@ Component({
   },
   lifetimes: {
     attached(this: any) {
-      console.log("[Button] attached, initializing...");
       const mode = this.data.block ? "block" : "line";
       const index = this.data.index;
       this.setData({
@@ -17,10 +16,6 @@ Component({
         className: this.data.block ? "block" : `line-${index}`,
         isDisabled: false,
       });
-      console.log(
-        "[Button] initialized with isDisabled:",
-        this.data.isDisabled
-      );
     },
   },
   properties: {

+ 0 - 3
miniprogram/lib/use/use-phone.ts

@@ -27,11 +27,8 @@ export function usePhoneNumber() {
       callback(status)
     },
     getPhoneNumber(event: WechatMiniprogram.ButtonGetPhoneNumber) {
-      console.log('getPhoneNumber-->', event);
       const code = event.detail.code;
-      console.log('getPhoneNumber-->code', code);
       if (!code) return;
-      console.log('getPhoneNumber-->');
       _updateStatus.forEach(cb => cb('loading'))
       request({
         url: `/mobileAccountManage/getAccountPhone`,

+ 0 - 1
miniprogram/module/article/components/diet-card/diet-card.ts

@@ -8,7 +8,6 @@ Component({
   data: {},
   methods: {
     toInfoPage(event: WechatMiniprogram.TouchEvent) {
-      console.log(event, '药膳详情',this.data.replace);
       const id = event.currentTarget.id;
       if (this.data.replace) {
         wx.redirectTo({ url: `/module/article/pages/diet-info/diet-info?id=${id}` });

+ 0 - 1
miniprogram/module/article/components/science-card/science-card.ts

@@ -8,7 +8,6 @@ Component({
   data: {},
   methods: {
     toInfoPage(event: WechatMiniprogram.TouchEvent) {
-      console.log(event, '健康宣教',this.data.replace);
       const id = event.currentTarget.id;
       if (this.data.replace) {
         wx.redirectTo({ url: `/module/article/pages/science-info/science-info?id=${id}` });

+ 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: [],
   },
 });

+ 1 - 1
miniprogram/module/care/pages/care/verifyRecord.wxml

@@ -13,7 +13,7 @@
         <text style="color:black">{{item.operateBy}}</text>
       </view>
       <view class="record-row" wx:if="{{item.feedback}}">
-        <text class="label">上一次治疗反馈:</text>
+        <text class="label">治疗备注:</text>
         <text style="color:black">{{item.feedback}}</text>
       </view>
       <view class="record-row" wx:if="{{item.acuPointNames}}">

+ 1 - 1
miniprogram/module/care/pages/careDetail/careDetail.wxml

@@ -11,7 +11,7 @@
           <view class="detail-box">
             <view class="row"><text class="label">开具时间:</text>{{careDetail.createTime}}</view>
             <view class="row"><text class="label">开具医生:</text>{{careDetail.createBy}}</view>
-            <view class="delivery" wx:if="{{isShowDelivery}}">
+            <view class="delivery" wx:if="{{careDetail.isDelivery==='Y'}}">
               <view style="margin-bottom:10px">
                 <text class="label">配送:</text>
                 <text>是</text>

+ 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>

+ 0 - 2
miniprogram/module/charts/components/record-index/request.ts

@@ -4,7 +4,6 @@ const careId=wx.getStorageSync('careId')
 export function healthIndexReportMethod() {
   if(careId)
   {
-    console.log(careId, '服务包详情');
     return Post(`/patientCrManage/getPcrProcessById/${careId}`, {}, {
       transform({ data }: any) { 
         return transformHealthIndex2Chart(<any[]>data.patientQuotaGroups)
@@ -12,7 +11,6 @@ export function healthIndexReportMethod() {
     })
 
   }else{
-    console.log('获取健康评估记录');
     return Post(`/patientQuota/getQuovalRecord`, {}, {
       transform({ data }) { return transformHealthIndex2Chart(<any[]>data) }
     })

+ 0 - 1
miniprogram/module/charts/record-care/record-care.ts

@@ -27,7 +27,6 @@ Component({
         {},
         {
           transform({ data }: any) {
-            console.log(data, "获取健康评分数据");
             return data;
           },
         }

+ 0 - 2
miniprogram/module/charts/record-index/health-index.ts

@@ -84,11 +84,9 @@ export function healthIndex2Chart(model: App.Health.Index.Model, index = 0): Any
 
 export function transformHealthIndex2Chart(data: App.Health.Index.Data[]): AnyObject[] {
   const list = gather(data, healthIndex2Chart)
-  // console.log(list, 'transformHealthIndex2Chart-->list');
 
   const charts = [];
   for (const item of list) {
-    // console.log(item, 'item111');
     const xAxis = { type: 'category', axisLabel: { overflow: 'breakAll' } }
     const yAxis = [], series = [], visualMap = [];
     for (const option of item.options) {

+ 0 - 2
miniprogram/module/charts/record-index/request.ts

@@ -4,7 +4,6 @@ const careId=wx.getStorageSync('careId')
 export function healthIndexReportMethod() {
   if(careId)
   {
-    console.log(careId, '服务包详情');
     return Post(`/patientCrManage/getPcrProcessById/${careId}`, {}, {
       transform({ data }: any) { 
         return transformHealthIndex2Chart(<any[]>data.patientQuotaGroups)
@@ -12,7 +11,6 @@ export function healthIndexReportMethod() {
     })
 
   }else{
-    console.log('获取健康评估记录');
     return Post(`/patientQuota/getQuovalRecord`, {}, {
       transform({ data }) { return transformHealthIndex2Chart(<any[]>data) }
     })

+ 0 - 1
miniprogram/module/chats/components/message-analysis/message-analysis.ts

@@ -42,7 +42,6 @@ attached(){
    */
   methods: {
     onConfirm() {
-   console.log(this.data.messageType,"this.data.messageType")
       if (this.data.source.length) return;
       wx.navigateTo({
         url: '/module/chats/pages/analysis/analysis?messageType=' + this.data.messageType,

+ 0 - 1
miniprogram/module/chats/components/message-follow/message-follow.ts

@@ -23,7 +23,6 @@ Component({
     seeReport(){
       // const id = 1819;
      const id = wx.getStorageSync("tonguefaceAnalysisReportId");
-     console.log("查看舌面像报告", id);
      wx.navigateTo({ url: "/module/health/pages/analysis/analysis?id=" + id });
    },
   }

+ 0 - 2
miniprogram/module/chats/components/message-report/message-report.ts

@@ -6,8 +6,6 @@ Component({
   data: {},
   methods: {
     handle() {
-      console.log(this.data.payload);
-      
       wx.navigateTo({ url: this.data.payload.url })
     }
   }

+ 19 - 30
miniprogram/module/chats/components/message-select/message-select.ts

@@ -37,7 +37,6 @@ Component({
   },
   lifetimes: {
     attached() {
-      console.log("attached", this.data.payload.belongNew,this.data.payload);
       if (this.data.payload.belongNew) {
         this.setData({
           leftTitle: "都没有",
@@ -59,14 +58,16 @@ Component({
       this.setData({ initialOptions });
     },
     options(options: AnyArray) {
-      console.log("options", options);
       const hasSelected = options
         .filter((option: any) => !option.hide)
         .some((option: any) => option.checked);
-      
+
       // 检测是否与初始状态不同
-      const hasChanged = this._checkOptionsChanged(options, this.data.initialOptions);
-      
+      const hasChanged = this._checkOptionsChanged(
+        options,
+        this.data.initialOptions
+      );
+
       this.setData({
         hasSelected,
         hasChanged,
@@ -75,50 +76,49 @@ Component({
   },
   methods: {
     // 检测选项是否发生变化
-    _checkOptionsChanged(currentOptions: Option[], initialOptions: Option[]): boolean {
+    _checkOptionsChanged(
+      currentOptions: Option[],
+      initialOptions: Option[]
+    ): boolean {
       if (!initialOptions || initialOptions.length === 0) {
         return false;
       }
-      
+
       // 比较主选项的选中状态
       for (let i = 0; i < currentOptions.length; i++) {
         const current = currentOptions[i];
         const initial = initialOptions[i];
-        
+
         if (!initial) continue;
-        
+
         // 比较主选项的checked状态
         if (current.checked !== initial.checked) {
           return true;
         }
-        
+
         // 如果有子选项,比较子选项的选中状态
         if (current.options && initial.options) {
           for (let j = 0; j < current.options.length; j++) {
             const currentSub = current.options[j];
             const initialSub = initial.options[j];
-            
+
             if (!initialSub) continue;
-            
+
             if (currentSub.checked !== initialSub.checked) {
               return true;
             }
           }
         }
       }
-      
+
       return false;
     },
 
-
-    
     handleTop(event: HandleEvent) {
       const {
         mark: { item },
       } = event;
-      console.log("handleTop", item, this.data.active);
       if (!item || !this.data.active) return;
-      console.log("handleTop", this.data.subOptions);
       const index = this.data.options.findIndex(
         (option) => option.id === item.id
       );
@@ -130,7 +130,6 @@ Component({
       const hasAnySubChecked = itemInState?.options?.some(
         (o: any) => o?.checked
       );
-      console.log("itemInState", itemInState, hasSubOptions, hasAnySubChecked);
       if (itemInState?.checked && hasSubOptions && hasAnySubChecked) {
         this.setData({
           subTitle: itemInState.name,
@@ -165,18 +164,14 @@ Component({
       }
     },
 
-
     handleSub(event: HandleEvent) {
       const {
         mark: { item },
       } = event;
-      console.log("handleSub", item, this.data.active);
       if (!item || !this.data.active) return;
-      console.log("this.data.subOptions", this.data.subOptions);
       const index = this.data.subOptions.findIndex(
         (option) => option.id === item.id
       );
-      console.log("index", index);
       const multiple = this.data.subMultiple;
       const checked = !item.checked;
       const subOptions = this._handle(
@@ -186,8 +181,6 @@ Component({
         multiple
       );
       this.setData({ subOptions });
-      console.log(this.data.subOptions, "suboptions111");
-
       // 检查是否所有症状程度都被取消选中
       const hasAnySubChecked = subOptions.some((option) => option.checked);
       if (!hasAnySubChecked) {
@@ -271,12 +264,10 @@ Component({
     onCancel() {},
     onConfirm() {},
     onSubmit() {
-      console.log("onSubmit", this.data.result, this.data.hasSelected);
       if (this.data.result) return;
       if (!this.data.hasSelected) {
         wx.showToast({ title: "请至少选择一项", icon: "error" });
       } else {
-        console.log(this.data.options);
         const result = this.data.options
           .filter((item: any) => item?.checked && !item?.hide)
           .map((option: any) => {
@@ -287,15 +278,13 @@ Component({
             return [option.name, sub].filter(Boolean).join(": ");
           })
           .join("; ");
-        console.log("result", result);
         this.setData({ result });
         this.triggerEvent("next", { options: this.data.options });
       }
     },
     onSkip() {
-      console.log("onSkip", this.data.result, this.data.hasSelected);
       if (this.data.result) return;
-      
+
       // 如果是新用户(belongNew为true),使用原来的逻辑
       if (this.data.payload.belongNew) {
         if (this.data.hasSelected) return;
@@ -310,7 +299,7 @@ Component({
           // wx.showToast({ title: "症状已发生变化,请重新选择", icon: "none" });
           return;
         }
-        
+
         // 如果没有变化,允许点击"无变化"
         this.setData({ result: "无变化" });
         this.triggerEvent("next", { options: this.data.options });

+ 1 - 19
miniprogram/module/chats/components/questionnaire/questionnaire.ts

@@ -31,7 +31,6 @@ interface MessageType {
 Component({
   lifetimes: {
     attached: function () {
-
       let isAnalysis: number;
       isAnalysis = wx.getStorageSync("isAnalysis");
       if (isAnalysis === 3 || isAnalysis === 4) {
@@ -210,29 +209,12 @@ Component({
             payload: { title: "" },
           });
         } else if (this.data.messageType === 2) {
-          // todo 如果是对话管家 调用dialogueManage/dialog 这个接口
-          // 如果是健康评估 调用其他接口  但后端返回的数据是一样的
-
           let data: any = {};
           const res = await Post(
             `/dialogueManage/dialogTreat`,
             this.data._next
           );
           data = res.data;
-          // if (isAnalysis === 3) {
-          //   const res = await Post(`/dialogueManage/dialog`, this.data._next);
-          //   data = res.data;
-          // } else {
-          //   const res = await Post(
-          //     `/dialogueManage/dialogTreat`,
-          //     this.data._next
-          //   );
-          //   data = res.data;
-          // }
-          // const { data } = await Post(
-          //   `/dialogueManage/dialog`,
-          //   this.data._next
-          // );
 
           data.nextQuestions?.forEach((question: any, index: number) => {
             // isAnalysis 2是随访  3健康管家 4健康评估
@@ -342,7 +324,7 @@ Component({
             payload: { title: error.errMsg ?? `图像检测失败,请重新拍摄上传` },
           });
           this.triggerEvent("to");
-          setTimeout(() => this._start(), 20);
+          // setTimeout(() => this._start(), 20);
         } else {
           const date = Date.now();
           this._createMessage({

+ 0 - 2
miniprogram/module/chats/pages/analysis/analysis.ts

@@ -85,7 +85,6 @@ Component({
   methods: {
     handle(event: WechatMiniprogram.TouchEvent) {
       const { handle, index } = event.mark as AnyObject;
-      console.log(handle, index, handle === "upload:delete", event.mark);
       switch (handle) {
         case "preview":
           break;
@@ -221,7 +220,6 @@ Component({
           this.setData({ _submitting: false });
         }
       } else {
-        // console.log("对话管家",data)
         // 对话管家
         this.getOpenerEventChannel().emit("update", data);
         wx.navigateBack();

+ 0 - 7
miniprogram/module/chats/pages/index/index.ts

@@ -35,20 +35,15 @@ Component({
         this.setData({ isShowGuide: true });
       }
       this.handle({ detail: { component, scroll: true } });
-      console.log("id-index",this.data.messages);
       // 计算底部bottom
       const systemInfo = wx.getSystemInfoSync();
       const windowHeight = systemInfo.windowHeight;
       const safeAreaBottom = systemInfo.safeArea?.bottom ?? windowHeight; // 没有safeArea时,bottom等于windowHeight
       const safeBottom = windowHeight - safeAreaBottom; // 安全区底部距离(px)
       const safeBottomRpx = (750 / systemInfo.windowWidth) * safeBottom; // rpx
-      console.log(safeBottom, "safeBottom");
-      // const tabbarHeight = 40; // 你的tabbar高度,单位px(如80rpx转px,或直接用rpx)
-      // let paddingBottom = tabbarHeight + safeBottom;
       this.setData({
         paddingBottom: this.data.paddingBottom+safeBottomRpx,
       });
-      console.log(this.data.paddingBottom, "paddingBottom");
     },
     ready() {
       wx.createSelectorQuery()
@@ -82,7 +77,6 @@ Component({
   },
   methods: {
     boxBottom(event: boxBottom) {
-      console.log(event.detail.inputBoxBottom, "监听页面index高度boxbottom");
       this.setData({
         inputBoxBottom: event.detail.inputBoxBottom + 60,
       });
@@ -90,7 +84,6 @@ Component({
       this.setData({
         paddingBottom: event.detail.inputBoxBottom,
       });
-      console.log(this.data.inputBoxBottom, "监听页面index高度boxbottom");
     },
     nextType(event: NextTypeEvent) {
       this.setData({ messageType: event.detail.MessageType });

+ 0 - 1
miniprogram/module/health/components/follow-evaluation/follow-evaluation.ts

@@ -47,7 +47,6 @@ Component({
       }
     },
     goFollowEvaluation() {
-      console.log("评估详情");
       // wx.navigateTo({
       //   url: `/module/follow/pages/evaluation/report`,
       // });

+ 0 - 2
miniprogram/module/health/components/follow-record/follow-record.ts

@@ -10,13 +10,11 @@ Component({
   methods: {
     async getFollowRecordList() {
       const res = await getFollowRecordListMethod();
-      console.log(res,"记录列表");
       this.setData({
         followEvaluationList: res.data,
       });
     },
     goFollowRecord(e: any) {
-      console.log(e, "记录列表");
     },
   },
   properties: {},

+ 0 - 2
miniprogram/module/health/components/horizontal-scrollable/horizontal-scrollable.ts

@@ -32,8 +32,6 @@ Component({
     },
 
     start() {
-      console.log('触发');
-
       const query = this.createSelectorQuery()
       query.select('.scrollable').boundingClientRect();
       query.selectAll('.scheme__card').boundingClientRect();

+ 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">
       暂无数据

+ 8 - 2
miniprogram/module/health/pages/analysis/analysis.ts

@@ -17,10 +17,16 @@ Page({
     tongue: null as unknown as AnalysisModel,
     face: null as unknown as AnalysisModel,
     dataset: null as unknown as AnyObject,
+    switchType: "",
   },
   onLoad(query: any) {
-    console.log(query,"query1111")
     this._load(query);
+    if (query.scene) {
+      this.setData({
+        switchType: query.scene,
+      });
+    }
+    console.log(this.data.switchType,"query1111",query)
   },
 
   async _load(query: Record<'id' | 'scene', string>) {
@@ -36,5 +42,5 @@ Page({
     wx.hideLoading();
   },
 
-  toHomePage() { toHomePage(); },
+  toHomePage() { toHomePage(this.data.switchType as string); },
 });

+ 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,

+ 39 - 27
miniprogram/module/health/pages/report/report.ts

@@ -1,44 +1,52 @@
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
-import TickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
+import TickleBehavior, {
+  getTickleContext,
+} from "../../../../core/behavior/tickle.behavior";
 
 // module/health/pages/report/report.ts
-import { toSchemePage, toHomePage } from '../../router';
+import { toSchemePage, toHomePage } from "../../router";
 import { healthIndexMethod, healthReportMethod } from "../../request";
 import { healthIndex2Progress } from "../../tools/health-index";
 
-
 Page({
-  behaviors: [
-    PageContainerBehavior,
-    TickleBehavior
-  ],
+  behaviors: [PageContainerBehavior, TickleBehavior],
   data: {
-    id: '',
+    id: "",
     dataset: null as unknown as AnyObject,
     showScheme: false,
-    schemeId: '',
-    healthIndex: { data: [], loading: false, message: '' },
+    schemeId: "",
+    healthIndex: { data: [], loading: false, message: "" },
     tongueAnalysis: [] as AnyArray,
+    switchType: "",
   },
   onLoad(query: any) {
-    this._load(query).then((id: string) => { if (id) this.getHealthIndex(id); });
+    this._load(query).then((id: string) => {
+      if (id) this.getHealthIndex(id);
+    });
+    if (query.scene) {
+      this.setData({
+        switchType: query.scene,
+      });
+    }
   },
 
-  async _load(query: Record<'id' | 'scene', string>) {
-    let id = '';
-    wx.showLoading({ title: '加载中' });
+  async _load(query: Record<"id" | "scene", string>) {
+    let id = "";
+    wx.showLoading({ title: "加载中" });
     try {
       const { __origin__, ...dataset } = await healthReportMethod(query);
       id = dataset.id;
-      const showScheme = __origin__?.isHaveConditioningProgram === 'Y';
-      const schemeId = __origin__?.isConfirmConditioningProgram === 'Y' ? id : '';
+      const showScheme = __origin__?.isHaveConditioningProgram === "Y";
+      const schemeId =
+        __origin__?.isConfirmConditioningProgram === "Y" ? id : "";
       this.setData({
-        showScheme, schemeId,
+        showScheme,
+        schemeId,
         dataset: {
           ...dataset,
           factorItems: __origin__?.factorItems,
           diagnoseSyndromes: __origin__?.diagnoseSyndromes,
-        }
+        },
       });
     } catch (error) {
       getTickleContext.call(this).showErrorMessage(error.errMsg, 0);
@@ -49,21 +57,25 @@ Page({
   },
 
   async getHealthIndex(id?: string) {
-    this.setData({ 'healthIndex.loading': true, })
+    this.setData({ "healthIndex.loading": true });
     try {
       const data = await healthIndexMethod(id);
       this.setData({
-        'healthIndex.data': healthIndex2Progress(data),
-        'healthIndex.loading': false,
+        "healthIndex.data": healthIndex2Progress(data),
+        "healthIndex.loading": false,
       });
     } catch (error) {
       this.setData({
-        'healthIndex.data': [],
-        'healthIndex.loading': false,
-        'healthIndex.message': error.errMsg,
+        "healthIndex.data": [],
+        "healthIndex.loading": false,
+        "healthIndex.message": error.errMsg,
       });
     }
   },
-  toHomePage() { toHomePage(); },
-  toSchemePage() { toSchemePage(this.data.schemeId); },
-});
+  toHomePage() {
+    toHomePage(this.data.switchType as string);
+  },
+  toSchemePage() {
+    toSchemePage(this.data.schemeId);
+  },
+});

+ 1 - 1
miniprogram/module/health/pages/scheme/scheme.wxml

@@ -17,7 +17,7 @@
       <t-cell t-class="card-header cell-border-gradient" title="{{item.title}}" />
       <view class="card-body">
         <view class="scheme__item" wx:for="{{item.children}}" wx:key="title">
-          <view class="buy-container">
+          <view class="buy-container" wx:if="{{item.title || item.buyUrl}}">
             <view class="scheme__item-title scheme__title" wx:if="{{item.title}}">{{item.title}}</view>
             <view class="scheme__item-title scheme__title" wx:else></view>
             <view class="buy-box" bindtap="goBuy" data-item="{{item}}" wx:if="{{item.buyUrl}}">去购买</view>

+ 2 - 2
miniprogram/module/health/router.ts

@@ -1,5 +1,5 @@
-export function toHomePage() {
-  wx.reLaunch({ url: '/pages/home/home' })
+export function toHomePage(switchType?: string) {
+  wx.reLaunch({ url: `/pages/home/home?switchType=${switchType}` })
 }
 export function toSchemePage(id?: string) {
   if (!id) {

+ 8 - 30
miniprogram/module/user/pages/user-certification/user-certification.ts

@@ -18,7 +18,6 @@ Component({
   behaviors: [PageContainerBehavior, DictionariesBehavior, tickleBehavior],
   lifetimes: {
     attached() {
-    
       const channel = this.getOpenerEventChannel();
       channel.on("navigateBack", (data) => {
         this.setData(data);
@@ -37,6 +36,7 @@ Component({
   data: {
     loading: false,
     verifying: false,
+    submitting: false,
     model: {} as AnyObject,
     name: "",
     cardno: "",
@@ -103,6 +103,8 @@ Component({
       }
     },
     async onSubmit(event: WechatMiniprogram.FormSubmit) {
+      if (this.data.submitting) return;
+      this.setData({ submitting: true });
       const data = { ...this.data.model, ...event.detail.value };
       data.phone = this.data.model.phone;
       const submitBtn = this.selectComponent("#submitBtn");
@@ -110,26 +112,9 @@ Component({
         if (submitBtn) submitBtn.resetState();
         return getTickleContext.call(this).showWarnMessage("请获取手机号码");
       }
-      // if (!data.cardno) data.cardno = this.data.cardno;
-      // if (data.sex == null) data.sex = this.data.sex;
       if (!data.agemust) {
         data.agemust = this.data.privacyContract.agree ? "Y" : "N";
       }
-
-      // if (!data.name)
-      //   return getTickleContext.call(this).showWarnMessage("请输入姓名");
-      // if (data.cardno?.length !== 18)
-      //   return getTickleContext
-      //     .call(this)
-      //     .showWarnMessage("请输入正确的身份证号");
-      // if (data.sex === "1" && !data.womenSpecialPeriod)
-      //   return getTickleContext
-      //     .call(this)
-      //     .showWarnMessage("请至少选择一项女性特殊期");
-      // if (!data.height)
-      //   return getTickleContext.call(this).showWarnMessage("请输入身高");
-      // if (!data.weight)
-      //   return getTickleContext.call(this).showWarnMessage("请输入体重");
       if (data.agemust === "N") {
         if (submitBtn) submitBtn.resetState();
         this.setData({ "privacyContract.show": true });
@@ -140,22 +125,13 @@ Component({
       }
       wx.showLoading({ title: "保存中" });
       try {
-        // const { patientId } = await createUserInfoMethod(<any>data);
         const { patientId } = await createPhoneRegister(<any>data);
-        // await wx.navigateBack();
-        // if (patientId) this.getOpenerEventChannel().emit('update', { patientId });
         wx.setStorageSync("patientId", patientId);
-        // wx.redirectTo({
-        //   url: `/module/chats/pages/index/index?component=questionnaire`,
-        // });
-        // wx.redirectTo({
-        //   url: `/pages/home/home`,
-        // });
         // 回到相应的页面
         if (this.data.type === "home") {
           wx.navigateTo({
-            url: '/pages/home/home',
-          })
+            url: "/pages/home/home",
+          });
         } else {
           wx.navigateBack();
         }
@@ -165,8 +141,10 @@ Component({
           submitBtn.resetState();
         }
         getTickleContext.call(this).showErrorMessage(error.errMsg);
+      } finally {
+        this.setData({ submitting: false });
+        wx.hideLoading();
       }
-      wx.hideLoading();
     },
   },
 });

+ 8 - 0
miniprogram/pages/home/home.scss

@@ -624,3 +624,11 @@ $scale: 0.5;
   color: #1976d2;
   margin-bottom: 15px;
 }
+
+.loading-center {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 180rpx;
+  width: 100%;
+}

+ 40 - 17
miniprogram/pages/home/home.ts

@@ -29,7 +29,7 @@ import { useLocation } from "../../lib/use/use-location";
 
 Page({
   data: {
-    isShowComplete: false,
+    isShowComplete: true,
     careList: [],
     displayList: [] as {
       id: number;
@@ -54,7 +54,7 @@ Page({
     patient: null as App.Patient.Model | null,
     patientDescription: "",
     healthId: "",
-    healthReport: { data: null, message: "" },
+    healthReport: { data: null, message: "", loading: true },
     healthIndex: { data: [], message: "" },
 
     position: {} as AnyObject,
@@ -70,6 +70,8 @@ Page({
 
     statusList: [] as AnyArray,
 
+    switchType: "",
+
     carouselLoading: {} as Record<string | number, boolean>, // 用于跟踪每个轮播图的加载状态
 
     // 轮播媒体列表
@@ -189,27 +191,45 @@ Page({
     appUpdate();
     const query = useRouteQuery(options.scene!);
     if (query.ys) wx.setStorageSync("doctorId", query.ys);
-
     this.initFabAnimated();
+    if (options.switchType) {
+      this.setData({
+        switchType: options.switchType,
+      });
+    }
   },
   async onShow() {
     wx.showShareMenu({ withShareTicket: true, menus }).then();
     await this.load();
-    // 如果用户没有手机号每次进入页面都提示  点击跳到注册页补充
-    // todo 要先判断用户有没有手机号 isPerfectInfo是true 就出来弹窗提示用户
-    if ((this.data.patient as any)?.isPerfectInfo ?? true) {
-      wx.showModal({
-        title: "提示",
-        content: "手机号为空,请补充",
-        success: (res) => {
-          if (res.confirm) {
-            wx.navigateTo({
-              url: "/module/user/pages/user-certification/user-certification?type=home",
-            });
-          }
-        },
+    console.log(
+      this.data.switchType,
+      "home.ts中的switchType",
+      this.data.patient
+    );
+    // 如果是从一体机扫码进来的  有switchType值就直接跳转到注册页面
+    if (
+      this.data.switchType &&
+      ((this.data.patient as any)?.isPerfectInfo ?? true)
+    ) {
+      wx.navigateTo({
+        url: "/module/user/pages/user-certification/user-certification?type=home",
       });
     }
+    // 如果用户没有手机号每次进入页面都提示  点击跳到注册页补充
+    // todo 要先判断用户有没有手机号 isPerfectInfo是true 就出来弹窗提示用户
+    // if ((this.data.patient as any)?.isPerfectInfo ?? true) {
+    //   wx.showModal({
+    //     title: "提示",
+    //     content: "手机号为空,请补充",
+    //     success: (res) => {
+    //       if (res.confirm) {
+    //         wx.navigateTo({
+    //           url: "/module/user/pages/user-certification/user-certification?type=home",
+    //         });
+    //       }
+    //     },
+    //   });
+    // }
   },
   onHide() {
     wx.hideShareMenu({ menus }).then();
@@ -383,6 +403,10 @@ Page({
         if (wx.getStorageSync("doctorId")) {
           toCertificationPage();
         }
+        this.setData({
+          "healthReport.loading": false,
+          isShowComplete: true,
+        });
       } else {
         this.setData({ patient });
         this.observerPatient(patient);
@@ -422,7 +446,6 @@ Page({
     this.setData({ "healthReport.loading": true });
     try {
       const data = await healthReportMethod();
-
       if (!data) {
         this.setData({
           isShowComplete: true,

+ 7 - 4
miniprogram/pages/home/home.wxml

@@ -36,7 +36,10 @@
         </view>
       </view>
 
-      <view class="healthyAnalyze" bindtap="goHealthAnalyze" wx:if="{{isShowComplete}}">
+      <view wx:if="{{healthReport.loading}}" class="loading-center">
+        <t-loading theme="circular" size="48px" color="#2d92fd" />
+      </view>
+      <view class="healthyAnalyze" bindtap="goHealthAnalyze" wx:elif="{{isShowComplete}}">
         请完成健康评估
       </view>
       <view class="steps-container" wx:else>
@@ -75,7 +78,7 @@
               <view class="item-main" bindtap="toggleItem" data-index="{{index}}">
                 <text class="dot"></text>
                 <text class="item-title">{{item.conditioningProgramName}}</text>
-                <text class="item-next-time" wx:if="{{item.arrangeDate}}">下一次时间:{{item.arrangeDate}}</text>
+                <text class="item-next-time" wx:if="{{item.arrangeDate && item.isOffline==='Y'}}">下一次时间:{{item.arrangeDate}}</text>
                 <t-icon name="{{item.expanded ? 'chevron-up' : 'chevron-down'}}" size="24rpx" class="item-arrow" color="#C0C4CC" />
               </view>
               <!-- 这里放详细内容 -->
@@ -92,7 +95,7 @@
                     <media-carousel wx:else mediaList="{{item.carouselMediaList}}" showIndicator="{{true}}" autoplay="{{true}}" interval="{{4000}}" circular="{{true}}" bind:imageload="onCarouselLoaded" bind:imageerror="onImageError" bind:videoerror="onVideoError" itemId="{{item.id}}" />
                   </view>
                   <view class="item-box">
-                    <view class="flex" wx:if="{{item.arrangeDate}}"><text>下一次时间:</text><text>{{item.arrangeDate}}</text></view>
+                    <view class="flex" wx:if="{{item.arrangeDate && item.isOffline==='Y'}}"><text>下一次时间:</text><text>{{item.arrangeDate}}</text></view>
                     <view class="flex">
                       <text wx:if="{{item.isOffline==='Y'}}">已完成:<text style="color:#2ec4b6">{{item.finishCount}}次</text><text style="margin:0 5px">/</text>
                         <text>{{item.totalMeasure}}次</text></text>
@@ -100,7 +103,7 @@
                     </view>
                     <view>频次:每{{item.frequencyType}}天{{item.frequencyMeasure}}{{item.convertUnit}}</view>
                     <view>开具医生:{{item.operateBy}}</view>
-                    <view wx:if="{{item.conditioningProgramSupplierName}}">机构:{{item.conditioningProgramSupplierName}}</view>
+                    <view wx:if="{{item.isOffline==='Y'}}">机构:{{item.conditioningProgramSupplierName}}</view>
                   </view>
                 </view>
                 <view data-id="{{item.id}}" wx:if="{{item.isOffline==='N'}}" class="verify-record" bindtap="isGoPunchcard" data-signinTime="{{item.signinTime}}">{{

+ 69 - 19
miniprogram/pages/mine/mine.ts

@@ -9,6 +9,7 @@ Page({
     userInfo: null,
     tabbarValue: "/pages/mine/mine",
     phone: "",
+    loaded: false,
     mineOrderList: [
       {
         url: "../../assets/icon/obligation@3x.png",
@@ -40,12 +41,52 @@ Page({
       },
     ],
   },
+  // 读取缓存,若存在则直接渲染并返回已读到的数据
+  hydrateFromCache() {
+    const cachedPatient = (wx.getStorageSync("patient") ||
+      null) as App.Patient.Model | null;
+    const cachedPhone = (wx.getStorageSync("patientPhone") || "") as string;
+    if (cachedPatient || cachedPhone) {
+      this.setData({
+        patient: cachedPatient || null,
+        phone: cachedPhone || "",
+        loaded: true,
+      });
+    }
+    return { cachedPatient, cachedPhone } as {
+      cachedPatient: App.Patient.Model | null;
+      cachedPhone: string;
+    };
+  },
+  // 写入缓存
+  syncCache(patient: App.Patient.Model | null, phone: string) {
+    try {
+      wx.setStorageSync("patient", patient || null);
+      wx.setStorageSync("patientPhone", phone || "");
+      wx.setStorageSync("patientName", patient?.name);
+    } catch {}
+  },
+  // 轻量对比(避免 JSON 深比较):患者用 patientId 或 name,对比手机号字符串
+  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 || "")
+    );
+  },
   // 获取各状态调理记录数量
   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,
@@ -54,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",
@@ -81,21 +120,33 @@ Page({
     }
     this.getRecordCount();
     try {
+      // 1) 先读缓存渲染,避免初始闪烁
+      const { cachedPatient, cachedPhone } = this.hydrateFromCache();
+
+      // 2) 并行请求接口,完成后轻量对比,有变更再更新与回写缓存
       wx.showLoading({ title: "加载中" });
-      const { patient } = await getPatients();
-      const res = await getPatientPhone();
-      console.log(res, "获取手机号");
-      if (res && res.phone) {
+      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({
-          phone: res.phone,
+          patient: patient || null,
+          phone: latestPhone,
+          loaded: true,
         });
+        this.syncCache(patient || null, latestPhone);
       }
-      wx.setStorageSync("patientName", patient?.name);
-      this.setData({
-        patient: patient || null,
-      });
     } catch (error) {
-      console.error("加载失败:", error);
       wx.showToast({
         title: "加载失败",
         icon: "none",
@@ -103,6 +154,9 @@ Page({
       });
     } finally {
       wx.hideLoading();
+      if (!this.data.loaded) {
+        this.setData({ loaded: true });
+      }
     }
   },
 
@@ -135,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}`,
@@ -144,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
@@ -169,7 +220,6 @@ Page({
     // });
   },
   onAddressTap() {
-    console.log("onAddressTap");
     // 跳转到收货地址页面
     wx.navigateTo({
       url: "/module/article/pages/manage-address/manage-address",

+ 2 - 2
miniprogram/pages/mine/mine.wxml

@@ -6,8 +6,8 @@
       <view class="head-box">
         <t-avatar class="avatar-example" size="64px">W</t-avatar>
         <view class="name-box">
-          <view class="name">{{patient ? patient.name : '未登录'}}</view>
-          <view class="phone" wx:if="{{phone}}">{{phone}}</view>
+        <view class="name" wx:if="{{loaded}}">{{patient ? patient.name : '未登录'}}</view>
+          <view class="phone" wx:if="{{loaded && phone}}">{{phone}}</view>
         </view>
       </view>