保誠-保戶業務員媒合平台
Tomas
2023-08-05 863699eb004f0f8024371a16c43079651705810f
PAMapp/pages/satisfactionList.vue
@@ -8,11 +8,20 @@
      </div>
      <template v-if="mapUnReviewLogList.length">
        <div class="satisfaction-card" v-for="(item, index) in mapUnReviewLogList" :key="index">
          <div class="satisfaction-card-content">
          <div class="satisfaction-card-content"  v-if="item.agentName">
            <UiAvatar :size="80" :agentNo="item.agentNo"></UiAvatar>
            <div class="satisfaction-card-text">對於顧問
                <span class="text--primary text--bold">{{item.agentName}}</span>
                的整體服務,您給予幾顆星評價?
            </div>
          </div>
           <div class="satisfaction-card-content"  v-else>
            <div class="pam-satisfaction-avatar">
              <span class="pam-satisfaction-avatar-txt">平台</span>
              </div>
            <div class="satisfaction-card-text" >對於
                <span class="text--primary text--bold">服務媒合</span>
                平台的整體服務,您給予幾顆星評價?
            </div>
          </div>
          <el-rate
@@ -46,9 +55,10 @@
<script lang="ts">
import { Vue, Component, Action, State, Watch } from 'nuxt-property-decorator';
import { AppointmentLog } from '~/shared/models/appointment.model';
import { UserReviewsConsultantsParams } from '~/shared/models/reviews.model';
import reviewsService from '~/shared/services/reviews.service';
import { AppointmentLog } from '~/shared/models/appointment.model';
import { UserReviewParams } from '~/shared/models/reviews.model';
@Component({
  layout: 'home'
@@ -79,19 +89,29 @@
  ///////////////////////////////////////////////////////
  sent() {
    const reviewParams: UserReviewsConsultantsParams[] = this.mapUnReviewLogList
                .filter(item => item.satisfaction > 0)
                .map(item => {
                  return {
                    appointmentId: item.appointmentId,
                    score: item.satisfaction
                  }
                })
  async sent() {
    const reviewParams: UserReviewParams[] = this.mapUnReviewLogList
      .filter(item => item.satisfaction > 0)
      .map(item => {
        return {
          appointmentId: item.appointmentId,
          score: item.satisfaction,
          type: item.type
        };
      });
        reviewsService.allUserReviewsConsultants(reviewParams).then((res) => {
            this.showConfirmPopup = true;
        });
    try {
      const response = await reviewsService.allUserReviewsConsultants(reviewParams);
      if (response !== null) {
        this.showConfirmPopup = true;
      } else {
        throw new Error('reviewsService.allUserReviewsConsultants returned null-like value.');
      }
    } catch (error) {
      console.error('An error occurred while sending reviews:', error);
      // 可以在此處處理錯誤或回傳預設值
      throw error;
    }
  }
  closePopup() {
@@ -147,6 +167,19 @@
      font-size: 20px;
      padding-left: 10px;
    }
    .pam-satisfaction-avatar{
      height: 80px;
      width: 80px;
      border-radius: 50%;
      background-color:#F09491;
      justify-content: center;
      align-items: center;
      display: flex;
      .pam-satisfaction-avatar-txt{
        font-size: 18px;
        color: #fff;
      }
    }
    @include desktop {
        justify-content: flex-start;