| | |
| | | import { Context } from '@nuxt/types'; |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { Vue, Component } from 'vue-property-decorator'; |
| | | import { getConsultantDetail } from '~/assets/ts/api/consultant'; |
| | | import { Role } from '~/assets/ts//models/enum/Role'; |
| | | |
| | | import myConsultantService from '~/assets/ts/services/my-consultant.service'; |
| | | import { AgentInfo } from '~/assets/ts/models/agent-info.model'; |
| | | import { hideReviews } from '~/assets/ts/const/hide-reviews'; |
| | | import { Role } from '~/assets/ts//models/enum/Role'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | |
| | | @Component |
| | | export default class AgentInfoComponent extends Vue { |
| | | @roleStorage.Getter currentRole!:string|null; |
| | |
| | | fieldInfoTitle = ''; |
| | | fieldInfoDesc = ''; |
| | | hideReviews = hideReviews ; |
| | | 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})`; |
| | | } |
| | | |
| | | alertAddSuccess() { |
| | | async asyncData(context: Context) { |
| | | const agentNo = context.route.params.agentNo; |
| | | return { |
| | | agentInfo: await myConsultantService.getConsultantDetail(agentNo).then((res) => res) |
| | | } |
| | | } |
| | | |
| | | alertAddSuccess(): void { |
| | | this.isAlertAddSuccess = true; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | interface AgentInfo { |
| | | name : string; |
| | | agentNo : string; |
| | | role : string; |
| | | img : string; |
| | | avgScore : number; |
| | | title : string; |
| | | phoneNumber : string; |
| | | serveArea : string; |
| | | companyAddress : string; |
| | | seniority : string; |
| | | suitability : number; |
| | | evaluation : number; |
| | | expertise : string[]; |
| | | concept : string; |
| | | experiences : string[]; |
| | | awards : string; |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |