Bläddra i källkod

fix: bugFixed appointment duration busy status

wangyuan 2 år sedan
förälder
incheckning
ae00f6d8b4
1 ändrade filer med 16 tillägg och 0 borttagningar
  1. 16 0
      pages/appointment/appointment.js

+ 16 - 0
pages/appointment/appointment.js

@@ -89,6 +89,8 @@ Page({
       })
       if (allBusy == undefined) {
         that.handleAllDayBusy(cDate)
+      } else {
+        that.handleAllDayAppointment(cDate)
       }
       response.forEach(item => {
         if (item.duration == 1) {
@@ -132,6 +134,20 @@ Page({
     })
   },
 
+  handleAllDayAppointment (cDate) {
+    console.log(cDate, '可预约')
+    const _weekList = this.data.weekList
+    _weekList.forEach(item => {
+      if (item.dateStr == cDate && item.date == '约满') {
+        console.log(item.dateStr);
+        item.date = Number(item.dateStr.split('-')[2])
+      }
+    })
+    this.setData({
+      weekList: _weekList
+    })
+  },
+
   onPullDownRefresh () {
     wx.vibrateShort({
       type: 'medium'