From 1adfdb0ffed271b97cf88471c94ab2735dc12b35 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期六, 05 八月 2023 17:43:34 +0800
Subject: [PATCH] Fixed: [弱掃] p13.1 Bad use of null-like value

---
 PAMapp/components/Client/ClientCard.vue |   44 +++++++++++++++++++++++++++-----------------
 1 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/PAMapp/components/Client/ClientCard.vue b/PAMapp/components/Client/ClientCard.vue
index 2200975..051bc23 100644
--- a/PAMapp/components/Client/ClientCard.vue
+++ b/PAMapp/components/Client/ClientCard.vue
@@ -54,7 +54,6 @@
                 ></el-avatar>
                 <div class="satisfaction" v-if="!hideReviews">
                     <template v-if="client.satisfactionScore">
-                        TODO:���遛��漲
                         <i class="icon-star pam-icon icon--yellow satisfaction"></i>
                         <span>{{client.satisfactionScore}}</span>
                     </template>
@@ -78,12 +77,12 @@
                   v-else-if="client.communicateStatus === contactStatus.CONTACTED">
                   蝯��
                 </div>
-                <div
+                <!-- <div
                   class="invite-msg smTxt_bold"
                   @click.stop="inviteReview"
                   v-else-if="!client.satisfactionScore">
                   ��遛��漲
-                </div>
+                </div> -->
 
                 <div
                     class="date xsTxt text--black"
@@ -119,7 +118,8 @@
                 <p>�批嚗�<span>{{gender}}</span></p>
                 <p>撟湧翩嚗�<span>{{client.age | toAgeLabel }}</span></p>
                 <p>�璆哨��<span>{{client.job}}</span></p>
-                <p>��瘙��<span>{{client.requirement.split(',').join('��')}}</span></p>
+                <p>隢株岷�撘��<span>{{client.consultationMethod | toConsultationMethod }}</span></p>
+                <p>��瘙��<span>{{ client.requirement ? client.requirement.split(',').join('��') : '--' }}</span></p>
                 <p v-for="(item, index) in hopeContactTime"
                     :key="index"
                 >��蝯⊥�挾{{index + 1 | formatNumber}}嚗�<span>{{ item | formatHopeContactTime}}</span></p>
@@ -213,6 +213,9 @@
     @appointmentStore.Action
     getAppointmentDetail!: (appointmentId: number) => Promise<Appointment>;
 
+    @appointmentStore.Action
+    updateAppointmentDetail!: (id: number) => Appointment;
+
     @appointmentStore.Getter
     appointmentProgress!: ContactStatus;
 
@@ -258,7 +261,10 @@
 
     viewAppointmentDetail(): void {
       this.getAppointmentDetail(this.client.id).then((_) => {
-        this.readAppointment();
+        const unread = !this.client.consultantReadTime;
+        if (unread) {
+          this.readAppointment();
+        }
         this.$router.push(`/appointment/${this.client.id}`);
       });
     }
@@ -268,14 +274,15 @@
     }
 
     navigateToCloseAppointment(): void {
-      this.$router.push(`/appointment/${this.client.id}/close`);
+      this.getAppointmentDetail(this.client.id).then((_) => {
+        this.$router.push(`/appointment/${this.client.id}/close`);
+      });
     }
 
     inviteReview(): void {
         reviewsService.sendSatisfactionToClient(this.client.id).then(res => {
             this.isShowInviteReviewDialog = true ;
         })
-
     }
 
     openDetail() {
@@ -300,14 +307,12 @@
     }
 
     private readAppointment(): void {
-        const unread = !this.client.consultantReadTime;
-        if (unread) {
-            appointmentService.recordRead(this.client.id).then((_) => {
-                const updatedClient = {...this.client};
-                updatedClient.consultantReadTime = new Date().toString();
-                this.updateMyAppointmentList(updatedClient);
-            });
-        };
+      appointmentService.recordRead(this.client.id).then((_) => {
+          const updatedClient = {...this.client};
+          updatedClient.consultantReadTime = new Date().toString();
+          this.updateMyAppointmentList(updatedClient);
+          this.updateAppointmentDetail(this.client.id);
+      });
     }
 
     private clearAppointmentIdFromMsg() {
@@ -378,7 +383,7 @@
     }
 
     get requirements() {
-        return this.client.requirement.split(',');
+        return this.client.requirement ? this.client.requirement.split(',') : [];
     }
 
     get gender() {
@@ -460,10 +465,14 @@
         .professionals {
             overflow     : hidden;
             text-overflow: ellipsis;
-            white-space  : nowrap;
+            display: -webkit-box;
+            -webkit-box-orient: vertical;
+            -webkit-line-clamp: 1;
             .professionalsTxt {
                 font-size   : 12px;
                 margin-right: 5px;
+
+
             }
             .noProfessionalsTxt {
                 color      : $PRUDENTIAL_GREY;
@@ -511,6 +520,7 @@
         display: flex;
     }
     .invite-msg{
+      width: 96px;
       color: $PRIMARY_RED;
       @extend .text--underline;
     }

--
Gitblit v1.8.0