保誠-保戶業務員媒合平台
HelenHuang
2021-12-30 ac594e4efb30ba28776d74b0fb08ab34d7c32023
PAMapp/components/Consultant/ConsultantCard.vue
@@ -8,7 +8,7 @@
                    <el-col class="flex_column" :xs="5" :sm="3">
                        <UiAvatar
                            :size="50"
                            :fileName="avatarFileName"
                            :agentNo="agentInfo.agentNo"
                            @click.native="showAgentDetail(agentInfo.agentNo)"
                        ></UiAvatar>
                        <!-- TODO:隱藏滿意度 -->
@@ -44,8 +44,12 @@
                            @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>
@@ -129,12 +133,13 @@
<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({
@@ -228,27 +233,6 @@
      }
    }
    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;
    }
@@ -333,7 +317,7 @@
                ...res,
                satisfactionScore:  this.agentInfo['appointmentScore'],
            };
            this.width = isMobileDevice() ? '80%' : '';
            this.width = UtilsService.isMobileDevice() ? '80%' : '';
            this.isVisibleDialog = true;
        });
    }
@@ -348,13 +332,18 @@
    }
    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();
        });