From 544f91e63a01f37e7b79db99609eec99b1afafd9 Mon Sep 17 00:00:00 2001 From: Mila <Mila@pollex.com.tw> Date: 星期一, 13 十二月 2021 11:07:31 +0800 Subject: [PATCH] fixed: 使用 isUserLogin / isAdminLogin 判斷顧問/客戶是否登入 --- PAMapp/components/Consultant/ConsultantCard.vue | 38 ++++++++++++++++++++++---------------- 1 files changed, 22 insertions(+), 16 deletions(-) diff --git a/PAMapp/components/Consultant/ConsultantCard.vue b/PAMapp/components/Consultant/ConsultantCard.vue index 2e7937e..5c773f3 100644 --- a/PAMapp/components/Consultant/ConsultantCard.vue +++ b/PAMapp/components/Consultant/ConsultantCard.vue @@ -11,7 +11,8 @@ :fileName="avatarFileName" @click.native="showAgentDetail(agentInfo.agentNo)" ></UiAvatar> - <div> + <!-- TODO:���遛��漲 --> + <div v-if="!hideReviews"> <i class="icon-star pam-icon icon--yellow satisfaction" v-if="!(latestContactedAppointment && !latestContactedAppointment.satisfactionScore)"></i> <span v-if="agentInfo.contactStatus === 'contacted' && latestContactedAppointment && latestContactedAppointment.satisfactionScore"> {{ latestContactedAppointment && latestContactedAppointment.satisfactionScore}} @@ -45,7 +46,7 @@ @click="reserveCommunication" :class="agentInfo.contactStatus + 'Btn'" >{{ contactTxt }}</el-button> - <div class="updateTime"> + <div class="updateTime mt-10"> {{ displayTime | formatDate }} </div> </el-col> @@ -74,14 +75,14 @@ :key="index" >��蝯⊥�挾{{index + 1 | formatNumber}}嚗{ item | formatHopeContactTime }}</p> <div v-if="appointmentDetail.satisfactionScore"> - <div class="mdTxt mt-10 mb-10">皛踵�漲</div> - <el-rate - :value="appointmentDetail.satisfactionScore" - class="pam-myDemand-dialog__rate" - disabled> - </el-rate> - </div> + <div class="mdTxt mt-10 mb-10">皛踵�漲</div> + <el-rate + :value="appointmentDetail.satisfactionScore" + class="pam-myDemand-dialog__rate" + disabled> + </el-rate> </div> + </div> <div v-if="agentInfo.contactStatus === 'contacted' && !appointmentDetail.satisfactionScore" class="dialogInfo-btn"> @@ -127,6 +128,7 @@ import { Consultant, Appointment } from '~/assets/ts/models/consultant.model'; import { isMobileDevice } from '~/assets/ts/device'; import { Role } from '~/assets/ts/models/enum/Role'; +import { hideReviews } from '~/assets/ts/const/hide-reviews'; const roleStorage = namespace('localStorage'); @Component({ @@ -160,6 +162,7 @@ width: string = ''; inputScore = 0; isCancelPopup = false; + hideReviews = hideReviews; get latestContactedAppointment(): Appointment | null { if (!(this.agentInfo && this.agentInfo.appointments && this.agentInfo.appointments.length)) return null; @@ -173,27 +176,30 @@ return this.agentInfo.appointments! .filter((appointment) => appointment.communicateStatus !== 'contacted') .map((reversedAppointment) => { - return { + return { ...reversedAppointment, sortDate: new Date(reversedAppointment.appointmentDate) - } + } }) .sort((preAppointment, nextAppointment) => +nextAppointment.sortDate - +preAppointment.sortDate)[0]; } get displayTime(): string { - let time = ''; + let time: Date | string = ''; switch(this.agentInfo.contactStatus) { case 'reserved': - time = this.agentInfo.updateTime + time = this.agentInfo.updateTime break; case 'contacted': - time = this.agentInfo.updateTime + time = this.agentInfo.updateTime break; case 'picked': - time = this.agentInfo.createTime + time = this.agentInfo.createTime break; } - return time; + if (typeof time !== 'string') { + time.toString(); + } + return time as string; } appointmentDetail: any = { -- Gitblit v1.8.0