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/Consultant/ConsultantCard.vue |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/PAMapp/components/Consultant/ConsultantCard.vue b/PAMapp/components/Consultant/ConsultantCard.vue
index 47965a1..d74a6eb 100644
--- a/PAMapp/components/Consultant/ConsultantCard.vue
+++ b/PAMapp/components/Consultant/ConsultantCard.vue
@@ -9,7 +9,7 @@
                             :size="50"
                             :src="agentInfo.img"
                             class="cursor--pointer"
-                            @click.native="$router.push(`/agentInfo`)"
+                            @click.native="showAgentDetail(agentInfo.agentNo);"
                         ></el-avatar>
                         <div class="satisfaction">
                             <i class="icon-star pam-icon icon--yellow satisfaction"></i>
@@ -27,7 +27,8 @@
                         </div>
                         <div
                             class="delete"
-                            v-if="agentInfo.contactStatus === 'picked'"
+                            v-if="agentInfo.contactStatus !== 'reserved'
+                                || agentInfo.contactStatus !== 'contacted'"
                             @click="removeAgent"
                         >蝘駁</div>
                     </el-col>
@@ -37,7 +38,7 @@
                             @click="reserveCommunication"
                             :class="agentInfo.contactStatus + 'Btn'"
                         >{{ contactTxt }}</el-button>
-                        <div class="updateTime">{{updateTime}}</div>
+                        <div class="updateTime" v-if="updateTime">{{updateTime | formatDate}}</div>
                     </el-col>
                 </el-row>
             </el-col>
@@ -86,18 +87,12 @@
     }
 
     get updateTime() {
-        const newDate = new Date(this.agentInfo.updateTime);
-        let year = newDate.getFullYear();
-        let month = newDate.getMonth() + 1;
-        let date = newDate.getDate();
-        let hours = newDate.getHours();
-        let minutes = newDate.getMinutes();
-        return `${year}/${month}/${date} ${hours} : ${minutes}`
+        return isLogin() ? this.agentInfo.updateTime : '';
     }
-
     reserveCommunication() {
-        if (this.agentInfo.contactStatus === 'picked') {
-            isLogin() ? this.$router.push('/questionnaire') : this.$router.push('/login');
+        const contactStatus = this.agentInfo.contactStatus;
+        if (contactStatus !== 'reserved' && contactStatus !== 'contacted') {
+            isLogin() ? this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`) : this.$router.push('/login');
         } else {
             this.width = isMobileDevice() ? '80%' : '';
             this.isVisibleDialog = true;
@@ -107,6 +102,10 @@
     @Emit('removeAgent') removeAgent() {
         return this.agentInfo.agentNo;
     }
+
+    showAgentDetail(agentNo: string): void {
+        this.$router.push(`/agentInfo/${agentNo}`);
+    }
 }
 </script>
 

--
Gitblit v1.8.0