From 505f666d3ecf3688778c079a8bbfb366d695cf22 Mon Sep 17 00:00:00 2001 From: wayne <wayne8692wayne8692@gmail.com> Date: 星期五, 12 十一月 2021 17:32:08 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- PAMapp/pages/agentInfo/_agentNo.vue | 40 +++++++++++++++++++--------------------- 1 files changed, 19 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..559b029 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; -- Gitblit v1.8.0