From f90c94f20b5f11d3b3ce0164d619c0112d5158c9 Mon Sep 17 00:00:00 2001 From: Mila <Mila@pollex.com.tw> Date: 星期四, 20 一月 2022 18:23:56 +0800 Subject: [PATCH] update: TODO#133100 顧問端:header增加顧問頭像圖示 --- PAMapp/components/Consultant/ConsultantList.vue | 51 ++++++++++++++++++++++++++++++++++----------------- 1 files changed, 34 insertions(+), 17 deletions(-) diff --git a/PAMapp/components/Consultant/ConsultantList.vue b/PAMapp/components/Consultant/ConsultantList.vue index 3297855..06ccd84 100644 --- a/PAMapp/components/Consultant/ConsultantList.vue +++ b/PAMapp/components/Consultant/ConsultantList.vue @@ -1,44 +1,61 @@ <template> <div> - - <template v-if="agents.length > 0"> + <template v-if="agentList.length > 0"> <ConsultantCard - v-for="(agent, index) in agents" + v-for="(agent, index) in agentList" :key="index" :agentInfo="agent" - @removeAgent="removeAgent" ></ConsultantCard> </template> - <template v-if="isLogin && agents.length === 0"> + <template v-if="isUserLogin && agentList.length === 0"> <div class="emptyRowStyle"> - <div class="smTxt txt">����撌脤憿批��</div> + <div class="smTxt txt">{{ noDataPlaceholder }}</div> </div> </template> - <template v-if="!isLogin"> + <template v-if="!isUserLogin"> <div class="emptyRowStyle"> - <div class="mdTxt login" @click="$router.push('/login')">��</div> - <div class="smTxt txt">���憭�</div> + <div class="mdTxt login fix-chrome-click--issue" @click="$router.push('/login')">�� | 閮餃��</div> + <div class="smTxt txt ">���憭�</div> </div> </template> </div> </template> <script lang="ts"> -import { Vue, Component, Prop, Emit } from 'nuxt-property-decorator'; -import { Consultants } from '~/assets/ts/api/consultant'; -import { isLogin } from '~/assets/ts/auth'; +import { Consultant } from '~/shared/models/consultant.model'; +import { Vue, Component, Prop } from 'nuxt-property-decorator'; +import authService from '~/shared/services/auth.service'; @Component export default class ConsultantList extends Vue { - @Prop() agents!: Consultants[]; + @Prop() + agents!: Consultant[]; - get isLogin() { - return isLogin(); + @Prop() + title! : string; + + isUserLogin = false; + + ////////////////////////////////////////////////////////////////////// + + get agentList(){ + return this.agents.map((agentDto)=> + ({...agentDto,customerScore:0,}) + ) } - @Emit('removeAgent') removeAgent(agentId: number) { - return agentId; + get noDataPlaceholder(): string { + return this.title === 'contactedList' + ? '����撌脰蝯⊿“���' + : '����撌脤憿批��'; } + + ////////////////////////////////////////////////////////////////////// + + mounted() { + this.isUserLogin = authService.isUserLogin(); + } + } </script> -- Gitblit v1.8.0