Procházet zdrojové kódy

【健康档案】调养记录详情,点击后不需要先展示一下“暂无数据”

张田田 před 9 měsíci
rodič
revize
54fd9a2589

+ 5 - 15
miniprogram/module/care/pages/careDetail/careDetail.ts

@@ -2,7 +2,6 @@ import { Post } from "../../../../lib/request/method";
 import { fromHealthReportSymptom } from "../../../../utils/util";
 import { fromHealthReportSymptom } from "../../../../utils/util";
 Page({
 Page({
   onLoad(options) {
   onLoad(options) {
-    // console.log("options", options);
     if (options.id) {
     if (options.id) {
       wx.setStorageSync("careId", Number(options.id));
       wx.setStorageSync("careId", Number(options.id));
       this.getCareDetail(Number(options.id));
       this.getCareDetail(Number(options.id));
@@ -21,7 +20,6 @@ Page({
     healthReports: [],
     healthReports: [],
     statusText: "未知状态",
     statusText: "未知状态",
     loading: true,
     loading: true,
-    isShow: false,
     isShowDelivery: false,
     isShowDelivery: false,
   },
   },
   onCardRecord(e: any) {
   onCardRecord(e: any) {
@@ -64,7 +62,6 @@ Page({
           statusText,
           statusText,
         });
         });
         let isShowDelivery = false;
         let isShowDelivery = false;
-        console.log(res.items, "服务包详情数据");
         if (res.items.length > 0) {
         if (res.items.length > 0) {
           isShowDelivery = res.items.some((item: any) => {
           isShowDelivery = res.items.some((item: any) => {
             return item.conditioningProgramDetail?.isDelivery === "Y";
             return item.conditioningProgramDetail?.isDelivery === "Y";
@@ -102,20 +99,13 @@ Page({
           careDetail: {},
           careDetail: {},
         });
         });
       }
       }
-      if (JSON.stringify(this.data.careDetail) !== "{}") {
-        this.setData({
-          isShow: true,
-        });
-      } else {
-        this.setData({
-          isShow: false,
-        });
-      }
-    } catch (error) {
-      console.log(error);
+    } catch (error: any) {
+      wx.showToast({
+        title: error.message,
+        icon: "none",
+      });
       wx.hideLoading();
       wx.hideLoading();
       this.setData({
       this.setData({
-        isShow: false,
         loading: false,
         loading: false,
       });
       });
     }
     }

+ 0 - 5
miniprogram/module/care/pages/careDetail/careDetail.wxml

@@ -5,7 +5,6 @@
     scroll-y 
     scroll-y 
   >
   >
     <block wx:if="{{!loading}}">
     <block wx:if="{{!loading}}">
-      <block wx:if="{{isShow}}">
         <!-- 调理中卡片 -->
         <!-- 调理中卡片 -->
         <view class="info-card card-content">
         <view class="info-card card-content">
           <view class="status-tag">
           <view class="status-tag">
@@ -243,9 +242,5 @@
           </view>
           </view>
         </view>
         </view>
       </block>
       </block>
-      <block wx:else>
-        <t-empty icon="info-circle-filled" description="暂无数据" />
-      </block>
-    </block>
   </scroll-view>
   </scroll-view>
 </view>
 </view>