Przeglądaj źródła

fix: bugFixed appointment duration busy status

wangyuan 2 lat temu
rodzic
commit
ae00f6d8b4
1 zmienionych plików z 16 dodań i 0 usunięć
  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'