cc12458 5 месяцев назад
Родитель
Сommit
4e78409eaf
37 измененных файлов с 876 добавлено и 620 удалено
  1. 1 0
      miniprogram/app.config.ts
  2. 2 1
      miniprogram/app.json
  3. 0 1
      miniprogram/components/media-carousel/media-carousel.scss
  4. 19 76
      miniprogram/components/media-carousel/media-carousel.ts
  5. 12 28
      miniprogram/components/media-carousel/media-carousel.wxml
  6. 1 0
      miniprogram/components/popup-privacy/popup-privacy.ts
  7. 1 1
      miniprogram/components/popup-privacy/popup-privacy.wxml
  8. 10 0
      miniprogram/components/popup-user-auth/popup-user-auth.json
  9. 86 0
      miniprogram/components/popup-user-auth/popup-user-auth.scss
  10. 123 0
      miniprogram/components/popup-user-auth/popup-user-auth.ts
  11. 41 0
      miniprogram/components/popup-user-auth/popup-user-auth.wxml
  12. 19 0
      miniprogram/lib/request/common.ts
  13. 5 16
      miniprogram/module/article/pages/order-detail/order-detail.ts
  14. 7 0
      miniprogram/module/article/pages/order-list/order-list.ts
  15. 1 1
      miniprogram/module/article/pages/order-list/order-list.wxml
  16. 1 3
      miniprogram/module/chats/components/guide-analysis/guide-analysis.json
  17. 46 3
      miniprogram/module/chats/components/guide-analysis/guide-analysis.scss
  18. 114 0
      miniprogram/module/chats/components/guide-analysis/guide-analysis.ts
  19. 50 0
      miniprogram/module/chats/components/guide-analysis/guide-analysis.wxml
  20. 1 0
      miniprogram/module/chats/components/message-analysis/message-analysis.json
  21. 46 12
      miniprogram/module/chats/components/message-analysis/message-analysis.ts
  22. 3 1
      miniprogram/module/chats/components/message-analysis/message-analysis.wxml
  23. 0 229
      miniprogram/module/chats/pages/analysis/analysis.ts
  24. 0 42
      miniprogram/module/chats/pages/analysis/analysis.wxml
  25. 10 11
      miniprogram/module/health/pages/analysis/analysis.ts
  26. 2 1
      miniprogram/module/health/pages/analysis/analysis.wxml
  27. 11 11
      miniprogram/module/health/pages/report/report.ts
  28. 2 1
      miniprogram/module/health/pages/report/report.wxml
  29. 1 0
      miniprogram/module/health/pages/scheme/scheme.json
  30. 52 0
      miniprogram/module/health/pages/scheme/scheme.scss
  31. 144 41
      miniprogram/module/health/pages/scheme/scheme.ts
  32. 25 2
      miniprogram/module/health/pages/scheme/scheme.wxml
  33. 1 0
      miniprogram/module/health/request.ts
  34. 2 1
      miniprogram/pages/home/home.scss
  35. 22 129
      miniprogram/pages/home/home.ts
  36. 9 8
      miniprogram/pages/home/home.wxml
  37. 6 1
      miniprogram/pages/home/request.ts

+ 1 - 0
miniprogram/app.config.ts

@@ -9,6 +9,7 @@ if (env === "trial") {
 } else if (env === "develop") {
   // host = "wx2.hzliuzhi.com";
   host = "wx.hzliuzhi.com:4433";
+  // host = "test.hzliuzhi.com";
 }
 console.log("host",host)
 export const Base_URL = `https://${host}/manager/fdhb-mobile`;

+ 2 - 1
miniprogram/app.json

@@ -4,7 +4,7 @@
     {
       "name": "chats",
       "root": "module/chats",
-      "pages": ["pages/index/index", "pages/analysis/analysis"]
+      "pages": ["pages/index/index"]
     },
     {
       "name": "health",
@@ -100,6 +100,7 @@
   "usingComponents": {
     "t-navbar": "tdesign-miniprogram/navbar/navbar",
     "t-message": "tdesign-miniprogram/message/message",
+    "popup-user-auth": "./components/popup-user-auth/popup-user-auth",
     "popup-privacy": "./components/popup-privacy/popup-privacy"
   },
   "requiredPrivateInfos": ["getFuzzyLocation", "chooseAddress"],

+ 0 - 1
miniprogram/components/media-carousel/media-carousel.scss

@@ -10,7 +10,6 @@
 
 /* 自适应高度模式 */
 .media-carousel.adaptive-height {
-  /* height: auto; */
   min-height: 400rpx;
 }
 

+ 19 - 76
miniprogram/components/media-carousel/media-carousel.ts

@@ -1,120 +1,63 @@
 // components/media-carousel/media-carousel.ts
-
-// 定义微信小程序组件的类型
-interface IComponentInstance {
-  setData: (data: any) => void;
-  triggerEvent: (name: string, detail: any) => void;
-  data: any;
-  properties: any;
-}
-
-interface IComponentOptions {
-  properties: Record<string, any>;
-  data: any;
-  methods: Record<string, Function>;
-}
-
-// 声明全局的 Component 函数
-declare function Component(options: IComponentOptions): void;
-
 Component({
-  /**
-   * 组件的属性列表
-   */
   properties: {
-    // 媒体列表
     mediaList: {
       type: Array,
       value: [],
-      observer: function(this: IComponentInstance, newVal: any[]) {
+      observer: function (this: any, newVal: any[]) {
         this.setData({
-          totalCount: newVal.length
+          totalCount: newVal.length,
         });
-      }
+      },
     },
-    // 项目ID,用于标识轮播图属于哪个项目
     itemId: {
       type: String,
-      value: ''
+      value: "",
     },
     // 是否显示指示器
     showIndicator: {
       type: Boolean,
-      value: true
+      value: true,
     },
     // 指示器颜色
     indicatorColor: {
       type: String,
-      value: 'rgba(255, 255, 255, 0.6)'
+      value: "rgba(255, 255, 255, 0.6)",
     },
     // 指示器激活颜色
     indicatorActiveColor: {
       type: String,
-      value: '#fff'
+      value: "#fff",
     },
     // 是否自动播放
     autoplay: {
       type: Boolean,
-      value: true
+      value: true,
     },
     // 自动播放间隔时间
     interval: {
       type: Number,
-      value: 3000
+      value: 3000,
     },
     // 滑动动画时长
     duration: {
       type: Number,
-      value: 500
+      value: 500,
     },
     // 是否循环播放
     circular: {
       type: Boolean,
-      value: true
-    }
+      value: true,
+    },
   },
-
-  /**
-   * 组件的初始数据
-   */
   data: {
-    currentIndex: 0,
-    totalCount: 0
+    totalCount: 0,
   },
-
-  /**
-   * 组件的方法列表
-   */
   methods: {
-    // 图片加载成功
-    onImageLoad(this: IComponentInstance, e: any) {
-      const { index } = e.currentTarget.dataset;
-      this.triggerEvent('imageload', {
-        index: index,
-        item: this.data.mediaList[index],
-        itemId: this.properties.itemId
-      });
-    },
-
-    // 图片加载失败
-    onImageError(this: IComponentInstance, e: any) {
-      const { index } = e.currentTarget.dataset;
-  
-      this.triggerEvent('imageerror', {
-        index: index,
-        item: this.data.mediaList[index],
-        itemId: this.properties.itemId
-      });
+    // 全屏
+    onFullscreenChange(this: any, e: WechatMiniprogram.VideoFullScreenChange) {
+      const { fullScreen } = e.detail || {};
+      this.triggerEvent("fullscreenchange", { fullScreen });
     },
-
-    // 视频播放错误
-    onVideoError(this: IComponentInstance, e: any) {
-      const { index } = e.currentTarget.dataset;
-      this.triggerEvent('videoerror', {
-        index: index,
-        item: this.data.mediaList[index],
-        itemId: this.properties.itemId
-      });
-    }
-  }
-}); 
+  },
+});

+ 12 - 28
miniprogram/components/media-carousel/media-carousel.wxml

@@ -1,39 +1,23 @@
 <!--components/media-carousel/media-carousel.wxml-->
 <view class="media-carousel">
-  <swiper 
-    class="carousel-swiper" 
-    indicator-dots="{{showIndicator}}" 
-    indicator-color="{{indicatorColor}}" 
-    indicator-active-color="{{indicatorActiveColor}}"
-    autoplay="{{autoplay}}" 
-    interval="{{interval}}" 
-    duration="{{duration}}"
-    circular="{{circular}}"
-  >
+  <swiper class="carousel-swiper" indicator-dots="{{showIndicator}}" indicator-color="{{indicatorColor}}" indicator-active-color="{{indicatorActiveColor}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="{{circular}}">
     <swiper-item wx:for="{{mediaList}}" wx:key="index" class="carousel-item">
       <!-- 图片轮播 -->
-      <view wx:if="{{item.type === 'image'}}" class="image-container">
-        <image
-          src="{{item.src}}" 
-          mode="aspectFit"
-          class="carousel-image"
-          bind:load="onImageLoad"
-          bind:error="onImageError"
-          data-index="{{index}}"
-        />
-        <view wx:if="{{item.title}}" class="image-title">{{item.title}}</view>
+      <view wx:if="{{item.type === 'image' && item.src}}" class="image-container">
+        <image src="{{item.src}}" mode="aspectFit" class="carousel-image" />
       </view>
-      
+
       <!-- 视频轮播 -->
-      <view wx:if="{{item.type === 'video'}}" class="video-container">
+      <view wx:if="{{item.type === 'video' && item.src}}" class="video-container">
         <video 
           src="{{item.src}}" 
-          class="carousel-video"
-          bind:error="onVideoError"
-          data-index="{{index}}"
-        />
-        <view wx:if="{{item.title}}" class="video-title">{{item.title}}</view>
+          class="carousel-video" 
+          controls="{{true}}" 
+          object-fit="contain"
+          bindfullscreenchange="onFullscreenChange"
+        >
+        </video>
       </view>
     </swiper-item>
   </swiper>
-</view> 
+</view>

+ 1 - 0
miniprogram/components/popup-privacy/popup-privacy.ts

@@ -43,6 +43,7 @@ Component({
   properties: {
     pre: { type: Boolean, value: false },
     show: { type: Boolean, value: false },
+    overlay: { type: Boolean, value: true },
   },
   data: {
     visible: false,

+ 1 - 1
miniprogram/components/popup-privacy/popup-privacy.wxml

@@ -1,5 +1,5 @@
 <!--components/popup-privacy/popup-privacy.wxml-->
-<t-popup placement="bottom" show-overlay="{{true}}" visible="{{visible}}">
+<t-popup placement="bottom" show-overlay="{{overlay}}" visible="{{visible}}">
   <view class="popup">
     <view class="popup__header">{{title}}</view>
     <view class="popup__content">

+ 10 - 0
miniprogram/components/popup-user-auth/popup-user-auth.json

@@ -0,0 +1,10 @@
+{
+  "component": true,
+  "usingComponents": {
+    "t-cell": "tdesign-miniprogram/cell/cell",
+    "t-loading": "tdesign-miniprogram/loading/loading",
+    "t-radio": "tdesign-miniprogram/radio/radio",
+    "t-popup": "tdesign-miniprogram/popup/popup",
+    "form-button": "../button/button"
+  }
+}

+ 86 - 0
miniprogram/components/popup-user-auth/popup-user-auth.scss

@@ -0,0 +1,86 @@
+/* components/popup-user-auth/popup-user-auth.wxss */
+@import "../../themes/t.scss";
+@import "../../themes/t.cell.scss";
+@import "../../themes/button.scss";
+
+.popup {
+  &__header {
+    padding: 12px;
+    font-size: 18px;
+    text-align: center;
+  }
+
+  &__content {
+    padding: 0 12px;
+  }
+}
+
+.user-auth-form {
+  .open-button {
+    position: relative;
+    font-size: 14px;
+
+    &__inner {
+      position: absolute;
+      top: 0;
+      bottom: 0;
+      left: var(--td-cell-horizontal-padding, 32rpx);
+      right: var(--td-cell-horizontal-padding, 32rpx);
+      opacity: 0;
+    }
+  }
+
+  .cell-field {
+    .t-cell__title {
+      flex: none;
+    }
+  }
+
+  .field-container {
+    display: flex;
+    align-items: center;
+    font-size: var(--td-cell-title-font-size,var(--td-font-size-m,32rpx));
+
+    text {
+      flex: none;
+      color: #666;
+    }
+
+    input {
+      min-width: calc(var(--td-cell-title-font-size,var(--td-font-size-m,32rpx)) * 6 * 0.6);
+      text-align: center;
+    }
+  }
+
+  .privacy-contract-wrapper {
+    --td-radio-icon-checked-color: #1D6FF6;
+    --td-radio-font-size: 12px;
+    --td-radio-icon-size: 20px;
+
+    .privacy-contract {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+    }
+
+    padding: 6px var(--td-cell-horizontal-padding, 32rpx);
+    font-size: 12px;
+
+    .name {
+      // color: var(--primary-color, #38FF6E);
+      color: #1D6FF6;
+    }
+
+    .no-border {
+      display: none;
+    }
+  }
+}
+
+.phone-cell {
+  color: black !important; // 使用 !important 确保优先级
+
+  .note-class {
+    color: black !important; // 确保 note 字体为黑色
+  }
+}

+ 123 - 0
miniprogram/components/popup-user-auth/popup-user-auth.ts

@@ -0,0 +1,123 @@
+// components/popup-user-auth/popup-user-auth.ts
+import { openPrivacyContract } from "../../lib/wx/open-api";
+import { login } from "../../lib/logic";
+import { usePhoneNumber } from "../../lib/use/use-phone";
+import { getSceneRegisterMethod, setSceneRegisterMethod } from "../../lib/request/common";
+let submitting = false;
+Component({
+  properties: {
+    visible: { type: Boolean, value: false },
+    overlay: { type: Boolean, value: true },
+    scene: { type: String, value: '' },
+    cardno: { type: String, value: '' },
+    phone: { type: String, value: '' },
+  },
+  data: {
+    title: '完善信息',
+    privacyContract: { agree: false, name: "《隐私政策》", show: false },
+
+    loading: false,
+    submitting: false,
+
+    cardnoProps: { prefix: '', suffix: '', fill: '', length: 0 },
+    phoneProps: { prefix: '', suffix: '', fill: '', length: 0 },
+  },
+  observers: {
+    cardno(value: string) {
+      if (!value) return;
+      const length = 18;
+      const tag = '*';
+      if (!value.includes(tag)) value = value.padEnd(length, tag);
+      const [_, prefix = '', fill = '', suffix = ''] = value.match(/(\d+)?(\*+)?(\d+)?/) || [];
+      this.setData({ cardnoProps: { prefix, suffix, fill: '', length: fill.length === length ? 0 : fill.length } });
+      if (this.data.cardnoProps.length) this.setData({ visible: true });
+    },
+    phone(value: string) {
+      if (!value) return;
+      const length = 11;
+      const tag = '*';
+      if (!value.includes(tag)) value = value.padEnd(length, tag);
+      const [_, prefix = '', fill = '', suffix = ''] = value.match(/(\d+)?(\*+)?(\d+)?/) || [];
+      this.setData({ phoneProps: { prefix, suffix, fill: '', length: fill.length === length ? 0 : fill.length } });
+      if (this.data.phoneProps.length) this.setData({ visible: true });
+    },
+    scene(value: string) { this.init(value); }
+  },
+  methods: {
+    async init(scene: string) {
+      if (!scene) return;
+      await login();
+      const data = await getSceneRegisterMethod(scene);
+      this.setData({ ...data });
+      this.triggerEvent('loaded', { visible: this.data.visible, scene });
+      if (data.patientId) this.register(data.patientId);
+    },
+    getPhoneNumberHandle(event: WechatMiniprogram.ButtonGetPhoneNumber) {
+      this.setData({ loading: true });
+      const { getPhoneNumber } = usePhoneNumber();
+      getPhoneNumber(event, (value) => {
+        this.setData({ "phoneProps.fill": value, loading: false })
+      })
+    },
+    openPrivacyContract: openPrivacyContract,
+    onPrivacySetting({ detail }: { detail: WechatMiniprogram.GetPrivacySettingSuccessCallbackResult; }) {
+      this.setData({
+        "privacyContract.name": detail.privacyContractName,
+        // 'privacyContract.agree': !detail.needAuthorization,
+      });
+    },
+    onAgreeChange(event: any) {
+      const agree = event?.detail?.checked;
+      if (agree) this.setData({ "privacyContract.show": true });
+      else this.setData({ "privacyContract.agree": agree });
+    },
+    onAgree() {
+      this.setData({ "privacyContract.agree": true });
+    },
+    onDisagree() {
+      this.setData({ "privacyContract.agree": false });
+    },
+    register(patientId: string) {
+      if (!patientId) return;
+      wx.setStorageSync("patientId", patientId);
+      this.setData({ 'visible': false });
+      this.triggerEvent('register', { patientId });
+    },
+    async onSubmit(event: WechatMiniprogram.FormSubmit) {
+      if (this.data.submitting || submitting) return;
+      submitting = true;
+      try {
+        const data = { agemust: this.data.privacyContract.agree ? 'Y' : 'N', phone: '' } as any;
+        if (data.agemust === "N") {
+          this.setData({ "privacyContract.show": true });
+          throw `请阅读并同意${this.data.privacyContract.name}`;
+        }
+
+        const phone = this.data.phoneProps;
+        if (phone.length && phone.fill.length !== phone.length) throw `手机号码请补充完整`;
+        else if (!phone.fill) throw `请获取手机号码`;
+        else data.phone = `${phone.prefix}${phone.fill}${phone.suffix}`;
+
+        const cardno = this.data.cardnoProps;
+        if (cardno.length && cardno.fill.length !== cardno.length) throw `身份证号请补充完整`;
+        else if (cardno.length) data.cardno = `${cardno.prefix}${cardno.fill}${cardno.suffix}`;
+
+        if (this.data.scene) data.scene = decodeURIComponent(this.data.scene);
+
+        this.setData({ "submitting": submitting });
+        const { patientId } = await setSceneRegisterMethod(data);
+        this.register(patientId);
+      } catch (error) {
+        if (typeof error === 'string') this.triggerEvent('message', { type: 'warning', content: error });
+        else if (error.errMsg) {
+          this.triggerEvent('message', { type: 'error', content: error.errMsg });
+          if (!this.data.phoneProps.length) this.setData({ "phoneProps.fill": '', loading: false });
+        }
+      }
+      setTimeout(() => {
+        submitting = false;
+        this.setData({ "submitting": submitting });
+      }, 100);
+    },
+  }
+})

+ 41 - 0
miniprogram/components/popup-user-auth/popup-user-auth.wxml

@@ -0,0 +1,41 @@
+<!--components/popup-user-auth/popup-user-auth.wxml-->
+<t-popup placement="bottom" show-overlay="{{overlay}}" visible="{{visible}}">
+  <view class="popup">
+    <view class="popup__header">{{title}}</view>
+    <view class="popup__content">
+      <form class="user-auth-form" bindsubmit="onSubmit">
+        <view wx:if="{{!phoneProps.length}}" class="open-button">
+          <t-cell t-class="cell-border-gradient phone-cell" t-class-note="note-class" required title="手机号" hover="{{!phoneProps.fill}}" note="{{loading ? '' : phoneProps.fill || '点击获取手机号码'}}">
+            <t-loading wx:if="{{loading}}" theme="spinner" size="24rpx" slot="note" />
+          </t-cell>
+          <button wx:if="{{!loading && !phoneProps.fill}}" class="open-button__inner" size="mini" open-type="getPhoneNumber" bind:getphonenumber="getPhoneNumberHandle">选择授权手机</button>
+        </view>
+        <label wx:else>
+          <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper" required title="手机号">
+            <view class="field-container" slot="note">
+              <text wx:if="{{phoneProps.prefix}}">{{ phoneProps.prefix }}</text>
+              <input name="phone" type="number" model:value="{{phoneProps.fill}}" maxlength="{{phoneProps.length}}" placeholder="请补充" placeholder-style="color:#F76260" confirm-type="next" />
+              <text wx:if="{{phoneProps.suffix}}">{{ phoneProps.suffix }}</text>
+            </view>
+          </t-cell>
+        </label>
+        <label wx:if="{{cardnoProps.length}}">
+          <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper" required title="身份证号">
+            <view class="field-container" slot="note">
+              <text wx:if="{{cardnoProps.prefix}}">{{ cardnoProps.prefix }}</text>
+              <input name="cardno" type="idcard" model:value="{{cardnoProps.fill}}" maxlength="{{cardnoProps.length}}" placeholder="请补充" placeholder-style="color:#F76260" confirm-type="next" />
+              <text wx:if="{{cardnoProps.suffix}}">{{ cardnoProps.suffix }}</text>
+            </view>
+          </t-cell>
+        </label>
+        <view class="privacy-contract-wrapper">
+          <t-radio t-class="privacy-contract" t-class-border="no-border" icon="circle" block="{{false}}" checked="{{privacyContract.agree}}" bind:change="onAgreeChange">
+            <text slot="content" style="font-size: 14px;">我已阅读与同意 <text class="name" catch:tap="openPrivacyContract">{{privacyContract.name}}</text></text>
+          </t-radio>
+        </view>
+        <form-button block index="1" loading="{{submitting}}" disableOnClick="{{false}}">提交</form-button>
+      </form>
+    </view>
+  </view>
+</t-popup>
+<popup-privacy show="{{privacyContract.show}}" overlay="{{false}}" bind:setting="onPrivacySetting" bind:agree="onAgree" bind:disagree="onDisagree" />

+ 19 - 0
miniprogram/lib/request/common.ts

@@ -0,0 +1,19 @@
+import { Get } from "./method";
+
+// 获取扫码注册参数
+export function getSceneRegisterMethod(scene: string) {
+  const params = { scene: decodeURIComponent(scene) };
+  const transform = ({ data }: AnyObject) => {
+    const { cardno, phone, patientId } = data;
+    return { cardno, phone, patientId, visible: !patientId }
+  }
+  return Get(`/patientInfoManage/getCardnoPhoneMantissaByScene`, { params, transform }).catch(() => ({ visible: false }));
+}
+
+// 扫码注册
+export function setSceneRegisterMethod(params: { scene: string; phone: string; cardno?: string }) {
+  const transform = ({ data }: AnyObject) => {
+    return { patientId: data }
+  }
+  return Get(`/patientInfoManage/scanAuth`, { params, transform })
+}

+ 5 - 16
miniprogram/module/article/pages/order-detail/order-detail.ts

@@ -48,7 +48,6 @@ Page({
   },
   // 订单支付
   async payment() {
-    // 节流控制:如果正在处理中,直接返回
     if (this.data.isPaymentLoading) {
       return;
     }
@@ -56,23 +55,20 @@ Page({
     this.setData({ isPaymentLoading: true });
 
     try {
-      const res = await orderPayMethod(this.data.id);
-      wx.navigateTo({
+      await orderPayMethod(this.data.id);
+      wx.redirectTo({
         url: "/module/article/pages/success-page/success-page?title=订单支付成功",
       });
     } catch (error: any) {
-      // getTickleContext.call(this).showWarnMessage(error.errMsg);
       wx.showToast({
         title: error.errMsg,
         icon: "none",
       });
     } finally {
-      // 无论成功还是失败,都要重置loading状态
       this.setData({ isPaymentLoading: false });
     }
   },
   statusType(status: any) {
-    // 规范化后端返回:将 null/undefined 转为空字符串,其它转换为字符串
     const code = status == null ? "" : String(status);
     switch (code) {
       case "0":
@@ -88,7 +84,6 @@ Page({
         this.setData({ orderStatus: "completed" });
         break;
       default:
-        // 未知或空状态,重置为安全空串,避免默认展示为待付款
         this.setData({ orderStatus: "" });
         break;
     }
@@ -137,7 +132,6 @@ Page({
         this.setData({ totalPrice });
       }
     } catch (error: any) {
-      // getTickleContext.call(this).showWarnMessage(error.errMsg);
       wx.showToast({
         title: error.errMsg,
         icon: "none",
@@ -149,9 +143,7 @@ Page({
     this.setData({ showConfirm: false });
   },
   async confirmDialog() {
-    // 点击确定取消订单按钮
     const that = this;
-    /* 取消订单逻辑 */
     wx.showModal({
       title: "提示",
       content: "确认取消该订单吗?",
@@ -166,13 +158,11 @@ Page({
   async cancelOrdering() {
     try {
       await orderCancelMethod(this.data.id);
-      /* 取消订单逻辑 */
       this.setData({ showConfirm: false });
       wx.navigateTo({
         url: "/module/article/pages/success-page/success-page?title=订单取消成功",
       });
     } catch (error: any) {
-      // getTickleContext.call(this).showWarnMessage(error.errMsg);
       wx.showToast({
         title: error.errMsg,
         icon: "none",
@@ -181,7 +171,6 @@ Page({
   },
   // 取消订单
   async cancelOrder() {
-    // 确定弹窗出现
     this.setData({ showConfirm: true });
   },
   // 查看物流
@@ -195,7 +184,6 @@ Page({
   },
   // 确认收货
   async confirmReceipt() {
-    // 节流控制
     if (this.data.isConfirmLoading) {
       return;
     }
@@ -234,7 +222,6 @@ Page({
       //   url: "/module/article/pages/confirm-receiving/confirm-receiving",
       // });
     } catch (error: any) {
-      // getTickleContext.call(this).showWarnMessage(error.errMsg);
       wx.showToast({
         title: error.errMsg,
         icon: "none",
@@ -242,6 +229,8 @@ Page({
     }
   },
   onShow() {
-    this.load(this.data.id);
+    if(this.data.id){ 
+      this.load(this.data.id);
+    }
   },
 });

+ 7 - 0
miniprogram/module/article/pages/order-list/order-list.ts

@@ -289,4 +289,11 @@ Page({
       url: `/module/article/pages/order-detail/order-detail?id=${id}`,
     });
   },
+  //回到我的页面
+goMine() {
+  console.log("goMine");
+  wx.redirectTo({
+    url: "/pages/mine/mine",
+  });
+}
 });

+ 1 - 1
miniprogram/module/article/pages/order-list/order-list.wxml

@@ -1,5 +1,5 @@
 <!--module/diet/pages/delivery-address/delivery-address.wxml-->
-<t-navbar title="我的订单" left-arrow />
+<t-navbar title="我的订单" left-arrow bindtap="goMine" />
 <t-tabs value="{{currentTab}}" bindchange="onTabChange">
   <t-tab-panel label="全部" value="all" />
   <t-tab-panel label="待付款" value="pending" />

+ 1 - 3
miniprogram/module/chats/pages/analysis/analysis.json → miniprogram/module/chats/components/guide-analysis/guide-analysis.json

@@ -1,9 +1,7 @@
 {
-  "renderer": "skyline",
   "component": true,
-  "pureDataPattern": "^_",
   "usingComponents": {
-    "t-navbar": "/components/navigation-bar/navigation-bar",
+    "t-popup": "tdesign-miniprogram/popup/popup",
     "t-cell": "/miniprogram_npm/tdesign-miniprogram/cell/cell",
     "t-icon": "/miniprogram_npm/tdesign-miniprogram/icon/icon",
     "t-loading": "/miniprogram_npm/tdesign-miniprogram/loading/loading",

+ 46 - 3
miniprogram/module/chats/pages/analysis/analysis.scss → miniprogram/module/chats/components/guide-analysis/guide-analysis.scss

@@ -1,10 +1,53 @@
+/* module/chats/components/guide-analysis/guide-analysis.wxss */
 @import '../../../../themes/page.scss';
 
-/* module/chats/pages/analysis/analysis.wxss */
-.page-scroll__container {
-  flex: 0 1 auto;
+.guide-analysis {
+  display: flex;
+  flex-direction: column;
+  width: 100vw;
   height: var(--page-container-safeHeight, 100vh);
+  background: var(--td-bg-color-container);
+  border-top-left-radius: 0;
+  border-top-right-radius: 0;
+
+  .header-container {
+    flex: none;
+  }
+
+  .content-container {
+    flex: auto;
+  }
+}
+
+.header-container {
+  display: flex;
+  align-items: center;
+  height: 116rpx;
+
+  .title {
+    flex: 1;
+    text-align: center;
+    font-weight: 600;
+    font-size: 36rpx;
+    color: var(--td-text-color-primary);
+  }
 
+  .btn {
+    font-size: 32rpx;
+    padding: 32rpx;
+  }
+
+  .btn--cancel {
+    color: var(--td-text-color-secondary);
+  }
+
+  .btn--confirm {
+    color: #0052d9;
+  }
+}
+
+.page-scroll__container {
+  flex: 0 1 auto;
   padding-top: 12px;
   background-color: #F5F6F7;
 }

+ 114 - 0
miniprogram/module/chats/components/guide-analysis/guide-analysis.ts

@@ -0,0 +1,114 @@
+// module/chats/components/guide-analysis/guide-analysis.ts
+import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
+import { upload } from "../../../../lib/request/upload";
+Component({
+  behaviors: [PageContainerBehavior],
+  properties: {
+    visible: { type: Boolean, value: false },
+  },
+  data: {
+    uploadList: [
+      {
+        target: "tongueImgUrl",
+        required: true,
+        label: "舌面图",
+        src: "../../assets/tongue-1.png",
+      },
+      {
+        target: "tongueBackImgUrl",
+        required: true,
+        label: "舌下图",
+        src: "../../assets/tongue-2.png",
+      },
+      {
+        target: "faceImgUrl",
+        required: false,
+        label: "正面面部图",
+        src: "../../assets/face-1.png",
+      },
+    ],
+    thumbnail: [] as string[],
+    original: [] as string[],
+
+    _queue: {} as AnyObject,
+  },
+  methods: {
+    handle(event: WechatMiniprogram.TouchEvent) {
+      const { handle, index } = event.mark as AnyObject;
+      switch (handle) {
+        case "preview":
+          break;
+        case "upload":
+          this._chooseMedia(index).then((src) => src && this._uploadMedia(index, src));
+          break;
+        case "upload:delete":
+          this._deleteMedia(index);
+          break;
+      }
+    },
+    _chooseMedia(index: number) {
+      return wx.chooseMedia({
+        count: 1,
+        mediaType: ["image"],
+        sourceType: ["album", "camera"],
+        camera: "front",
+      }).then((res) => {
+        const src = res.tempFiles[0].tempFilePath;
+        this.setData({ [`thumbnail.${index}`]: src });
+        return src;
+      }).catch(() => null);
+    },
+    _deleteMedia(index: number) {
+      this.setData({
+        [`thumbnail.${index}`]: "",
+        [`original.${index}`]: "",
+      });
+    },
+    _uploadMedia(index: number, src?: string) {
+      this.setData({ [`_queue.${index}`]: true });
+      src ??= this.data.thumbnail[index];
+      upload({
+        params: { name: "file", file: src! },
+        transform({ data }) {
+          return (<any>data).url;
+        },
+      }).then(
+        (src) => {
+          this.setData({ [`original.${index}`]: src });
+        },
+        (error) => {
+          wx.showToast({ title: error?.errMsg ?? "上传失败", icon: "error" });
+          this.setData({
+            [`thumbnail.${index}`]: "",
+            [`original.${index}`]: "",
+          });
+        }
+      ).then(() => {
+        this.setData({ [`_queue.${index}`]: false });
+      });
+    },
+    onCancel() {
+      this.triggerEvent('stop');
+    },
+    onSubmit() {
+      const data = {
+        thumbnail: [] as any,
+        source: [] as any,
+      };
+      for (let index = 0; index < this.data.uploadList.length; index++) {
+        const item = this.data.uploadList[index];
+        if (this.data._queue[index]) return wx.showToast({ title: `请等待图片上传完毕`, icon: 'none' });
+        if (item.required && !this.data.original[index]) return wx.showToast({ title: `请上传${item.label}`, icon: 'none' });
+        if (this.data.original[index]) data.source.push({
+          target: item.target,
+          src: this.data.original[index],
+        });
+        if (this.data.thumbnail[index]) data.thumbnail.push({
+          target: item.target,
+          src: this.data.thumbnail[index],
+        });
+      }
+      this.triggerEvent('stop', data);
+    }
+  },
+})

+ 50 - 0
miniprogram/module/chats/components/guide-analysis/guide-analysis.wxml

@@ -0,0 +1,50 @@
+<!--module/chats/components/guide-analysis/guide-analysis.wxml-->
+<t-popup visible="{{visible}}" t-class="wrapper" usingCustomNavbar bind:visible-change="onVisibleChange" placement="bottom">
+  <view class="guide-analysis" style="{{containerStyle}}">
+    <view class="header-container">
+      <view class="btn btn--cancel" aria-role="button" bind:tap="onCancel">取消</view>
+      <view class="title">舌面象上传</view>
+      <view class="btn btn--confirm" aria-role="button" bind:tap="onSubmit">提交</view>
+    </view>
+    <scroll-view class="content-container page-scroll__container" type="list" scroll-y>
+      <t-cell title="拍摄注意事项" required bordered="{{false}}">
+        <view slot="description">
+          <view style="margin: 8px 0px 8px 0px;color:black;">光线:</view>
+          <view>白天充足、柔和的自然光线下效果最佳,避免背光、偏暗、曝光。</view>
+          <view style="margin: 8px 0px 8px 0px;color:black;">禁忌:</view>
+          <view>不要在食用有色饮食或药物后、有色光源下、早晨起床时、饭后半小时内拍摄舌象。</view>
+          <view>不要带妆拍摄面部图片。</view>
+        </view>
+      </t-cell>
+      <view class="upload-card" wx:for="{{uploadList}}" wx:key="{{item.target}}" mark:index="{{index}}" mark:target="{{item.target}}" bind:tap="handle">
+        <view class="upload-card__header">
+          <text>{{item.label}}上传</text>
+          <text wx:if="{{item.required}}" style="color: #D54941;">(必传)</text>
+        </view>
+        <view class="upload-card__content">
+          <view class="row">
+            <image class="col example" mark:handle="preview" src="{{item.src}}" mode="aspectFit" />
+            <image wx:if="{{thumbnail[index]}}" class="col picture" mark:handle="preview:thumbnail" src="{{thumbnail[index]}}" mode="aspectFit"></image>
+            <!-- <image wx:elif="{{original[index]}}" class="col picture" mark:handle="preview:original" src="{{original[index]}}" mode="aspectFit"></image> -->
+            <image wx:else class="col picture" mark:handle="upload" src="../../assets/upload-picture.bg.png" mode="aspectFit" />
+          </view>
+          <view class="row">
+            <view class="col">示例</view>
+            <view class="col">
+              <text>(上传)</text>
+              <block wx:if="{{thumbnail[index]}}">
+                <t-icon wx:if="{{original[index]}}" style="color: #D54941;" name="delete-1" mark:handle="upload:delete" />
+                <t-loading wx:else="" theme="spinner" size="40rpx" class="wrapper" />
+              </block>
+            </view>
+          </view>
+        </view>
+      </view>
+
+
+      <form bind:submit="onSubmit">
+        <form-button block index="1" loading="{{submitting}}" disableOnClick="{{false}}">提交</form-button>
+      </form>
+    </scroll-view>
+  </view>
+</t-popup>

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

@@ -5,6 +5,7 @@
   "usingComponents": {
     "t-cell": "tdesign-miniprogram/cell/cell",
     "t-loading": "tdesign-miniprogram/loading/loading",
+    "analysis": "../guide-analysis/guide-analysis",
     "user-avatar": "../../../../components/user-avatar/user-avatar"
   }
 }

+ 46 - 12
miniprogram/module/chats/components/message-analysis/message-analysis.ts

@@ -1,3 +1,5 @@
+import { Post } from "../../../../lib/request/method";
+
 interface Gallery {
   label?: string;
   src: string;
@@ -24,6 +26,7 @@ Component({
   },
   data: {
     isAnalysis: 0,
+    start: false,
     examples: [
       { label: '舌面举例', src: '../../assets/tongue-1.png' },
       { label: '舌下举例', src: '../../assets/tongue-2.png' },
@@ -31,28 +34,59 @@ Component({
     ] as Gallery[],
     source: [] as Gallery[],
   },
-attached(){
-  this.setData({
-    isAnalysis: wx.getStorageSync("isAnalysis"),
-  });
-  
-},
+  attached() {
+    this.setData({
+      isAnalysis: wx.getStorageSync("isAnalysis"),
+    });
+  },
   /**
    * 组件的方法列表
    */
   methods: {
     onConfirm() {
       if (this.data.source.length) return;
-      wx.navigateTo({
-        url: '/module/chats/pages/analysis/analysis?messageType=' + this.data.messageType,
-        events: { update: (data: Result) => this._update(data) }
-      });
+      this.setData({ start: true });
+      // wx.navigateTo({
+      //   url: '/module/chats/pages/analysis/analysis?messageType=' + this.data.messageType,
+      //   events: { update: (data: Result) => this._update(data) }
+      // });
     },
     onCancel() {
       this.triggerEvent('next', defaultGallery);
     },
-
-    _update({source, thumbnail}:Result) {
+    async onUpdate(event) {
+      this.setData({ start: false });
+      if (event.detail) {
+        await this._followUp(event.detail);
+        this._update(event.detail);
+      }
+    },
+    // 提交随访提醒
+    async _followUp({ source, thumbnail }: Result) {
+      const data = {} as AnyObject;
+      for (const item of source) { data[item.target] = item.src; }
+      if (this.data.messageType === 2 && this.data.isAnalysis === 2) {
+        wx.showLoading({ title: '提交中', mask: true });
+        try {
+          const workId = wx.getStorageSync("workId") || 0;
+          const followObj = wx.getStorageSync("followObj");
+          const res = await Post(
+            `/followupTaskManage/updateFollowupTaskFillin/${workId}`,
+            { ...followObj, upImg: data.tongueImgUrl, downImg: data.tongueBackImgUrl, faceImg: data.faceImgUrl },
+            { transform({ data }: any) { return data; }, }
+          );
+          // 存储舌面象分析报告id,用于跳转页面时最后产生结果查看
+          wx.setStorageSync("tonguefaceAnalysisReportId", res.tonguefaceAnalysisReportId);
+          wx.hideLoading();
+        } catch (error) {
+          wx.hideLoading();
+          wx.showToast({ title: error?.errMsg ?? '提交失败', icon: 'none', duration: 3000 });
+          this.setData({ start: true });
+          throw error;
+        }
+      }
+    },
+    _update({ source, thumbnail }: Result) {
       this.setData({ source: thumbnail });
       const data = {} as AnyObject;
       for (const item of source) { data[item.target] = item.src; }

+ 3 - 1
miniprogram/module/chats/components/message-analysis/message-analysis.wxml

@@ -38,4 +38,6 @@
     </view>
   </view>
   <t-loading wx:if="{{active && isAnalysis===3}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
-</view>
+</view>
+
+<analysis visible="{{start}}" bind:stop="onUpdate"></analysis>

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

@@ -1,229 +0,0 @@
-import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
-import { upload } from "../../../../lib/request/upload";
-import { Post } from "../../../../lib/request/method";
-
-// module/chats/pages/analysis/analysis.ts
-
-interface IAnalysisData {
-  _lastResetTime: number;
-  uploadList: Array<{
-    target: string;
-    required: boolean;
-    label: string;
-    src: string;
-  }>;
-  thumbnail: string[];
-  original: string[];
-  status: boolean[];
-  _queue: Record<string, any>;
-  activeObj: Record<string, any>;
-  followObj: Record<string, any>;
-  workId: number;
-}
-
-interface IAnalysisProperties {
-  messageType: number;
-}
-
-type IAnalysisInstance = WechatMiniprogram.Component.Instance<
-  IAnalysisData,
-  IAnalysisProperties,
-  {
-    handle(event: WechatMiniprogram.TouchEvent): void;
-    _chooseMedia(index: number): Promise<string | null>;
-    _deleteMedia(index: number): void;
-    _uploadMedia(index: number, src?: string): void;
-    onSubmit(): Promise<void>;
-  }
->;
-
-Component({
-  behaviors: [PageContainerBehavior],
-  options: {},
-  properties: {
-    messageType: { type: Number, value: 0 },
-  },
-  data: {
-    _lastResetTime: 0,
-    uploadList: [
-      {
-        target: "tongueImgUrl",
-        required: true,
-        label: "舌面图",
-        src: "../../assets/tongue-1.png",
-      },
-      {
-        target: "tongueBackImgUrl",
-        required: true,
-        label: "舌下图",
-        src: "../../assets/tongue-2.png",
-      },
-      {
-        target: "faceImgUrl",
-        required: false,
-        label: "正面面部图",
-        src: "../../assets/face-1.png",
-      },
-    ],
-    thumbnail: [] as string[],
-    original: [] as string[],
-    status: [false, false, false],
-    _queue: {} as AnyObject,
-    // 随访上传参数
-    activeObj: {},
-    followObj: {},
-    workId: 0,
-    _submitting: false,
-  },
-  attached() {
-    // 从存储中拿到之前的对话信息
-    this.setData({
-      followObj: wx.getStorageSync("followObj"),
-      workId: wx.getStorageSync("workId"),
-    });
-  },
-  methods: {
-    handle(event: WechatMiniprogram.TouchEvent) {
-      const { handle, index } = event.mark as AnyObject;
-      switch (handle) {
-        case "preview":
-          break;
-        case "upload":
-          this._chooseMedia(index).then(
-            (src) => src && this._uploadMedia(index, src)
-          );
-          break;
-        case "upload:delete":
-          this._deleteMedia(index);
-          break;
-      }
-    },
-    _chooseMedia(index: number) {
-      return wx
-        .chooseMedia({
-          count: 1,
-          mediaType: ["image"],
-          sourceType: ["album", "camera"],
-          camera: "front",
-        })
-        .then((res) => {
-          const src = res.tempFiles[0].tempFilePath;
-          this.setData({ [`thumbnail.${index}`]: src });
-          return src;
-        })
-        .catch(() => null);
-    },
-    _deleteMedia(index: number) {
-      this.setData({
-        [`thumbnail.${index}`]: "",
-        [`original.${index}`]: "",
-      });
-    },
-    _uploadMedia(index: number, src?: string) {
-      this.setData({ [`_queue.${index}`]: true });
-      src ??= this.data.thumbnail[index];
-      upload({
-        params: { name: "file", file: src! },
-        transform({ data }) {
-          return (<any>data).url;
-        },
-      })
-        .then(
-          (src) => {
-            this.setData({ [`original.${index}`]: src });
-          },
-          (error) => {
-            wx.showToast({ title: error?.errMsg ?? "上传失败", icon: "error" });
-            this.setData({
-              [`thumbnail.${index}`]: "",
-              [`original.${index}`]: "",
-            });
-          }
-        )
-        .then(() => {
-          this.setData({ [`_queue.${index}`]: false });
-        });
-    },
-    async onSubmit() {
-      const submitBtn = this.selectComponent('#submitBtn');
-      if (this.data._submitting) return;
-      this.setData({ _submitting: true });
-      const data = {
-        thumbnail: [] as any,
-        source: [] as any,
-      };
-      for (let index = 0; index < this.data.uploadList.length; index++) {
-        const item = this.data.uploadList[index];
-        if (this.data._queue[index]) {
-          console.log('[Analysis] Upload in progress, resetting button');
-          wx.showToast({ title: `请等待图片上传完毕`, icon: "none" });
-          submitBtn?.resetState();
-          this.setData({ _submitting: false });
-          return;
-        } else if (item.required && !this.data.original[index]) {
-          console.log('[Analysis] Missing required image, resetting button');
-          wx.showToast({ title: `请上传${item.label}`, icon: "none" });
-          submitBtn?.resetState();
-          this.setData({ _submitting: false });
-          return;
-        }
-        if (this.data.original[index])
-          data.source.push({
-            target: item.target,
-            src: this.data.original[index],
-          });
-        if (this.data.thumbnail[index])
-          data.thumbnail.push({
-            target: item.target,
-            src: this.data.thumbnail[index],
-          });
-      }
-      let imageObj: any = {
-        upImg: this.data.original[0],
-        downImg: this.data.original[1],
-        faceImg: this.data.original[2],
-      };
-      
-      // console.log(this.data.followObj, "this.data.followObj");
-      this.setData({
-        activeObj: { ...imageObj, ...this.data.followObj },
-      });
-      // console.log({ ...this.data.activeObj }, "activeObj");
-      let isAnalysis: number;
-      if (this.data.messageType === 2) {
-        isAnalysis = wx.getStorageSync("isAnalysis");
-      }
-      // console.log(this.data, "messageType", isAnalysis);
-      if (isAnalysis === 2) {
-        // 提交随访提醒
-        try {
-          const res = await Post(
-            `/followupTaskManage/updateFollowupTaskFillin/${this.data?.workId}`,
-            { ...this.data.activeObj },
-            {
-              transform({ data }: any) {
-                return data;
-              },
-            }
-          );
-          // 存储舌面象分析报告id,用于跳转页面时最后产生结果查看
-          wx.setStorageSync(
-            "tonguefaceAnalysisReportId",
-            res.tonguefaceAnalysisReportId
-          );
-          this.getOpenerEventChannel().emit("update", data);
-          wx.navigateBack();
-        } catch (error) {
-          console.log('[Analysis] Submit failed, resetting button');
-          wx.showToast({ title: error?.errMsg ?? "提交失败", icon: "none" });
-          submitBtn?.resetState();
-          this.setData({ _submitting: false });
-        }
-      } else {
-        // 对话管家
-        this.getOpenerEventChannel().emit("update", data);
-        wx.navigateBack();
-      }
-    },
-  },
-});

+ 0 - 42
miniprogram/module/chats/pages/analysis/analysis.wxml

@@ -1,42 +0,0 @@
-<!--module/chats/pages/analysis/analysis.wxml-->
-<t-navbar title="舌面象上传" left-arrow />
-<scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
-  <t-cell title="拍摄注意事项" required bordered="{{false}}">
-    <view slot="description">
-      <view style="margin: 8px 0px 8px 0px;color:black;">光线:</view>
-      <view>白天充足、柔和的自然光线下效果最佳,避免背光、偏暗、曝光。</view>
-      <view style="margin: 8px 0px 8px 0px;color:black;">禁忌:</view>
-      <view>不要在食用有色饮食或药物后、有色光源下、早晨起床时、饭后半小时内拍摄舌象。</view>
-      <view>不要带妆拍摄面部图片。</view>
-    </view>
-  </t-cell>
-  <view class="upload-card" wx:for="{{uploadList}}" wx:key="{{item.target}}" mark:index="{{index}}" mark:target="{{item.target}}" bind:tap="handle">
-    <view class="upload-card__header">
-      <text>{{item.label}}上传</text>
-      <text wx:if="{{item.required}}" style="color: #D54941;">(必传)</text>
-    </view>
-    <view class="upload-card__content">
-      <view class="row">
-        <image class="col example" mark:handle="preview" src="{{item.src}}" mode="aspectFit" />
-        <image wx:if="{{thumbnail[index]}}" class="col picture" mark:handle="preview:thumbnail" src="{{thumbnail[index]}}" mode="aspectFit"></image>
-        <!-- <image wx:elif="{{original[index]}}" class="col picture" mark:handle="preview:original" src="{{original[index]}}" mode="aspectFit"></image> -->
-        <image wx:else class="col picture" mark:handle="upload" src="../../assets/upload-picture.bg.png" mode="aspectFit" />
-      </view>
-      <view class="row">
-        <view class="col">示例</view>
-        <view class="col">
-          <text>(上传)</text>
-          <block wx:if="{{thumbnail[index]}}">
-            <t-icon wx:if="{{original[index]}}" style="color: #D54941;" name="delete-1" mark:handle="upload:delete" />
-            <t-loading wx:else="" theme="spinner" size="40rpx" class="wrapper" />
-          </block>
-        </view>
-      </view>
-    </view>
-  </view>
-
-
-  <form bind:submit="onSubmit">
-    <form-button block index="1" id="submitBtn"></form-button>
-  </form>
-</scroll-view>

+ 10 - 11
miniprogram/module/health/pages/analysis/analysis.ts

@@ -20,19 +20,14 @@ Page({
     switchType: "",
   },
   onLoad(query: any) {
-    this._load(query);
     if (query.scene) {
-      this.setData({
-        switchType: query.scene,
-      });
-    }
-    console.log(this.data.switchType,"query1111",query)
+      this.setData({ switchType: query.scene });
+      wx.showLoading({ title: "加载中" });
+    } else this._load(query);
   },
-
-  async _load(query: Record<'id' | 'scene', string>) {
-    console.log(query,"111");
-    
-    wx.showLoading({ title: '加载中' });
+  load(event: AnyObject) { this._load(event.detail, false); },
+  async _load(query: Record<'id' | 'scene', string>, loading = true) {
+    if (loading) wx.showLoading({ title: '加载中' });
     try {
       const { tongue, face, ...dataset } = await healthAnalysisMethod(query);
       this.setData({ tongue, face, dataset });
@@ -43,4 +38,8 @@ Page({
   },
 
   toHomePage() { toHomePage(this.data.switchType as string); },
+  openMessage(event: any) {
+    const message = event?.detail?.content;
+    if (message) getTickleContext.call(this).showMessage(event.detail.type || 'info', message);
+  }
 });

+ 2 - 1
miniprogram/module/health/pages/analysis/analysis.wxml

@@ -12,4 +12,5 @@
   <card-analysis-content tongue="{{tongue}}" face="{{face}}" exception></card-analysis-content>
 </scroll-view>
 </view>
-<t-message id="{{$messageId}}"></t-message>
+<t-message id="{{$messageId}}"></t-message>
+<popup-user-auth scene="{{switchType}}" bind:loaded="load" bind:message="openMessage"></popup-user-auth>

+ 11 - 11
miniprogram/module/health/pages/report/report.ts

@@ -20,19 +20,15 @@ Page({
     switchType: "",
   },
   onLoad(query: any) {
-    this._load(query).then((id: string) => {
-      if (id) this.getHealthIndex(id);
-    });
     if (query.scene) {
-      this.setData({
-        switchType: query.scene,
-      });
-    }
+      this.setData({ switchType: query.scene });
+      wx.showLoading({ title: "加载中" });
+    } else this._load(query);
   },
-
-  async _load(query: Record<"id" | "scene", string>) {
+  load(event: AnyObject) { this._load(event.detail, false); },
+  async _load(query: Record<"id" | "scene", string>, loading = true) {
     let id = "";
-    wx.showLoading({ title: "加载中" });
+    if (loading) wx.showLoading({ title: "加载中" });
     try {
       const { __origin__, ...dataset } = await healthReportMethod(query);
       id = dataset.id;
@@ -53,7 +49,7 @@ Page({
     }
     wx.hideLoading();
 
-    return id;
+    if (id) this.getHealthIndex(id);
   },
 
   async getHealthIndex(id?: string) {
@@ -78,4 +74,8 @@ Page({
   toSchemePage() {
     toSchemePage(this.data.schemeId);
   },
+  openMessage(event: any) {
+    const message = event?.detail?.content;
+    if (message) getTickleContext.call(this).showMessage(event.detail.type || 'info', message);
+  }
 });

+ 2 - 1
miniprogram/module/health/pages/report/report.wxml

@@ -92,4 +92,5 @@
     </report-health-index>
   </scroll-view>
 </view>
-<t-message id="{{$messageId}}"></t-message>
+<t-message id="{{$messageId}}"></t-message>
+<popup-user-auth scene="{{switchType}}" bind:loaded="load" bind:message="openMessage"></popup-user-auth>

+ 1 - 0
miniprogram/module/health/pages/scheme/scheme.json

@@ -5,6 +5,7 @@
   "usingComponents": {
     "t-cell": "tdesign-miniprogram/cell/cell",
     "t-icon": "tdesign-miniprogram/icon/icon",
+    "t-popup": "tdesign-miniprogram/popup/popup",
     "report-health-index": "../../components/report-health-index/report-health-index",
     "report-health-status": "../../components/report-health-status/report-health-status",
     "form-button": "../../../../components/button/button",

+ 52 - 0
miniprogram/module/health/pages/scheme/scheme.scss

@@ -148,4 +148,56 @@
   height: 33px;
   line-height: 33px;
   text-align: center;
+}
+
+.qr-code-popup {
+  width: 80vw;
+  max-width: 600rpx;
+  background: #fff;
+  border-radius: 16rpx;
+  overflow: hidden;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+
+  &__title {
+    width: 100%;
+    padding: 40rpx 0 20rpx;
+    text-align: center;
+    font-size: 32rpx;
+    font-weight: 600;
+    color: #333;
+  }
+
+  &__content {
+    width: 100%;
+    padding: 0 40rpx;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+
+  &__footer {
+    width: 100%;
+    padding: 30rpx 40rpx 40rpx;
+    display: flex;
+    justify-content: center;
+  }
+
+  &__btn {
+    width: 200rpx;
+    height: 80rpx;
+    line-height: 80rpx;
+    text-align: center;
+    background: #1d6ff6;
+    color: #fff;
+    border-radius: 8rpx;
+    font-size: 28rpx;
+  }
+}
+
+.qr-code-image {
+  width: 100%;
+  max-width: 500rpx;
+  height: 500rpx;
 }

+ 144 - 41
miniprogram/module/health/pages/scheme/scheme.ts

@@ -1,84 +1,187 @@
 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/scheme/scheme.ts
 import { healthSchemeMethod } from "../../request";
 import { toReportPage } from "../../router";
 Component({
-  behaviors: [
-    PageContainerBehavior,
-    TickleBehavior
-  ],
+  behaviors: [PageContainerBehavior, TickleBehavior],
   lifetimes: {
     attached() {
       this.getHealthScheme(this.data.id);
-    }
+    },
   },
   properties: {
-    id: { type: String, value: '' },
+    id: { type: String, value: "" },
   },
   data: {
     dataset: null,
-    schemeId: '',
-    healthIndex: { data: [], loading: false, message: '' },
+    schemeId: "",
+    healthIndex: { data: [], loading: false, message: "" },
+    showQrCodePopup: false,
+    qrCodeImageUrl: "",
   },
   observers: {},
   methods: {
     async getHealthScheme(id: string) {
-      wx.showLoading({ title: '加载中' });
+      wx.showLoading({ title: "加载中" });
       try {
         const dataset = await healthSchemeMethod(id);
-        console.log(dataset, '1-->');
 
         this.setData({ dataset });
       } catch (error) {
         console.log(error);
 
-        getTickleContext.call(this).showErrorMessage(error.errMsg || error.message, 0);
+        getTickleContext
+          .call(this)
+          .showErrorMessage(error.errMsg || error.message, 0);
       }
       wx.hideLoading();
     },
-    toReportPage() { toReportPage(this.data.id); },
+    toReportPage() {
+      toReportPage(this.data.id);
+    },
     // 去购买
     goBuy(this: any, e: any) {
       const item = e.currentTarget.dataset.item || {};
-      const type: string = (item.buyType || '').toLowerCase();
-      const appId: string = item.appId || item.appID || item.appid || '';
-      const miniPath: string = item.path || item.miniPath || '';
-      const url: string = item.buyUrl || '';
-console.log(item, 'item',type);
-      // 优先按显式类型判断
-      if (type === 'miniprogram' || (!!appId && !type)) {
-        wx.navigateToMiniProgram({
-          appId,
-          path: miniPath,
-          envVersion: 'release',
-          fail: (err) => {
-            getTickleContext.call(this).showWarnMessage(err.errMsg || '跳转小程序失败');
+      const type: string = (item.buyType || "").toLowerCase();
+      const url: string = item.buyUrl || "";
+      const shortImageUrl: string = item.shortImageUrl || "";
+      console.log(item, "item", type, url);
+      //  跳转小程序
+      if (type === "miniprogram") {
+        // 如果没有跳转链接,直接显示小程序码或提示错误
+        if (!url) {
+          if (shortImageUrl) {
+            this.setData({
+              showQrCodePopup: true,
+              qrCodeImageUrl: shortImageUrl,
+            });
+          } else {
+            getTickleContext.call(this).showWarnMessage("缺少小程序跳转参数");
           }
-        });
-        return;
-      }
+          return;
+        }
+
+        // 解析 miniprogram:// 格式的 URL
+        let parsedAppId = "";
+        let parsedPath = "";
+        const isMiniprogramUrl = url.startsWith("miniprogram://");
+
+        if (isMiniprogramUrl) {
+          // 解析 miniprogram://?appid=xxx&path=xxx 格式
+          try {
+            // 提取查询参数字符串(去掉 miniprogram://? 前缀)
+            const queryString = url.replace(/^miniprogram:\/\/(\?)?/, "");
+            // 解析查询参数
+            const params: Record<string, string> = {};
+            queryString.split("&").forEach((param) => {
+              const [key, value] = param.split("=");
+              if (key && value) {
+                params[key] = decodeURIComponent(value);
+              }
+            });
+            parsedAppId = params.appid || "";
+            parsedPath = params.path || "";
+          } catch (error) {
+            console.error("解析 miniprogram:// URL 失败:", error);
+          }
+        }
 
-      if (type === 'url' || (!!url && !type)) {
+        // 统一的错误处理函数:显示小程序码或错误提示
+        const showErrorOrQrCode = (errMsg?: string) => {
+          if (shortImageUrl) {
+            this.setData({
+              showQrCodePopup: true,
+              qrCodeImageUrl: shortImageUrl,
+            });
+          } else {
+            getTickleContext
+              .call(this)
+              .showWarnMessage(errMsg || "跳转小程序失败");
+          }
+        };
+
+        // 统一的跳转函数:使用 appId + path 方式跳转
+        const navigateWithAppIdAndPath = (appId: string, path: string) => {
+          wx.navigateToMiniProgram({
+            appId: appId,
+            path: path,
+            envVersion: "release",
+            fail: (pathErr) => {
+              if (
+                pathErr.errMsg.includes("navigateToMiniProgram:fail cancel")
+              ) {
+                console.log("用户取消appid小程序跳转");
+              } else {
+                showErrorOrQrCode(pathErr.errMsg);
+              }
+            },
+          });
+        };
+
+        // 如果是 miniprogram:// 格式,直接使用 appId + path 方式跳转
+        if (isMiniprogramUrl) {
+          if (parsedAppId && parsedPath) {
+            navigateWithAppIdAndPath(parsedAppId, parsedPath);
+          }
+        } else {
+          // 短链接格式,优先使用短链接方式跳转
+          wx.navigateToMiniProgram({
+            shortLink: url,
+            envVersion: "release",
+            fail: (err) => {
+              if (err.errMsg.includes("navigateToMiniProgram:fail cancel")) {
+                console.log("用户取消短链跳转");
+              } else {
+                // 短链接失败,尝试使用 appId + path 方式跳转
+                if (parsedAppId && parsedPath) {
+                  navigateWithAppIdAndPath(parsedAppId, parsedPath);
+                } else {
+                  // 没有 appId 和 path,直接显示弹窗或错误提示
+                  showErrorOrQrCode(err.errMsg || "跳转小程序失败");
+                }
+              }
+            },
+          });
+        }
+      } else if (type === "url") {
+        // h5链接
         if (!url) {
-          getTickleContext.call(this).showWarnMessage('无有效链接');
+          getTickleContext.call(this).showWarnMessage("无有效链接");
           return;
         }
         wx.navigateTo({
-          url: '/module/article/pages/science-info/science-info',
+          url: "/module/article/pages/science-info/science-info",
           success: (res) => {
-            res.eventChannel?.emit?.('load', { title: item.title || '详情', url });
+            res.eventChannel?.emit?.("load", {
+              title: item.title || "详情",
+              url,
+            });
           },
           fail: (err) => {
-            getTickleContext.call(this).showWarnMessage(err.errMsg || '打开页面失败');
-          }
+            getTickleContext
+              .call(this)
+              .showWarnMessage(err.errMsg || "打开页面失败");
+          },
         });
         return;
+      } else {
+        // 无法识别
+        getTickleContext.call(this).showWarnMessage("未识别的跳转类型");
       }
-
-      // 无法识别
-      getTickleContext.call(this).showWarnMessage('未识别的跳转类型');
-    }
-  }
-})
+    },
+    // 关闭小程序码弹窗
+    closeQrCodePopup(e?: any) {
+      // 如果 visible-change 事件触发且 visible 为 false,才关闭
+      if (e === undefined || !e.detail?.visible) {
+        this.setData({
+          showQrCodePopup: false,
+          qrCodeImageUrl: "",
+        });
+      }
+    },
+  },
+});

+ 25 - 2
miniprogram/module/health/pages/scheme/scheme.wxml

@@ -20,7 +20,7 @@
           <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>
+            <view class="buy-box" bindtap="goBuy" data-item="{{item}}" wx:if="{{item.buyType}}">去购买</view>
           </view>
           <horizontal-scrollable dataset="{{item.children}}"></horizontal-scrollable>
           <view class="scheme__description" wx:if="{{item.description}}">{{item.description}}</view>
@@ -44,4 +44,27 @@
     </view>
   </scroll-view>
 </view>
-<t-message id="{{$messageId}}"></t-message>
+<t-message id="{{$messageId}}"></t-message>
+
+<!-- 小程序码弹窗 -->
+<t-popup
+  visible="{{showQrCodePopup}}"
+  bind:visible-change="closeQrCodePopup"
+  placement="center"
+  close-on-overlay-click="{{true}}"
+>
+  <view class="qr-code-popup"   wx:if="{{qrCodeImageUrl}}">
+    <view class="qr-code-popup__title">请长按二维码</view>
+    <view class="qr-code-popup__content">
+      <image
+        src="{{qrCodeImageUrl}}"
+        mode="aspectFit"
+        class="qr-code-image"
+        show-menu-by-longpress="{{true}}"
+      ></image>
+    </view>
+    <view class="qr-code-popup__footer">
+      <view class="qr-code-popup__btn" bind:tap="closeQrCodePopup">关闭</view>
+    </view>
+  </view>
+</t-popup>

+ 1 - 0
miniprogram/module/health/request.ts

@@ -87,6 +87,7 @@ export function healthSchemeMethod(id: string) {
             return {
               buyUrl: item?.buyUrl || '',
               buyType: item?.buyType || '',
+              shortImageUrl: item?.miniprogram || '',
               title: item?.name || '',
               descriptions: item?.attrs?.map((attr: AnyArray, k: number) => {
                 return { ...attr, id: `description-${i}-${j}-${k}`, }

+ 2 - 1
miniprogram/pages/home/home.scss

@@ -32,7 +32,8 @@
   background-image: url("/assets/bg/bg_home.png");
   background-repeat: no-repeat;
   width: 100%;
-  height: 100vh;
+  // height: 90vh;
+  height: calc(100vh - 180rpx) !important;
   background-size: cover;
   background-position: center;
   position: relative;

+ 22 - 129
miniprogram/pages/home/home.ts

@@ -25,7 +25,7 @@ import {
   getCareList,
 } from "./request";
 import { toCertificationPage, toChats } from "./router";
-import { useLocation } from "../../lib/use/use-location";
+// import { useLocation } from "../../lib/use/use-location";
 
 Page({
   data: {
@@ -47,6 +47,7 @@ Page({
     allExpanded: false,
     fixedHeight: "370rpx",
     tabbarValue: "/pages/home/home",
+    tabbarHidden: false,
     pageHeight: "100vh", // 默认值
     popupList: [] as AnyArray,
     isShowPopup: false,
@@ -78,8 +79,6 @@ Page({
     carouselMediaList: [] as Array<{
       type: "image" | "video";
       src: string;
-      poster?: string;
-      title?: string;
     }>,
   },
   behaviors: [
@@ -97,16 +96,8 @@ Page({
 
     const res = await getCareList();
     if (res && res.length > 0) {
-      res.forEach((item: any, index: number) => {
+      res.forEach((item: any) => {
         item.carouselMediaList = [];
-
-        // 确保 item.id 存在且为数字类型
-        if (!item.id && item.id !== 0) {
-          item.id = index;
-        }
-
-        // 确保 id 是数字类型
-        item.id = Number(item.id);
         // 添加photo
         if (item.photo) {
           item.carouselMediaList.push({
@@ -130,31 +121,7 @@ Page({
             src: item.itemVideoFirst,
           });
         }
-
-        // 如果有轮播图内容,设置加载状态
-        if (item.carouselMediaList.length > 0) {
-          this.setData({
-            [`carouselLoading.${item.id}`]: true,
-          });
-
-          // 设置超时,防止一直显示加载中
-          setTimeout(() => {
-            // 检查是否还在加载状态,如果是则自动隐藏
-            const currentLoading = this.data.carouselLoading;
-            if (currentLoading && currentLoading[item.id]) {
-              this.setData({
-                [`carouselLoading.${item.id}`]: false,
-              });
-            }
-          }, 10000); // 10秒后自动隐藏加载状态
-        } else {
-          // 如果没有轮播图内容,确保不显示加载状态
-          this.setData({
-            [`carouselLoading.${item.id}`]: false,
-          });
-        }
       });
-
       // 先设置 careList
       this.setData({
         careList: res,
@@ -201,11 +168,6 @@ Page({
   async onShow() {
     wx.showShareMenu({ withShareTicket: true, menus }).then();
     await this.load();
-    console.log(
-      this.data.switchType,
-      "home.ts中的switchType",
-      this.data.patient
-    );
     // 如果是从一体机扫码进来的  有switchType值就直接跳转到注册页面
     if (
       this.data.switchType &&
@@ -385,7 +347,7 @@ Page({
         });
       }
     } else {
-      wx.navigateTo({ url: `${page}?id=${id}` });
+      wx.redirectTo({ url: `${page}?id=${id}` });
       // wx.navigateTo({ url: `/module/follow/pages/evaluation/report?id=${id}` });
     }
   },
@@ -400,9 +362,9 @@ Page({
       const { patient } = await getPatients(/*this.data.patientId*/);
       // if (!patient) await toCertificationPage();
       if (!patient) {
-        if (wx.getStorageSync("doctorId")) {
+        /*if (wx.getStorageSync("doctorId")) {
           toCertificationPage();
-        }
+        }*/
         this.setData({
           "healthReport.loading": false,
           isShowComplete: true,
@@ -427,11 +389,11 @@ Page({
 
     if (!this.data._loaded) {
       this.loadScienceList();
-      useLocation()
-        .then((location) => {
-          this.setData({ location });
-        })
-        .catch(() => {});
+      // useLocation()
+      //   .then((location) => {
+      //     this.setData({ location });
+      //   })
+      //   .catch(() => {});
       getSolarTerms()
         .then((solarTerms) => {
           this.setData({ solarTerms });
@@ -667,28 +629,9 @@ Page({
     });
     wx.setStorageSync("isAnalysis", 3);
   },
-  toHealthPage() {
-    wx.navigateTo({ url: `/module/health/pages/home/home` });
-  },
-  toDietTonicPage() {
-    wx.navigateTo({
-      url: `/module/article/pages/diet-list/diet-list?classify=tonic`,
-    });
-  },
-  toDietTeaPage() {
-    wx.navigateTo({
-      url: `/module/article/pages/diet-list/diet-list?classify=tea`,
-    });
-  },
   toSciencePage() {
     wx.navigateTo({ url: `/module/article/pages/science-list/science-list` });
   },
-  toSchemePage() {
-    const id = this.data.healthId;
-    if (id)
-      wx.navigateTo({ url: `/module/health/pages/scheme/scheme?id=${id}` });
-    else wx.showToast({ title: "暂无调理方案", icon: "none" });
-  },
   async toReportPage() {
     // const { patient } = await getPatients(/*this.data.patientId*/);
     if (!this.data.patient) await toCertificationPage();
@@ -753,36 +696,6 @@ Page({
     // 获取调养计划
     this.getCareLists();
   },
-  // 轮播图加载完成
-  onCarouselLoaded(e: any) {
-    const { itemId } = e.detail;
-    if (itemId) {
-      this.setData({
-        [`carouselLoading.${itemId}`]: false,
-      });
-    }
-  },
-  // 图片加载失败
-  onImageError(e: any) {
-    const { itemId } = e.detail;
-    // 图片加载失败时也要隐藏加载状态
-    if (itemId) {
-      this.setData({
-        [`carouselLoading.${itemId}`]: false,
-      });
-    }
-  },
-
-  // 视频播放错误
-  onVideoError(e: any) {
-    const { itemId } = e.detail;
-    // 视频播放错误时也要隐藏加载状态
-    if (itemId) {
-      this.setData({
-        [`carouselLoading.${itemId}`]: false,
-      });
-    }
-  },
   // 没有健康分析去做健康分析
   goHealthAnalyze() {
     wx.redirectTo({
@@ -825,21 +738,16 @@ Page({
     // 获取新数据
     const res = await getCareList();
     if (res && res.length > 0) {
-      // 处理新数据,但保持媒体加载状态
       res.forEach((item: any) => {
         // 查找对应的旧数据
         const oldItem = currentExpandedStates.find(
           (state) => state.id === item.id
         );
-
-        // 如果找到旧数据且媒体已加载,保持媒体状态
         if (oldItem && oldItem.carouselMediaList) {
           // 保持原有的媒体列表,避免重新加载
           item.carouselMediaList = oldItem.carouselMediaList;
         } else {
-          // 否则重新构建媒体列表
           item.carouselMediaList = [];
-
           // 添加photo
           if (item.photo) {
             item.carouselMediaList.push({
@@ -862,33 +770,7 @@ Page({
               src: item.itemVideoFirst,
             });
           }
-
-          // 如果有轮播图内容,设置加载状态
-          if (item.carouselMediaList.length > 0) {
-            this.setData({
-              [`carouselLoading.${item.id}`]: true,
-            });
-
-            // 设置超时,防止一直显示加载中
-            setTimeout(() => {
-              // 检查是否还在加载状态,如果是则自动隐藏
-              const currentLoading = this.data.carouselLoading;
-              if (currentLoading && currentLoading[item.id]) {
-                this.setData({
-                  [`carouselLoading.${item.id}`]: false,
-                });
-              }
-            }, 10000); // 10秒后自动隐藏加载状态
-          } else {
-            // 如果没有轮播图内容,确保不显示加载状态
-            this.setData({
-              [`carouselLoading.${item.id}`]: false,
-            });
-          }
         }
-
-        // 确保 id 是数字类型
-        item.id = Number(item.id);
       });
 
       // 更新 careList
@@ -922,4 +804,15 @@ Page({
       });
     }
   },
+
+  /**
+   * 轮播组件进入/退出全屏时,隐藏/显示底部 tabbar,防止遮挡视频进度条
+   */
+  onCarouselFullscreenChange(e: { detail?: { fullScreen?: boolean } }) {
+    console.log(e, "全屏模式");
+    const fullScreen = !!(e.detail?.fullScreen);
+    this.setData({
+      tabbarHidden: fullScreen,
+    });
+  },
 });

+ 9 - 8
miniprogram/pages/home/home.wxml

@@ -87,12 +87,13 @@
                 <view style="width: 60%;">
                   <!-- 轮播媒体容器 -->
                   <view class="carousel-container" wx:if="{{item.carouselMediaList && item.carouselMediaList.length > 0}}">
-                    <!-- 加载状态 -->
-                    <view wx:if="{{carouselLoading[item.id]}}" class="carousel-loading">
-                      <t-loading size="40rpx" text="加载中..." />
-                    </view>
                     <!-- 轮播组件 -->
-                    <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}}" />
+                    <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>
@@ -139,8 +140,8 @@
 </view>
 
 <!-- 将 tabbar 移到最外层 -->
-<view class="tabbar-container">
-  <tabbar tabbarValue="{{tabbarValue}}" patientId="{{patient.patientId}}"></tabbar>
+<view class="tabbar-container" wx:if="{{false}}">
+  <tabbar wx:if="{{!tabbarHidden}}" tabbarValue="{{tabbarValue}}" patientId="{{patient.patientId}}"></tabbar>
 </view>
 
 
@@ -220,7 +221,7 @@
     </sticky-section>
   </scroll-view>
 
-  <tabbar tabbarValue="{{tabbarValue}}" patientId="{{patient.patientId}}"></tabbar>
+  <tabbar tabbarValue="{{tabbarValue}}" patientId="{{patient.patientId}}" wx:if="{{!tabbarHidden}}"></tabbar>
 
   <t-popup visible="{{isShowPopup}}" usingCustomNavbar bind:visible-change="onVisibleChange" placement="center">
     <view class="popup-container">

+ 6 - 1
miniprogram/pages/home/request.ts

@@ -39,7 +39,12 @@ export function getPatients(id?: string) {
 
     return { patient, patients: data };
   };
-  return Post("/mobileAccountManage/getPatsByAid", {}, { transform });
+  return Post("/mobileAccountManage/getPatsByAid", {}, { transform }).then(res => {
+    const patientId = res.patient?.patientId;
+    if (patientId) wx.setStorageSync("patientId", patientId);
+    else wx.removeStorageSync("patientId");
+    return res;
+  });
 }
 
 export async function getPatientDescription(patient: {