Ver código fonte

fix: bugFixed appointment duration busy status

wangyuan 2 anos atrás
pai
commit
ae00f6d8b4
1 arquivos alterados com 16 adições e 0 exclusões
  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'