Просмотр исходного кода

修复居家项目不展示下一次的时间以及首页请做健康评估会闪一下的问题

张田田 6 месяцев назад
Родитель
Сommit
6e8ef27e4b

+ 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%;
+}

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

@@ -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,
@@ -403,6 +403,10 @@ Page({
         if (wx.getStorageSync("doctorId")) {
           toCertificationPage();
         }
+        this.setData({
+          "healthReport.loading": false,
+          isShowComplete: true,
+        });
       } else {
         this.setData({ patient });
         this.observerPatient(patient);

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