保誠-保戶業務員媒合平台
Mila
2021-12-10 76c1ce3c2eb001560bfb785f7b2f62d4ec64dcb6
PAMapp/components/Consultant/ConsultantList.vue
@@ -1,14 +1,14 @@
<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"
            ></ConsultantCard>
        </template>
        <template v-if="isLogin && agents.length === 0">
        <template v-if="isLogin && agentList.length === 0">
            <div class="emptyRowStyle">
                <div class="smTxt txt">您目前無已選顧問</div>
            </div>
@@ -23,16 +23,24 @@
</template>
<script lang="ts">
import { Vue, Component, Prop } from 'nuxt-property-decorator';
import { Consultants } from '~/assets/ts/api/consultant';
import { isLogin } from '~/assets/ts/auth';
import { Vue, Component, Prop, namespace } from 'nuxt-property-decorator';
import { Consultant } from '~/assets/ts/models/consultant.model';
import { Role } from '~/assets/ts/models/enum/Role';
const roleStorage = namespace('localStorage');
@Component
export default class ConsultantList extends Vue {
    @Prop() agents!: Consultants[];
    @Prop() agents!: Consultant[];
    @roleStorage.Getter currentRole!:string;
    get isLogin() {
        return isLogin();
        return this.currentRole === Role.USER;
    }
    get agentList(){
        return this.agents.map((agentDto)=>
            ({...agentDto,customerScore:0,})
        )
    }
}