From 5e17ffe4ac5922abec6114d7da4c39f50d6768a6 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期五, 14 一月 2022 12:45:15 +0800 Subject: [PATCH] update: 顧問-預約單列表調整為三個頁面籤的邏輯調整 --- PAMapp/pages/myAppointmentList/appointmentList.vue | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/PAMapp/pages/myAppointmentList/appointmentList.vue b/PAMapp/pages/myAppointmentList/appointmentList.vue index 57e3080..f49be3a 100644 --- a/PAMapp/pages/myAppointmentList/appointmentList.vue +++ b/PAMapp/pages/myAppointmentList/appointmentList.vue @@ -27,6 +27,7 @@ import { Vue, Component, State, Watch, namespace } from 'nuxt-property-decorator'; import { Appointment } from '~/shared/models/appointment.model'; +import { ContactStatus } from '~/shared/models/enum/contact-status'; const localStorage = namespace('localStorage'); @@ -44,6 +45,7 @@ keyWord : string = ''; pageList : Appointment[] = []; currentPage : number = 1; + contactStatus = ContactStatus; ////////////////////////////////////////////////////////////////////// @@ -55,13 +57,14 @@ @Watch('myAppointmentList') onMyAppointmentListChange(): void { - const unViewList = this.myAppointmentList - .filter((item) => item.communicateStatus !== 'contacted' && !item.consultantViewTime) - .map((item) => ({ ...item, sortTime: new Date(item.appointmentDate)})) - .sort((preItem, nextItem) => +nextItem.sortTime - +preItem.sortTime); + // const unViewList = this.myAppointmentList + // .filter((item) => item.communicateStatus === 'contacted' && !item.consultantViewTime) + // .map((item) => ({ ...item, sortTime: new Date(item.appointmentDate)})) + // .sort((preItem, nextItem) => +nextItem.sortTime - +preItem.sortTime); + const tempViewList = this.myAppointmentList - .filter(item => item.communicateStatus !== 'contacted' && item.consultantViewTime); + .filter(item => item.communicateStatus === this.contactStatus.RESERVED && item.consultantViewTime); // TODO: 敺������� unreadList ��蝝啁溶�������隢�垢����靘������ createTime嚗�Tomas, 2021/12/16];疇 const unreadList = tempViewList @@ -71,7 +74,8 @@ .map((item) => ({ ...item, sortTime: new Date(item.consultantReadTime)})) .sort((preItem, nextItem) => +nextItem.sortTime - +preItem.sortTime); - this.appointmentList = [...unViewList, ...unreadList, ...readList]; + this.appointmentList = [ ...unreadList, ...readList]; + // this.appointmentList = [...unViewList, ...unreadList, ...readList]; this.filterList = this.appointmentList; this.getCurrentPage(); -- Gitblit v1.8.0