From 8c3d81576f29541cd6f19fe41397d1f67f2dda80 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期二, 18 一月 2022 08:50:53 +0800
Subject: [PATCH] refactor: clientCard

---
 PAMapp/components/Client/ClientCard.vue |  197 ++++++++++++++++++++++++-------------------------
 1 files changed, 97 insertions(+), 100 deletions(-)

diff --git a/PAMapp/components/Client/ClientCard.vue b/PAMapp/components/Client/ClientCard.vue
index 47bc83b..faa1c35 100644
--- a/PAMapp/components/Client/ClientCard.vue
+++ b/PAMapp/components/Client/ClientCard.vue
@@ -6,7 +6,7 @@
             class="rowStyle cursor--pointer"
             justify="space-between"
             :class="{'new': newAppointment }"
-            @click.native="viewDetail"
+            @click.native="viewAppointmentDetail"
         >
         <div class="test">
             <div class="unread" v-if="isReserved">
@@ -93,9 +93,9 @@
         </el-row>
 
         <Ui-Dialog
-            :isVisible.sync="isVisibleDialog"
+            :isVisible.sync="isShowInformDialog"
             :width="dialogWidth"
-            @closeDialog="closeDialog"
+            @closeDialog="closeInformDialog"
             class="pam-myDemand-dialog"
         >
             <h5 class="subTitle text--center mb-30"
@@ -158,10 +158,10 @@
           :client="client"
           :isVisible.sync="isShowAddInterviewDialog">
         </InterviewMsg>
-        <PopUpFrame :isOpen.sync="showInviteReview">
+        <PopUpFrame :isOpen.sync="isShowInviteReviewDialog">
           <div class="text--middle invite-review">
             <div class="mb-30 mt-10">撌脩�遛��漲</div>
-            <div class="text--primary text--middle cursor--pointer text--underline" @click="showInviteReview = false" :size="'250px'">������</div>
+            <div class="text--primary text--middle cursor--pointer text--underline" @click="isShowInviteReviewDialog = false" :size="'250px'">������</div>
           </div>
         </PopUpFrame>
     </div>
@@ -209,22 +209,20 @@
     storageClearAppointmentIdFromMsg!: () => void;
 
     contactStatus            = ContactStatus;
+
     dialogWidth              = '';
     hideReviews              = hideReviews;
     isEdit                   = false;
     isShowAddInterviewDialog = false;
-    isVisibleDialog          = false;
+    isShowInformDialog       = false;
+    isShowInviteReviewDialog = false;
     memo                     = '';
-    showInviteReview = false;
-
-
-    // currentAppointmentStatus = this.contactStatus.RESERVED;
 
     memoInfo: AppointmentMemoInfo = {
         appointmentId: 0,
         content      : '',
         id           : 0
-    }
+    };
 
     //////////////////////////////////////////////////////////////////////
 
@@ -247,7 +245,7 @@
 
     //////////////////////////////////////////////////////////////////////
 
-    viewDetail(): void {
+    viewAppointmentDetail(): void {
       this.$router.push(`/appointment/${this.client.id}`);
     }
 
@@ -264,62 +262,7 @@
     }
 
     inviteReview(): void {
-      this.showInviteReview = true ;
-    }
-
-    get newAppointment(): boolean {
-      return !this.client.consultantViewTime
-            && this.client.communicateStatus === 'reserved';
-    }
-
-    get isReserved() {
-      return this.client.communicateStatus === 'reserved';
-    }
-
-    get isRead() {
-      return !!this.client.consultantReadTime;
-    }
-
-    get requirements() {
-        return this.client.requirement.split(',');
-    }
-
-    get gender() {
-        if (this.client.gender) {
-            return this.client.gender === 'male' ? '���' : '憟單��';
-        }
-        return '';
-    }
-
-    get hopeContactTime() {
-        const contactList = this.client.hopeContactTime.split("'").map(item => item.slice(0, item.length));
-        return contactList.filter(item => !!item && item !== ",")
-    }
-
-    get reservedTxt(): string {
-        if (this.isReserved) {
-            return this.client.consultantReadTime ? '撌脰�' : '�霈�';
-        } else {
-            return '撌脰蝯�'
-        }
-    }
-
-    get displayTime(): string {
-        if (this.isReserved) {
-            return this.client.appointmentDate;
-        } else {
-            return this.client.lastModifiedDate;
-        }
-    }
-
-    get time() {
-        const formatDate = (this.$options.filters as any).formatDate(this.displayTime);
-        return formatDate.split(' ')[1]
-    }
-
-    get date() {
-        const formatDate = (this.$options.filters as any).formatDate(this.displayTime);
-        return formatDate.split(' ')[0];
+      this.isShowInviteReviewDialog = true ;
     }
 
     openDetail() {
@@ -327,17 +270,17 @@
             (this.$refs.clientCardRef as any).$el.classList.add('currentShowStyle');
         }, 0)
         this.dialogWidth = UtilsService.isMobileDevice() ? '80%' : '';
-        this.isVisibleDialog = true;
+        this.isShowInformDialog = true;
     }
 
     markAppointment() {
         myConsultantService.markAsContact(this.client.id).then(data => {
             this.updateMyAppointment(data);
-            this.isVisibleDialog = false;
+            this.isShowInformDialog = false;
         })
     }
 
-    closeDialog(): void {
+    closeInformDialog(): void {
       const unread = !this.client.consultantReadTime;
         if (unread) {
             appointmentService.recordRead(this.client.id).then((_) => {
@@ -404,54 +347,109 @@
         this.memo = this.memoInfo.content;
     }
 
+      get newAppointment(): boolean {
+      return !this.client.consultantViewTime
+            && this.client.communicateStatus === 'reserved';
+    }
+
+    get isReserved() {
+      return this.client.communicateStatus === 'reserved';
+    }
+
+    get isRead() {
+      return !!this.client.consultantReadTime;
+    }
+
+    get requirements() {
+        return this.client.requirement.split(',');
+    }
+
+    get gender() {
+        if (this.client.gender) {
+            return this.client.gender === 'male' ? '���' : '憟單��';
+        }
+        return '';
+    }
+
+    get hopeContactTime() {
+        const contactList = this.client.hopeContactTime.split("'").map(item => item.slice(0, item.length));
+        return contactList.filter(item => !!item && item !== ",")
+    }
+
+    get reservedTxt(): string {
+        if (this.isReserved) {
+            return this.client.consultantReadTime ? '撌脰�' : '�霈�';
+        } else {
+            return '撌脰蝯�'
+        }
+    }
+
+    get displayTime(): string {
+        if (this.isReserved) {
+            return this.client.appointmentDate;
+        } else {
+            return this.client.lastModifiedDate;
+        }
+    }
+
+    get date() {
+        const formatDate = (this.$options.filters as any).formatDate(this.displayTime);
+        return formatDate.split(' ')[0];
+    }
+
+    get time() {
+        const formatDate = (this.$options.filters as any).formatDate(this.displayTime);
+        return formatDate.split(' ')[1]
+    }
+
 }
 </script>
 
 <style lang="scss" scoped>
     .rowStyle {
-        padding: 10px 15px 10px 5px;
         background-color: $PRIMARY_WHITE;
-        margin-bottom: 10px;
-        display: flex;
-        justify-content: space-between;
-
+        border-left     : solid 4px transparent;
+        display         : flex;
+        justify-content : space-between;
+        margin-bottom   : 10px;
+        padding         : 10px 15px 10px 5px;
         transition: background-color 0.5s;
         &.new {
-            border-left: solid 4px $YELLOW;
+            border-color: $YELLOW;
         }
         &.currentShowStyle {
             background-color: rgba(236, 195, 178, 0.5);
-            transition: background-color 0.5s;
+            transition      : background-color 0.5s;
         }
         .unread {
             align-self: center;
             .circle {
-                width: 10px;
-                height: 10px;
-                border-radius: 50%;
                 background-color: $PRIMARY_RED;
-                margin: auto;
+                border-radius   : 50%;
+                height          : 10px;
+                margin          : auto;
+                width           : 10px;
             }
         }
         .satisfaction {
-            font-size: 12px;
+            font-size  : 12px;
             font-weight: bold;
-            margin-top: 5px;
+            margin-top : 5px;
             .unfilled {
+                color      : $MID_GREY;
                 font-weight: lighter;
-                color: $MID_GREY;
             }
         }
         .professionals {
-            overflow: hidden;
-            white-space: nowrap;
+            overflow     : hidden;
             text-overflow: ellipsis;
+            white-space  : nowrap;
             .professionalsTxt {
-                font-size: 12px;
+                font-size   : 12px;
                 margin-right: 5px;
             }
             .noProfessionalsTxt {
-                color: $PRUDENTIAL_GREY;
+                color      : $PRUDENTIAL_GREY;
                 font-weight: lighter;
             }
         }
@@ -469,24 +467,23 @@
         }
     }
     .flex-column {
-        display: flex;
-        flex-direction: column;
+        display        : flex;
+        flex-direction : column;
         justify-content: space-between;
     }
     .dialogTxt {
-        font-size: 20px;
-        overflow-y:scroll;
+        font-size : 20px;
         max-height: 25vh;
+        overflow-y: scroll;
         @include desktop {
             height: 400px;
         }
     }
     .memoTitleStyle {
-        display: flex;
-        flex-direction: row;
+        display        : flex;
+        flex-direction : row;
         justify-content: space-between;
-
-        .edit {
+       .edit {
             align-self: flex-end;
         }
     }
@@ -498,11 +495,11 @@
     }
     .invite-msg{
       color: $PRIMARY_RED;
-        @extend .text--underline;
+      @extend .text--underline;
     }
   .invite-review{
-    display: flex;
+    align-items   : center;
+    display       : flex;
     flex-direction: column;
-    align-items: center;
   }
 </style>

--
Gitblit v1.8.0