From 9052a47013c84b0acc9abad0b37cdb59b671d83f Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期四, 16 十二月 2021 16:44:43 +0800
Subject: [PATCH] update: [顧問-客戶預約列表] 新預約單後,先顯示未讀的預約單

---
 PAMapp/pages/myAppointmentList/appointmentList.vue |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/PAMapp/pages/myAppointmentList/appointmentList.vue b/PAMapp/pages/myAppointmentList/appointmentList.vue
index d3cd6c5..791b947 100644
--- a/PAMapp/pages/myAppointmentList/appointmentList.vue
+++ b/PAMapp/pages/myAppointmentList/appointmentList.vue
@@ -53,12 +53,17 @@
           .map((item) => ({ ...item, sortTime: new Date(item.appointmentDate)}))
           .sort((preItem, nextItem) => +nextItem.sortTime - +preItem.sortTime);
 
-      const viewList = this.myAppointmentList
-          .filter(item => item.communicateStatus !== 'contacted' && item.consultantViewTime)
-          .map((item) => ({ ...item, sortTime: new Date(item.consultantViewTime)}))
-          .sort((preItem, nextItem) => +nextItem.sortTime - +preItem.sortTime);
+      const tempViewList = this.myAppointmentList
+          .filter(item => item.communicateStatus !== 'contacted' && item.consultantViewTime);
 
-      this.appointmentList = [...unViewList, ...viewList];
+      // TODO: 敺������� unreadList ��蝝啁溶�������隢�垢����靘������ createTime嚗�Tomas, 2021/12/16];疇
+      const unreadList = tempViewList.filter((item) => !item.consultantReadTime);
+      const readList = tempViewList
+                    .filter((item) => item.consultantReadTime)
+                    .map((item) => ({ ...item, sortTime: new Date(item.consultantReadTime)}))
+                    .sort((preItem, nextItem) => +nextItem - +preItem);
+
+      this.appointmentList = [...unViewList, ...unreadList, ...readList];
       this.filterList = this.appointmentList;
     }
 

--
Gitblit v1.8.0