张田田 пре 7 месеци
родитељ
комит
0fc1db4194

+ 14 - 7
miniprogram/components/button/button.ts

@@ -1,8 +1,14 @@
 // components/button/button.ts
 Component({
   behaviors: ["wx://form-field-button"],
+  observers: {
+    loading(this: any, val: boolean) {
+      // 当外部声明 loading 时,同步禁用状态
+      this.setData({ isDisabled: !!val });
+    }
+  },
   lifetimes: {
-    attached() {
+    attached(this: any) {
       console.log("[Button] attached, initializing...");
       const mode = this.data.block ? "block" : "line";
       const index = this.data.index;
@@ -22,6 +28,8 @@ Component({
     index: { type: Number, value: 1 },
     loading: { type: Boolean, value: false },
     text: { type: String, value: "" },
+    // 是否在点击后禁用按钮,避免重复提交
+    disableOnClick: { type: Boolean, value: true },
   },
   data: {
     list: [
@@ -47,7 +55,7 @@ Component({
     _lastResetTime: 0,
   },
   methods: {
-    handleSubmit() {
+    handleSubmit(this: any) {
       if (this.data.isDisabled) {
         return;
       }
@@ -60,22 +68,21 @@ Component({
         return;
       }
 
-      if (this.data.text === "2") {
-        this.setData({ isDisabled: false });
-      } else {
+      // 点击后可选地禁用按钮,防止重复提交;外部完成后请调用 resetState 或将 loading 置为 false
+      if (this.data.disableOnClick) {
         this.setData({ isDisabled: true });
       }
       this.triggerEvent("submit");
     },
 
-    resetState() {
+    resetState(this: any) {
       this.setData({
         isDisabled: false,
         _lastResetTime: Date.now(),
       });
     },
 
-    valFailure() {
+    valFailure(this: any) {
       // 处理失败逻辑
       if (this) this.setData({ isDisabled: true }); // 重置按钮状态
     },

+ 9 - 0
miniprogram/module/article/pages/diet-info/diet-info.scss

@@ -5,6 +5,15 @@
 .diet-box{
   background: #fff;
   border-radius: 12px;
+  /* 使用负外边距实现上浮,配合下方占位保持整体高度不变 */
+  margin-top: -30px;
+}
+
+.hero-placeholder {
+  height: 30px;
+  /* 顶部圆角放在占位元素上,形成整块卡片的上圆角 */
+  border-top-left-radius: 12px;
+  border-top-right-radius: 12px;
   margin-top: -30px;
 }
 .diet-title{

+ 2 - 1
miniprogram/module/article/pages/diet-info/diet-info.wxml

@@ -1,7 +1,8 @@
 <!--module/diet/pages/diet-info/diet-info.wxml-->
 <t-navbar title="{{title}}" left-arrow />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
-  <image wx:if="{{dataset.photo}}" src="{{dataset.photo}}" mode="widthFix" style="width: 100%;"></image>
+  <image src="{{dataset.photo || '/module/health/assets/image/pic_body@2x.png'}}" mode="aspectFill" style="width: 100%; height: 260px;"></image>
+  <view class="hero-placeholder"></view>
   <!-- <view class="list-wrapper">
     <view class="list-title">食谱介绍</view>
     <view class="box-wrapper">{{dataset.book}}</view>

+ 2 - 1
miniprogram/module/article/pages/foot-print/foot-print.json

@@ -2,6 +2,7 @@
   "renderer": "skyline",
   "component": true,
   "usingComponents": {
-    "t-image": "tdesign-miniprogram/image/image"
+    "t-image": "tdesign-miniprogram/image/image",
+    "t-empty": "tdesign-miniprogram/empty/empty"
   }
 }

+ 5 - 37
miniprogram/module/article/pages/foot-print/foot-print.ts

@@ -3,7 +3,6 @@ import tickleBehavior, {
   getTickleContext,
 } from "../../../../core/behavior/tickle.behavior";
 import { getFootPrintListMethod } from "../../request";
-// module/diet/pages/delivery-address/delivery-address.ts
 Page({
   behaviors: [PageContainerBehavior, tickleBehavior],
   lifetimes: {
@@ -11,37 +10,8 @@ Page({
   },
   properties: {},
   data: {
-    articleList: [
-      {
-        id: 1,
-        img: "", // 图片地址,留空显示占位
-        title: "补肾误区大揭秘:这些食物并非越多越好…",
-        subtitle: "",
-        time: "2024-02-03 15:32:42",
-        type: "article",
-      },
-      {
-        id: 2,
-        img: "",
-        title: "虾的营养如何?怎么吃安全又营养",
-        subtitle: "",
-        time: "2024-02-03 15:32:42",
-        type: "diet",
-      },
-    ],
+    articleList: [],
   },
-  //   toInfoPage(event: WechatMiniprogram.TouchEvent) {
-  //   console.log(event, '健康宣教');
-  //   const item = event.currentTarget.dataset.item.item;
-  //   wx.navigateTo({ url: `/module/article/pages/science-info/science-info?id=${item.sourceId}` })
-  //   .then(res => { res.eventChannel.emit('load', item) })
-  //   // if (this.data.replace) {
-  //   //   wx.redirectTo({ url: `/module/article/pages/science-info/science-info?id=${item.sourceId}` });
-  //   // } else {
-  //   //   wx.navigateTo({ url: `/module/article/pages/science-info/science-info?id=${item.sourceId}` })
-  //   //     .then(res => { res.eventChannel.emit('load', item) })
-  //   // }
-  // },
   goDetail(e: any) {
     const type = e.currentTarget.dataset.type;
     const item = e.currentTarget.dataset.item;
@@ -60,17 +30,15 @@ Page({
       }).then((res) => {
         res.eventChannel.emit("load", item);
       });
-    } 
+    }
   },
   async load() {
     wx.showLoading({ title: "加载中" });
     try {
       const res = await getFootPrintListMethod();
-      console.log(res.data.data, "获取足迹");
-      if (res && res.data && res.data.data.length > 0) {
-        this.setData({ articleList: res.data.data });
-      }
-      console.log(this.data.articleList, "articleList");
+      const list = res?.data?.data ?? [];
+      console.log(list, "list",res.data.data);
+      this.setData({ articleList: Array.isArray(list) ? list : [] });
     } catch (error: any) {
       getTickleContext.call(this).showWarnMessage(error.errMsg);
     }

+ 16 - 13
miniprogram/module/article/pages/foot-print/foot-print.wxml

@@ -2,22 +2,25 @@
 <t-navbar title="足迹" left-arrow />
 
 <scroll-view class="page-scroll__container" scroll-y>
-  <view wx:for="{{articleList}}" wx:key="id" bindtap="goDetail" data-type="{{item.type}}" data-item="{{item}}">
-    <view class="footprint-item">
-      <view class="item-img-box">
-        <t-image
-          src="{{item.briefImg}}"
-          class="item-img"
-          mode="aspectFill"
-        />
-      </view>
-      <view class="item-content">
-        <view class="item-title">{{item.title}}</view>
-        <view class="item-subtitle" wx:if="{{item.subtitle}}">{{item.simpleAttr}}</view>
-        <view class="item-time">{{item.createTime}}</view>
+  <view wx:if="{{articleList && articleList.length>0}}">
+    <view wx:for="{{articleList}}" wx:key="id" bindtap="goDetail" data-type="{{item.type}}" data-item="{{item}}">
+      <view class="footprint-item">
+        <view class="item-img-box">
+          <t-image
+            src="{{item.briefImg}}"
+            class="item-img"
+            mode="aspectFill"
+          />
+        </view>
+        <view class="item-content">
+          <view class="item-title">{{item.title}}</view>
+          <view class="item-subtitle" wx:if="{{item.subtitle}}">{{item.simpleAttr}}</view>
+          <view class="item-time">{{item.createTime}}</view>
+        </view>
       </view>
     </view>
   </view>
+  <t-empty wx:else description="暂无数据" icon="info-circle-filled" />
 </scroll-view>
 
 <view style="height: {{container.safeBottomOffset}}px;flex: none;"></view>

+ 5 - 0
miniprogram/module/chats/components/guide/guide.scss

@@ -51,6 +51,11 @@
   }
 }
 
+/* 仅去掉特定 cell 的分隔线 */
+.no-border::after {
+  background: transparent !important;
+}
+
 // Custom hover class
 .custom-cell-hover {
   background-color: #F5F5F5 !important;

+ 36 - 26
miniprogram/module/chats/components/guide/guide.ts

@@ -4,21 +4,27 @@ import { toCertificationPage } from "../../../../pages/home/router";
 import { Post } from "../../../../lib/request/method";
 Component({
   lifetimes: {
-   attached() {
-   const showGuideActive = wx.getStorageSync("showGuideActive");
-  //  从主页点击健康评估进来的
-    if(showGuideActive){
-      this.handleA();
-      wx.removeStorageSync("showGuideActive");
-    }
-    // 获取评估剩余次数
-    this.setAnalysisCount();
-   },
-   
+    attached(this: any) {
+      const showGuideActive = wx.getStorageSync("showGuideActive");
+      //  从主页点击健康评估进来的
+      if (showGuideActive) {
+        this.handleA();
+        wx.removeStorageSync("showGuideActive");
+      }
+      // 首次挂载时也拉取一次,避免初次渲染为 0
+      this.setAnalysisCount();
+    },
+  },
+  pageLifetimes: {
+    show(this: any) {
+      // 获取评估剩余次数
+      this.setAnalysisCount();
+    },
   },
+
   observers: {
-    active(newVal,oldVal) {
-      console.log("active=>>>",newVal,oldVal);
+    active(newVal, oldVal) {
+      console.log("active=>>>", newVal, oldVal);
     },
   },
   properties: {
@@ -33,10 +39,11 @@ Component({
   },
   methods: {
     // 获取评估剩余次数
-    async setAnalysisCount(count: number) {
+    async setAnalysisCount(this: any) {
+      console.log("setAnalysisCount");
       try {
         // 获取剩余次数
-        const count = await Post(
+        const residuedCount = await Post(
           `/patientInfoManage/rechargeUseDetail`,
           {},
           {
@@ -45,7 +52,7 @@ Component({
             },
           }
         );
-        this.setData({ analysisCount: count });
+        this.setData({ analysisCount: residuedCount });
         console.log(this.data.analysisCount, "this.data.analysisCount");
       } catch (error) {
         console.error("获取剩余次数失败:", error);
@@ -55,9 +62,12 @@ Component({
       const { patient } = await getPatients(/*this.data.patientId*/);
       if (!patient) await toCertificationPage();
       else {
-        console.log("patient",this.data.active);
+        console.log("patient", this.data.active);
         if (this.data.active) {
-          this.triggerEvent("next", { component: "questionnaire", scroll: true });
+          this.triggerEvent("next", {
+            component: "questionnaire",
+            scroll: true,
+          });
           this.triggerEvent("nextType", { MessageType: 2 });
         }
       }
@@ -78,15 +88,15 @@ Component({
       if (!patient) await toCertificationPage();
       else {
         if (this.data.active)
-        wx.navigateTo({
-          url: "/module/user/pages/user-edit/user-edit",
-          events: {
-            update2: () => {
-              this.setData({ result2: true });
-              this.triggerEvent("next", { component: "guide", scroll: true });
+          wx.navigateTo({
+            url: "/module/user/pages/user-edit/user-edit",
+            events: {
+              update2: () => {
+                this.setData({ result2: true });
+                this.triggerEvent("next", { component: "guide", scroll: true });
+              },
             },
-          },
-        });
+          });
       }
     },
     handleD() {

+ 4 - 2
miniprogram/module/chats/components/guide/guide.wxml

@@ -37,7 +37,7 @@
       <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" slot="note" />
     </t-cell>
     <t-cell 
-      t-class="cell-border-gradient {{_.getClassName(active)}}" 
+      t-class="cell-border-gradient no-border {{_.getClassName(active)}}" 
       t-class-hover="custom-cell-hover"
        t-class-title="health-analysis-title"
       title="3、健康信息管理" 
@@ -47,7 +47,8 @@
     >
       <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" slot="note" />
     </t-cell>
-    <t-cell 
+          <!-- 
+  <t-cell 
       t-class="{{_.getClassName(active)}}" 
       t-class-hover="custom-cell-hover"
        t-class-title="health-analysis-title"
@@ -59,6 +60,7 @@
     >
       <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" slot="note" />
     </t-cell>
+    -->
   </view>
 </view>
 

+ 13 - 13
miniprogram/module/health/components/care-record/care-record.wxml

@@ -7,24 +7,24 @@
     <view class="card-header constitution-box">
       <t-loading wx:if="{{loading}}" theme="spinner" size="20px" class="loading" />
       <view class="card-title">
-        <view><image src="../../assets/icon/icon_record@2x.png" class="icon-title" /></view>
+        <view>
+          <image src="../../assets/icon/icon_record@2x.png" class="icon-title" />
+        </view>
         <view class="text-title">调养记录</view>
       </view>
       <slot name="extra"></slot>
     </view>
     <view class="table-box">
-    <view class="table">
-      <view class="table-row header">
-        <view class="table-cell">开具时间</view>
-        <view class="table-cell">服务包名称</view>
-      </view>
-      <view class="table-row" wx:for="{{careRecordList}}" wx:key="id"
-       bindtap="goDetail" data-id="{{item.id}}" data-name="{{item.conditioningWrapName}}">
-        <view class="table-cell">{{item.operateTime}}</view>
-        <view class="table-cell">{{item.conditioningWrapName}}</view>
+      <view class="table">
+        <view class="table-row header">
+          <view class="table-cell">开具时间</view>
+          <view class="table-cell">服务包名称</view>
+        </view>
+        <view class="table-row" wx:for="{{careRecordList}}" wx:key="id" bindtap="goDetail" data-id="{{item.id}}" data-name="{{item.conditioningWrapName}}">
+          <view class="table-cell">{{item.operateTime}}</view>
+          <view class="table-cell">{{item.conditioningWrapName}}</view>
+        </view>
       </view>
     </view>
   </view>
-</view>
-</view>
-
+</view>

+ 26 - 26
miniprogram/module/health/components/care-scheme/care-scheme.wxml

@@ -7,37 +7,37 @@
     <view class="card-header constitution-box">
       <t-loading wx:if="{{loading}}" theme="spinner" size="20px" class="loading" />
       <view class="card-title">
-        <view><image src="../../assets/icon/icon_record@2x.png" class="icon-title" /></view>
+        <view>
+          <image src="../../assets/icon/icon_record@2x.png" class="icon-title" />
+        </view>
         <view class="text-title">我的调养方案</view>
       </view>
       <slot name="extra"></slot>
     </view>
-   
 
-   <view class="table-box">
- <view class="care-scheme-card"  style="margin:0" wx:if="{{careRecordList.length>0}}" >
- <view wx:if="{{careRecordList && careRecordList[0].items.length>0}}" bind:tap="goDetail" data-id="{{careRecordList[0].id}}">
-    <view class="scheme-title-row">
-      <t-tag theme="primary" shape="round" size="small" class="status-tag">调理中</t-tag>
-      <text class="scheme-title" wx:if="{{careRecordList && careRecordList[0].conditioningWrapName}}">{{careRecordList[0].conditioningWrapName}}</text>
-    </view>
-    <view class="scheme-list" wx:for="{{careRecordList[0].items}}" wx:for-item="item" wx:key="index">
-      <view class="scheme-list-row">
-        <text class="item-name">{{item.conditioningProgramName}}</text>
-        <text class="item-desc">每{{item.frequencyType}}天{{item.frequencyMeasure}}{{item.convertUnit}}</text>
+
+    <view class="table-box">
+      <view class="care-scheme-card" style="margin:0" wx:if="{{careRecordList.length>0}}">
+        <view wx:if="{{careRecordList && careRecordList[0].items.length>0}}" bind:tap="goDetail" data-id="{{careRecordList[0].id}}">
+          <view class="scheme-title-row">
+            <t-tag theme="primary" shape="round" size="small" class="status-tag">调理中</t-tag>
+            <text class="scheme-title" wx:if="{{careRecordList && careRecordList[0].conditioningWrapName}}">{{careRecordList[0].conditioningWrapName}}</text>
+          </view>
+          <view class="scheme-list" wx:for="{{careRecordList[0].items}}" wx:for-item="item" wx:key="index">
+            <view class="scheme-list-row">
+              <text class="item-name">{{item.conditioningProgramName}}</text>
+              <text class="item-desc">每{{item.frequencyType}}天{{item.frequencyMeasure}}{{item.convertUnit}}</text>
+            </view>
+          </view>
+        </view>
+        <view wx:else class="empty-data">
+          暂无数据
+        </view>
+
+      </view>
+      <view wx:else class="empty-data">
+        暂无数据
       </view>
     </view>
-    </view>
-    <view wx:else class="empty-data" >
-暂无数据
-</view>
-
-</view>
-<view wx:else class="empty-data">
-暂无数据
-</view>
-  </view>
   </view>
-</view>
-
-
+</view>

+ 11 - 11
miniprogram/module/health/components/follow-evaluation/follow-evaluation.wxml

@@ -15,18 +15,18 @@
       <slot name="extra"></slot>
     </view>
     <view class="table-box">
-    <view class="table">
-      <view class="table-row header">
-        <view class="table-cell">评估时间</view>
-        <view class="table-cell">随访计划</view>
-        <view class="table-cell">评估结果</view>
-      </view>
-      <view class="table-row" wx:for="{{followEvaluationList}}" wx:key="id" bindtap="goFollowEvaluation">
-        <view class="table-cell truncate">{{item.evaluateTime}}</view>
-        <view class="table-cell truncate">{{item.followupPlanName}}</view>
-        <view class="table-cell truncate">{{item.evaluate.evaluateDeal==='1'?'复诊 ':item.evaluate.evaluateDeal==='2'?'中医调养':''}}</view>
+      <view class="table">
+        <view class="table-row header">
+          <view class="table-cell">评估时间</view>
+          <view class="table-cell">随访计划</view>
+          <view class="table-cell">评估结果</view>
+        </view>
+        <view class="table-row" wx:for="{{followEvaluationList}}" wx:key="id" bindtap="goFollowEvaluation">
+          <view class="table-cell truncate">{{item.evaluateTime}}</view>
+          <view class="table-cell truncate">{{item.followupPlanName}}</view>
+          <view class="table-cell truncate">{{item.evaluate.evaluateDeal==='1'?'复诊 ':item.evaluate.evaluateDeal==='2'?'中医调养':''}}</view>
+        </view>
       </view>
     </view>
   </view>
-</view>
 </view>

+ 1 - 1
miniprogram/module/health/components/report-health-index/report-health-index.wxml

@@ -19,7 +19,7 @@
 
     </view>
     <view class="nodata-box" wx:if="{{!loading && !dataset.length}}">
-      <view slot="description" wx:if="{{!loading && !dataset.length}}" >暂无数据</view>
+      <view slot="description" wx:if="{{!loading && !dataset.length}}">暂无数据</view>
     </view>
   </view>
 

+ 38 - 0
miniprogram/module/user/pages/user-edit/user-edit.scss

@@ -15,4 +15,42 @@
   text-align: right !important;
   box-sizing: border-box !important;
   /* margin-left: 29px ; */
+}
+
+/* 最大限度压缩左侧标题,放大右侧输入 */
+.id-cell-flex {
+  display: flex !important;
+}
+.id-cell-flex .t-cell__title {
+  width: 80rpx !important;
+  min-width: 80rpx !important;
+}
+.id-cell-flex .t-cell__note {
+  flex: 1 1 auto !important;
+}
+.cell-row{
+  display: flex;
+  align-items: center;
+  padding: var(--td-cell-vertical-padding, 32rpx) var(--td-cell-horizontal-padding, 32rpx);
+  // background: #fff;
+  background-color: var(--td-cell-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));
+  position: relative;
+}
+.cell-row + .cell-row { border-top: 0; }
+
+.cell-row .input{
+  flex: 1 1 auto;
+  text-align: right;
+}
+.id-input {
+  text-align: left !important;
+}
+
+/* 放大身份证输入区域,并左对齐以保证完整可见 */
+.id-note {
+  flex: 1 1 auto !important;
+}
+.id-input {
+  text-align: left !important;
+  letter-spacing: 1rpx;
 }

+ 4 - 3
miniprogram/module/user/pages/user-edit/user-edit.wxml

@@ -7,9 +7,10 @@
     <t-cell title="姓名">
       <input class="cell-field__inner" slot="note" name="name" value="{{model['name']}}" type="text" placeholder="请输入姓名" confirm-type="next" />
     </t-cell>
-    <t-cell title="身份证号">
-      <input class="cell-field__inner" slot="note" name="cardno" value="{{model['cardno']}}" type="idcard" placeholder="请输入身份证号" confirm-type="next" data-field="cardno" bindinput="onFormInput" />
-    </t-cell>
+    <view class="cell-row">
+      <view class="label">身份证号</view>
+      <input class="input" name="cardno" value="{{model['cardno']}}" type="idcard" placeholder="请输入身份证号" confirm-type="next" data-field="cardno" bindinput="onFormInput" maxlength="18" />
+    </view>
     <block wx:if="{{!idCardValid}}">
       <t-cell title="年龄" required>
         <input class="cell-field__inner" slot="note" name="age" value="{{model['age']}}" type="number" placeholder="请输入年龄" confirm-type="next" data-field="age" bindinput="onFormInput" style="padding-right:12%" />

+ 1 - 1
miniprogram/pages/home/home.wxml

@@ -213,7 +213,7 @@
         <view class="CT row" wx:for="{{position.CT}}" wx:key="*this">{{item}}</view>
       </block>
       <view class="bottom-wrapper">
-        <form-button index="2" bind:tap="hideDraggableSheet" text="2"></form-button>
+        <form-button index="2" bind:tap="hideDraggableSheet" disableOnClick="{{false}}"></form-button>
       </view>
     </sticky-section>
   </scroll-view>