From 97e093b1117b68948d0f9adefacc5368014db380 Mon Sep 17 00:00:00 2001
From: Jack <jack.su@pollex.com.tw>
Date: 星期日, 14 十一月 2021 22:43:09 +0800
Subject: [PATCH] Merge branch 'master' of ssh://192.168.0.10:29418/pcalife/PAM

---
 PAMapp/components/Client/ClientCard.vue |   53 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/PAMapp/components/Client/ClientCard.vue b/PAMapp/components/Client/ClientCard.vue
index 5594a0e..477cf7f 100644
--- a/PAMapp/components/Client/ClientCard.vue
+++ b/PAMapp/components/Client/ClientCard.vue
@@ -7,18 +7,18 @@
                     src=""
                     class="cursor--pointer"
                 ></el-avatar>
-                <div class="satisfaction">
+                <!-- <div class="satisfaction">
                     <i class="icon-star pam-icon icon--yellow satisfaction"></i>
                     <span>{{'1'}}</span>
-                </div>
+                </div> -->
             </el-col>
             <el-col :xs="14" :sm="15">
                 <div class="smTxt_bold name">{{client.name}}</div>
                 <div class="message">������</div>
                 <div class="professionals">
-                    <template v-if="client.requirements.length > 0">
+                    <template v-if="client.requirement">
                         <span
-                            v-for="(item, index) in client.requirements"
+                            v-for="(item, index) in requirements"
                             :key="index"
                             class="professionalsTxt"
                         >#{{item}}</span>
@@ -46,18 +46,18 @@
         >
             <h5 class="subTitle text--center mb-30"
             >{{isReserved ? '������' : '撌脰蝯∟���'}}</h5>
-            <p class="smTxt text-right">隞予 10:00</p>
+            <p class="smTxt text-right">{{client.appointmentDate | formatDate}}</p>
             <div class="dialogTxt">
                 <p>憪��{client.name}}</p>
-                <p>�閰梧��0912345678</p>
-                <p>Email嚗�</p>
+                <p>�閰梧�{client.phone}}</p>
+                <p>Email嚗{client.email}}</p>
                 <p>�批嚗{client.gender === 'male' ? '���' : '憟單��'}}</p>
                 <p>撟湧翩嚗{client.age}}</p>
-                <p>�璆哨����璆�</p>
+                <p>�璆哨�{client.job}}</p>
                 <p>��瘙�{client.requirements}}</p>
-                <p>��蝯⊥�挾銝�嚗���,��� 18:00~21:00</p>
-                <div class="mt-30 text--center">
-                    <el-button>{{isReserved ? '璅酉�撌脤��蝯�' : '��遛��漲'}}</el-button>
+                <p>��蝯⊥�挾銝�嚗{hopeContactTime}}</p>
+                <div class="mt-30 text--center" v-if="isReserved">
+                    <el-button>璅酉�撌脤��蝯�</el-button>
                 </div>
             </div>
         </Ui-Dialog>
@@ -66,25 +66,40 @@
 
 <script lang="ts">
 import { Vue, Component, Prop } from 'nuxt-property-decorator';
+import { ClientInfo } from '~/assets/ts/api/consultant';
 import { isMobileDevice } from '~/assets/ts/device';
-import { Clients } from '~/pages/clientReservedList.vue';
 
 @Component
 export default class ClientList extends Vue {
-    @Prop() client!: Clients;
+    @Prop() client!: ClientInfo;
     isVisibleDialog = false;
     width = '';
 
+    get requirements() {
+        return this.client.requirement.split(',');
+    }
+
+    get hopeContactTime() {
+        return this.client.hopeContactTime.slice(1, this.client.hopeContactTime.length - 1)
+    }
     get time() {
-        const hours = this.client.time.getHours();
-        const minutes = this.client.time.getMinutes();
-        return `${hours} : ${minutes}`
+        if (this.client.appointmentDate) {
+            const newDate = new Date(this.client.appointmentDate);
+            const hours = newDate.getHours();
+            const minutes = newDate.getMinutes();
+            return `${hours} : ${minutes}`
+        }
+        return ''
     }
 
     get date() {
-        const month = this.client.time.getMonth();
-        const date = this.client.time.getDate();
-        return `${month} / ${date}`
+        if (this.client.appointmentDate) {
+            const newDate = new Date(this.client.appointmentDate);
+            const month = newDate.getMonth();
+            const date = newDate.getDate();
+            return `${month} / ${date}`
+        }
+        return ''
     }
 
     get isReserved() {

--
Gitblit v1.8.0