Эх сурвалжийг харах

fix: bugFix index top appointment notice

wangyuan 2 жил өмнө
parent
commit
c6593d99eb

+ 4 - 1
note.txt

@@ -6,4 +6,7 @@
   5,输入框输入的文字颜色加重,避免和placeholder相同 fixed
   6,我的预约,待检测账号字段去除 fixed
   7、小程序默认页面改为index fixed
-  8,accessToken使用本地保存,不用每次使用wx.login获取。用户端有效期7天,工作人员2天 fixed
+  8,accessToken使用本地保存,不用每次使用wx.login获取。用户端有效期7天,工作人员2天 fixed
+
+2022-10-22
+  1,

+ 27 - 2
pages/index/index.js

@@ -2,6 +2,7 @@
 import { homePage } from '../../api/index'
 import { createQRcode } from "../../api/document"
 import { ittLogin, bindMobile, bindBaseInfo } from '../../api/my'
+import { appointmentList } from '../../api/appointment'
 const app = getApp()
 Page({
 
@@ -23,7 +24,9 @@ Page({
     userAuthShow: false,
     avatarUrl: '',
     nickName: '',
-    isRefreshPage: false
+    isRefreshPage: false,
+    showTopBar: false,
+    topBarObj: null
   },
   
   onShow () {
@@ -258,7 +261,10 @@ Page({
       imageUrl: '../../imaes/share.jpg'
     }
   },
-  // 获取首页信息 档案 剩余次数
+  // 获取首页信息 档案 剩余次数, 
+  /*  定位地址这边换成
+  1. 如果没有预约信息,就这条直接隐藏掉
+  2. 如果有预约信息,则显示,您预约的2022-10-25 8:00-12:00的健康筛查   待体验 */
   initIndexData (pullDownRefresh = false) {
     var that = this
     wx.showLoading({
@@ -287,6 +293,25 @@ Page({
         showCancel: false
       })
     })
+    appointmentList({
+      status: 1,
+      currentPage: 1
+    }).then(res => {
+      console.log(res, 'appointmentList');
+      if (res.data.vos.length !== 0) {
+        that.setData({
+          showTopBar: true,
+          topBarObj: res.data.vos[0]
+        })
+      } else {
+        that.setData({
+          showTopBar: false,
+          topBarObj: null
+        })
+      }
+    }).catch(e => {
+
+    })
   },
 
   /**

+ 5 - 4
pages/index/index.wxml

@@ -1,13 +1,14 @@
 <!--pages/index/index.wxml-->
 <view class="index-container">
-  <view class="header">
+  <view class="header" wx:if="{{showTopBar}}">
     <view class="main-header">
       <view class="location">
         <view class="location-info ittflex-jcs">
-          <van-icon name="location" size="20px"/>
-          <text class="l-text">{{locationStr}}</text>
+          您预约了{{topBarObj.appointmentTime}}的健康筛查
+        </view>
+        <view class="scan">
+          待体检
         </view>
-        <view class="scan" bindtap="handleScanCode"></view>
       </view>
     </view>
   </view>

+ 5 - 1
pages/index/index.wxss

@@ -4,6 +4,7 @@
   min-height: 100%;
   background-color: #F7F7F7;
   position: relative;
+  padding-top: 1rpx;
 }
 .header {
   width: 100%;
@@ -23,8 +24,9 @@
   align-items: center;
 }
 .location-info {
-  width: 345rpx;
+  width: 80%;
   height: 100%;
+  font-size: 26rpx;
 }
 .scan {
   width: 100rpx;
@@ -32,6 +34,8 @@
   display: flex;
   justify-content: flex-end;
   align-items: center;
+  font-size: 26rpx;
+  color: #9A1D16;
 }
 .l-text {
   font-size: 26rpx;

+ 1 - 1
pages/myRecord/myRecord.wxml

@@ -36,7 +36,7 @@
               <text>{{item.addTime}}</text>
             </view>
           </view>
-          <view class="right count">{{item.useNumber}}</view>
+          <view class="right count">+{{item.useNumber}}</view>
         </view>
       </block>
     </view>