PAMapp/assets/ts/services/appointment.service.ts | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/pages/myAppointmentList.vue | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/pages/myAppointmentList/appointmentList.vue | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 |
PAMapp/assets/ts/services/appointment.service.ts
@@ -6,7 +6,17 @@ // 取得所有預約清單 async getMyAppointmentList(): Promise<ClientInfo[]> { return http.get('/consultant/getMyAppointment').then(res => res.data); return http.get('/consultant/getMyAppointment').then((res) => { const hasNewAppointment = res.data.find((appointment: ClientInfo) => !appointment.consultantViewTime); if (hasNewAppointment) { this.viewAllAppointment(); } return res.data; }); } private viewAllAppointment(): void { http.post('/consultant/record/allAppointmentsView').then(); } // 標記為已聯絡 PAMapp/pages/myAppointmentList.vue
@@ -20,6 +20,7 @@ </div> <NuxtChild></NuxtChild> </div> <!-- DIALOG --> @@ -67,6 +68,11 @@ @State('myNewAppointmentSum') newAppointmentSum!: number; @Watch('newAppointmentSum') newAppointmentSumChange(): void { this.showNewAppointmentHint = this.newAppointmentSum > 0; } activeTabName = 'appointmentList'; appointmentList: ClientInfo[] = []; contactedList: ClientInfo[] = []; @@ -83,7 +89,6 @@ mounted() { this.setActivatedTab(); this.storeMyAppointmentList(); this.showNewAppointmentHint = this.newAppointmentSum > 0; } ////////////////////////////////////////////////////////////////////// PAMapp/pages/myAppointmentList/appointmentList.vue
@@ -48,17 +48,17 @@ @Watch('myAppointmentList') onMyAppointmentListChange(): void { const unreadList = this.myAppointmentList .filter((item) => item.communicateStatus !== 'contacted' && !item.consultantReadTime) 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 readList = this.myAppointmentList .filter(item => item.communicateStatus !== 'contacted' && item.consultantReadTime) .map((item) => ({ ...item, sortTime: new Date(item.consultantReadTime)})) 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); this.appointmentList = unreadList.concat(readList); this.appointmentList = [...unViewList, ...viewList]; this.filterList = this.appointmentList; }