From db5614ba62f5855e5d7f7ed980c8630afc779343 Mon Sep 17 00:00:00 2001 From: Mila <Mila@pollex.com.tw> Date: 星期一, 06 十二月 2021 10:59:04 +0800 Subject: [PATCH] update: TODO#131490 [預約清單]: 1. 顧問登入後通知新加入預約單有幾筆, 2. 增加新預約單與未讀樣式 --- PAMapp/pages/myAppointmentList/appointmentList.vue | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/PAMapp/pages/myAppointmentList/appointmentList.vue b/PAMapp/pages/myAppointmentList/appointmentList.vue index 370dad2..4e6ac07 100644 --- a/PAMapp/pages/myAppointmentList/appointmentList.vue +++ b/PAMapp/pages/myAppointmentList/appointmentList.vue @@ -5,6 +5,7 @@ placeholder="隢撓���摮�" class="mb-30 pam-clientReserved-input" v-model="keyWord" + @keyup.enter.native="search" > <i slot="suffix" class="icon-search search cursor--pointer" @click="search"></i> </el-input> @@ -15,14 +16,14 @@ ></ClientList> <UiPagination - :totalList="appointmentList" + :totalList="filterList" @changePage="changePage" ></UiPagination> </div> </template> <script lang="ts"> -import { Vue, Component, Prop, State, Watch } from 'nuxt-property-decorator'; +import { Vue, Component, State, Watch } from 'nuxt-property-decorator'; import { ClientInfo } from '~/assets/ts/api/appointment'; @Component @@ -36,9 +37,16 @@ @Watch('myAppointmentList') onMyAppointmentListChange() { - this.appointmentList = this.myAppointmentList - .filter(item => item.communicateStatus !== 'contacted') - .sort((a, b) => a.appointmentDate > b.appointmentDate ? -1 : 1);; + const unreadList = this.myAppointmentList + .filter(item => item.communicateStatus !== 'contacted' && !item.consultantReadTime) + .sort((a, b) => a.consultantViewTime > b.consultantViewTime ? 1 : -1); + + const readList = this.myAppointmentList + .filter(item => item.communicateStatus !== 'contacted' && item.consultantReadTime) + .sort((a, b) => a.consultantReadTime > b.consultantReadTime ? -1 : 1) + + this.appointmentList = unreadList.concat(readList); + this.filterList = this.appointmentList; } mounted() { -- Gitblit v1.8.0