From 54e0b9707bb34259dfccbe0c792b50e12b267e13 Mon Sep 17 00:00:00 2001 From: jack <jack.su@pollex.com.tw> Date: 星期二, 08 八月 2023 17:23:15 +0800 Subject: [PATCH] Merge branch '滲透' of ssh://dev.pollex.com.tw:29418/pcalife/PAM into 滲透 --- PAMapp/pages/satisfactionList.vue | 102 +++++++++++++++++++++++++++++++++++--------------- 1 files changed, 71 insertions(+), 31 deletions(-) diff --git a/PAMapp/pages/satisfactionList.vue b/PAMapp/pages/satisfactionList.vue index 8d52771..57e9110 100644 --- a/PAMapp/pages/satisfactionList.vue +++ b/PAMapp/pages/satisfactionList.vue @@ -6,23 +6,41 @@ <span class="mdTxt">皛踵�漲隤踵</span> <span class="ml-10 text--prudential_grey smTxt_bold">� {{mapUnReviewLogList.length}} 蝑�</span> </div> - <div class="satisfaction-card" v-for="(item, index) in mapUnReviewLogList" :key="index"> - <div class="satisfaction-card-content"> - <UiAvatar :size="80" :agentNo="item.agentNo"></UiAvatar> - <div class="satisfaction-card-text">撠憿批�� - <span class="text--primary text--bold">{{item.agentName}}</span> - ��擃���蝯虫�嗾憿��嚗� + <template v-if="mapUnReviewLogList.length"> + <div class="satisfaction-card" v-for="(item, index) in mapUnReviewLogList" :key="index"> + <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 + v-model="item.satisfaction" + class="pam-satisfaction-rate mt-10 fix-chrome-click--issue" + @change="isBtnDisabled = false" + ></el-rate> </div> - <el-rate - v-model="item.satisfaction" - class="pam-satisfaction-rate mt-10 fix-chrome-click--issue" - @change="isBtnDisabled = false" - ></el-rate> - </div> - <div class="text--center mt-30" v-if="mapUnReviewLogList.length"> - <el-button type="primary" :disabled="isBtnDisabled" @click="sent">�</el-button> - </div> + <div class="text--center mt-30" v-if="mapUnReviewLogList.length"> + <el-button type="primary" :disabled="isBtnDisabled" @click="sent">�</el-button> + </div> + </template> + <template v-else> + <div class="satisfaction-card"> + <div class="satisfaction-card-content"> + ������閬憛怠神��遛��漲隤踵 + </div> + </div> + </template> </div> <PopUpFrame :isOpen.sync="showConfirmPopup" @@ -37,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' @@ -60,31 +79,39 @@ @Watch('unReviewLogList') onUnReviewLogListChange() { - if (this.unReviewLogList.length) { this.mapUnReviewLogList = this.unReviewLogList.map(item => { return { ...item, satisfaction: 0 } }) - } } /////////////////////////////////////////////////////// - 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() { @@ -140,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; -- Gitblit v1.8.0