张田田 10 месяцев назад
Родитель
Сommit
cb5b624fbd
2 измененных файлов с 10 добавлено и 5 удалено
  1. 1 1
      miniprogram/pages/home/home.wxml
  2. 9 4
      miniprogram/pages/mine/mine.ts

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

@@ -44,7 +44,7 @@ v<!--pages/home/home.wxml-->
 </view>
 </view>
 
-<view class="report-container" bind:tap="toReportPage">
+<view class="report-container" bind:tap="toReportPage" wx:if="{{healthReport.data.reportTime}}">
 <view class="report-box">
 <view><image src="../../assets/bg/icon_file@3x.png" class="report-img" /> </view>
 <view class="text-box" wx:if="{{healthReport.data.reportTime}}"><view class="text-one">健康分析报告</view><view class="text-two">日期:{{healthReport.data.reportTime}}</view></view>

+ 9 - 4
miniprogram/pages/mine/mine.ts

@@ -27,11 +27,16 @@ Page({
     try {
       wx.showLoading({ title: "加载中" });
       const { patient } = await getPatients();
-      const { phone } = await getPatientPhone();
+      const res = await getPatientPhone();
+      console.log(res, "获取手机号");
+      if (res && res.phone) {
+        this.setData({
+          phone: res.phone
+        });
+      }
       wx.setStorageSync("patientName", patient?.name);
       this.setData({ 
         patient: patient || null,
-        phone
       });
     } catch (error) {
       console.error('加载失败:', error);
@@ -73,11 +78,11 @@ Page({
   },
 
   onLoad() {
-    this.load();
+    // this.load();
   },
 
   onShow() {
     // 如果需要每次显示页面时刷新数据,可以在这里调用 load
-    // this.load();
+    this.load();
   },
 });