保誠-保戶業務員媒合平台
Tomas
2021-12-16 9052a47013c84b0acc9abad0b37cdb59b671d83f
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;
    }