| | |
| | | <el-col class="flex_column" :xs="5" :sm="3"> |
| | | <UiAvatar |
| | | :size="50" |
| | | :fileName="avatarFileName" |
| | | :agentNo="agentInfo.agentNo" |
| | | @click.native="showAgentDetail(agentInfo.agentNo)" |
| | | ></UiAvatar> |
| | | <!-- TODO:隱藏滿意度 --> |
| | |
| | | @click="reserveCommunication" |
| | | :class="actionBtnStyle" |
| | | >{{ actionBtnLabel }}</el-button> |
| | | <div |
| | | v-if="notScoreAppointmentYet" |
| | | class="text--primary mt-10 text--center text--underline cursor--pointer" |
| | | @click="reviewsBtn = true">給予滿意度評分</div> |
| | | <div class="updateTime mt-10"> |
| | | {{ displayTime | formatDate }} |
| | | {{ agentInfo.updateTime | formatDate }} |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Action, namespace } from 'nuxt-property-decorator'; |
| | | |
| | | import appointmentService from '~/assets/ts/services/appointment.service'; |
| | | import { isMobileDevice } from '~/assets/ts/device'; |
| | | import { hideReviews } from '~/assets/ts/const/hide-reviews'; |
| | | import { UserReviewsConsultantsParams, userReviewsConsultants } from '~/assets/ts/api/consultant'; |
| | | import { Consultant, ConsultantWithAppointmentId } from '~/assets/ts/models/consultant.model'; |
| | | import { Appointment } from '~/assets/ts/models/appointment.model'; |
| | | import appointmentService from '~/shared/services/appointment.service'; |
| | | import reviewsService from '~/shared/services/reviews.service'; |
| | | import UtilsService from '~/shared/services/utils.service'; |
| | | import { hideReviews } from '~/shared/const/hide-reviews'; |
| | | import { Consultant, ConsultantWithAppointmentId } from '~/shared/models/consultant.model'; |
| | | import { Appointment } from '~/shared/models/appointment.model'; |
| | | import { UserReviewsConsultantsParams } from '~/shared/models/reviews.model'; |
| | | |
| | | const localStorage = namespace('localStorage'); |
| | | @Component({ |
| | |
| | | } |
| | | } |
| | | |
| | | get displayTime(): string { |
| | | const isAppointment = !!this.agentInfo['appointmentStatus']; |
| | | let time: Date | string = ''; |
| | | if (isAppointment) { |
| | | time = this.agentInfo['appointmentDate']; |
| | | } else { |
| | | switch(this.agentInfo.contactStatus) { |
| | | case 'reserved': |
| | | time = this.agentInfo.updateTime; |
| | | break; |
| | | case 'picked': |
| | | time = this.agentInfo.updateTime; |
| | | break; |
| | | } |
| | | } |
| | | if (typeof time !== 'string') { |
| | | time.toString(); |
| | | } |
| | | return time as string; |
| | | } |
| | | |
| | | get avatarFileName() { |
| | | return this.agentInfo.img; |
| | | } |
| | |
| | | ...res, |
| | | satisfactionScore: this.agentInfo['appointmentScore'], |
| | | }; |
| | | this.width = isMobileDevice() ? '80%' : ''; |
| | | this.width = UtilsService.isMobileDevice() ? '80%' : ''; |
| | | this.isVisibleDialog = true; |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | userReviewsConsultants() { |
| | | const isAppointment = !!this.agentInfo['appointmentStatus']; |
| | | const appointmentId = isAppointment |
| | | ? this.agentInfo['appointmentId'] |
| | | : this.latestReservedAppointment.id; |
| | | |
| | | const reviewParams: UserReviewsConsultantsParams = { |
| | | appointmentId: this.appointmentDetail.id, |
| | | appointmentId: appointmentId, |
| | | score: this.inputScore, |
| | | } |
| | | this.appointmentDetail.satisfactionScore = this.inputScore; |
| | | |
| | | userReviewsConsultants(reviewParams).then((res) => { |
| | | reviewsService.userReviewsConsultants(reviewParams).then((res) => { |
| | | this.reviewsBtn = false; |
| | | this.storeConsultantList(); |
| | | }); |