From 9bdb95c9e34cef640534e5e5a1e2225a80442000 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 15:48:15 +0800 Subject: [PATCH] TODO#139894 [ footer -最下方說明與保經代合作 ] 文案修改 --- PAMapp/pages/myConsultantList.vue | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/PAMapp/pages/myConsultantList.vue b/PAMapp/pages/myConsultantList.vue index 453f05e..6914ee7 100644 --- a/PAMapp/pages/myConsultantList.vue +++ b/PAMapp/pages/myConsultantList.vue @@ -37,6 +37,9 @@ @State('myConsultantList') myConsultantList!: Consultant[]; + @State('myAppointmentGroupByConsultantList') + myAppointmentGroupByConsultantList!: ConsultantWithAppointmentId[]; + @Action storeConsultantList!: any; @@ -70,18 +73,26 @@ this.setList(); } + @Watch('myAppointmentGroupByConsultantList') + omMyAppointmentGroupByConsultantList() { + this.setContactedList(); + } + private setList() { - // reset contacted list - this.contactedList = []; // format consultant list this.consultantList = (this.myConsultantList || []) .filter(item => item.contactStatus !== 'contacted') .map((item) => ({ ...item, formatDate: new Date(item.updateTime || item.createTime)})) .sort((preItem, nextItem) => +nextItem.formatDate - +preItem.formatDate ); + } + + private setContactedList() { + // reset contacted list + this.contactedList = []; if (authService.isUserLogin()) { - this.myConsultantList.filter((consultant) => consultant.appointments!.length) + this.myAppointmentGroupByConsultantList.filter((consultant) => consultant.appointments!.length) .forEach((consultant) => { consultant.appointments!.forEach((appointment) => { const consultantWithAppointmentId: ConsultantWithAppointmentId = { @@ -98,10 +109,9 @@ this.contactedList = this.contactedList .filter((appointment) => appointment['appointmentStatus'] !== 'reserved') - .map((appointment) => ({ ...appointment, sortTime: new Date(appointment.updateTime)})) + .map((appointment) => ({ ...appointment, sortTime: new Date(appointment.appointmentLastModifiedDate)})) .sort((preAppointment, nextAppointment) => +nextAppointment.sortTime - +preAppointment.sortTime); } - } ////////////////////////////////////////////////////////////////////// -- Gitblit v1.8.0