From 4ffc0db28966ad106ded6ff0058c2dad7850bf78 Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期五, 12 十一月 2021 16:19:03 +0800
Subject: [PATCH] TODO#130024 [顧問細節] API 串接

---
 PAMapp/pages/agentInfo/_agentNo.vue |   48 +++++++++++++++++++++++++++---------------------
 1 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/PAMapp/pages/agentInfo/index.vue b/PAMapp/pages/agentInfo/_agentNo.vue
similarity index 83%
rename from PAMapp/pages/agentInfo/index.vue
rename to PAMapp/pages/agentInfo/_agentNo.vue
index 91391e9..0c9d297 100644
--- a/PAMapp/pages/agentInfo/index.vue
+++ b/PAMapp/pages/agentInfo/_agentNo.vue
@@ -3,10 +3,10 @@
       <el-row
         type="flex"
         justify="center">
-         <el-avatar
+        <el-avatar
           size="large"
           src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png">
-         </el-avatar>
+        </el-avatar>
       </el-row>
 
       <el-row
@@ -15,7 +15,7 @@
         justify="center"
         align="middle">
           <i class="pam-icon icon--primary icon-star"></i>
-          <h3 class="mdTxt">{{ agentInfo.avgReviews }}</h3>
+          <h3 class="mdTxt">{{ agentInfo.avgScore }}</h3>
       </el-row>
 
       <el-row
@@ -158,27 +158,23 @@
 </template>
 
 <script lang="ts">
+import { Context } from '@nuxt/types';
 import { Vue, Component } from 'vue-property-decorator';
+import { getConsultantDetail } from '~/assets/ts/api/consultant';
 
 @Component
 export default class AgentInfoComponent extends Vue {
-  agentInfo: AgentInfo = {
-    name: '�蝢��',
-    role: '隡舀��蝬�鈭�',
-    avgReviews: 4.8,
-    title: '撠����',
-    phoneNumber: '0912345689',
-    serveArea: '������������',
-    companyAddress: '����縑蝢拙�敹�頝臭�畾�1���',
-    lastestLoginTime: new Date(),
-    seniority: '4撟�2���',
-    suitability: 53,
-    evaluation: 31,
-    expertises: ['鞎∪����', '鞈蝘餉��', '蝭�蝔�', '璅暑��隡�'],
-    concept: '憯賡頝臭���敺���策摰X靽∩遙����������憟賜�瘜��平隞乩�����蝘���鈭箇敹急����縑敹萄����旦�靽∴���末��平��犖�嚗������憿敹鈭箇����瘞貊���ˊ�鈭平��������',
-    experiences: ['�憭扯瓷��頂', '蝢��移蝞葦��'],
-    awards: '��嚗�2020撟港摩璅�之��雿單平�� ����嚗犖頨思�璆剖�霅��馳�隞�霅�犖頨思�隞���犖霅�瓷�靽隞���犖霅'
+  agentInfo!: AgentInfo;
+
+  async asyncData(context: Context) {
+    const agentNo = context.route.params.agentNo;
+    let agentInfo = {};
+    await getConsultantDetail(agentNo).then((res) => agentInfo = res.data )
+    return {
+      agentInfo
+    }
   }
+
 
   get agentName(): string {
     return `${this.agentInfo.name}(${this.agentInfo.role})`;
@@ -187,13 +183,15 @@
 
 interface AgentInfo {
   name: string;
+  agentNo:string;
   role: string;
-  avgReviews: number;
+  image: string;
+  avgScore: number;
   title: string;
   phoneNumber: string;
   serveArea: string;
   companyAddress: string;
-  lastestLoginTime: Date;
+  lastestLoginTime: Date | null;
   seniority: string;
   suitability: number;
   evaluation: number;
@@ -253,3 +251,11 @@
 }
 
 </style>
+
+function getConsultantDetail() {
+  throw new Error('Function not implemented.');
+}
+
+function getConsultantDetail() {
+  throw new Error('Function not implemented.');
+}

--
Gitblit v1.8.0