保誠-保戶業務員媒合平台
Mila
2021-11-16 d4e6cf05333a148f238dd1e4be3862f1197cbe5d
update: 我的顧問清單/預約清單: 按照時間排序
修改6個檔案
52 ■■■■ 已變更過的檔案
PAMapp/assets/ts/api/consultant.ts 2 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Consultant/ConsultantCard.vue 12 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Consultant/ConsultantList.vue 5 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/index.vue 16 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myAppointmentList.vue 9 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myConsultantList.vue 8 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/assets/ts/api/consultant.ts
@@ -106,6 +106,8 @@
    contactStatus?: string;
    latestAppointmentId: number;
    role: string;
    image?: string;
    expertises?: string;
}
export interface FastQueryParams {
PAMapp/components/Consultant/ConsultantCard.vue
@@ -7,7 +7,7 @@
                    <el-col class="flex_column" :xs="5" :sm="3">
                        <UiAvatar
                            :size="50"
                            :fileName="agentInfo.img"
                            :fileName="avatarFileName"
                            @click.native="showAgentDetail(agentInfo.agentNo)"
                        ></UiAvatar>
                        <div class="satisfaction">
@@ -20,7 +20,7 @@
                        <div class="professionals">
                            <span
                                class="professionalsTxt"
                                v-for="(expertise, index) in agentInfo.expertise"
                                v-for="(expertise, index) in expertises"
                                :key="index"
                            >#{{expertise}}</span>
                        </div>
@@ -106,6 +106,14 @@
        name: ''
    };
    get avatarFileName() {
        console.log('avatarFileName')
        return this.agentInfo.img ? this.agentInfo.img : this.agentInfo.image;
    }
    get expertises() {
        return this.agentInfo.expertise ? this.agentInfo.expertise : this.agentInfo.expertises;
    }
    get gender() {
        if (this.appointmentDetail.gender) {
            return this.appointmentDetail.gender === 'male' ? '男性' : '女性';
PAMapp/components/Consultant/ConsultantList.vue
@@ -1,5 +1,6 @@
<template>
    <div>
        <template v-if="agents.length > 0">
            <ConsultantCard
                v-for="(agent, index) in agents"
@@ -8,12 +9,12 @@
                @removeAgent="removeAgent"
            ></ConsultantCard>
        </template>
        <template v-else>
        <template v-if="isLogin && agents.length === 0">
            <div class="emptyRowStyle">
                <div class="smTxt txt">您目前無已選顧問</div>
            </div>
        </template>
        <template v-if="!isLogin && agents.length > 0">
        <template v-if="!isLogin">
            <div class="emptyRowStyle">
                <div class="mdTxt login" @click="$router.push('/login')">登入</div>
                <div class="smTxt txt">查看更多</div>
PAMapp/pages/index.vue
@@ -62,20 +62,28 @@
        if (isLogin()) {
            this.addFavoriteFromStorageToApi();
            getFavoriteConsultant().then((response) => {
                this.consultantList = response.data.filter(item => item.contactStatus !== 'contacted')
            });
        } else {
            this.consultantList = getFavoriteFromStorage();
        }
    }
    getMyConsutant() {
        getFavoriteConsultant().then((response) => {
            this.consultantList = response.data
                .filter(item => item.contactStatus !== 'contacted')
                .sort((a, b) => a.updateTime > b.updateTime ? -1 : 1)
        });
    }
    addFavoriteFromStorageToApi() {
        const agentNoList = getFavoriteFromStorage().map(i => i.agentNo)
        console.log(agentNoList, 'agentNoList')
        if (agentNoList.length > 0) {
            addFavoriteConsultant(agentNoList).then(res => res);
            addFavoriteConsultant(agentNoList).then(res => this.getMyConsutant());
            localStorage.removeItem('favoriteConsultant');
            return;
        }
        this.getMyConsutant();
    }
    routerPush(path: string) {
PAMapp/pages/myAppointmentList.vue
@@ -42,8 +42,13 @@
        let clients: ClientInfo[] = [];
        await getMyAppointmentList().then((res: any) => clients = res.data)
        contactedList = clients.filter(item => item.communicateStatus === 'contacted');
        appointmentList = clients.filter(item => item.communicateStatus === 'reserved');
        contactedList = clients
            .filter(item => item.communicateStatus === 'contacted')
            .sort((a, b) => a.appointmentDate > b.appointmentDate ? -1 : 1);
        appointmentList = clients
            .filter(item => item.communicateStatus === 'reserved')
            .sort((a, b) => a.appointmentDate > b.appointmentDate ? -1 : 1);;
        return {
            clients,
            contactedList,
PAMapp/pages/myConsultantList.vue
@@ -56,8 +56,12 @@
            agents = getFavoriteFromStorage();
        }
        contactedList = agents.filter(item => item.contactStatus === 'contacted');
        consultantList = agents.filter(item => item.contactStatus !== 'contacted');
        contactedList = agents
            .filter(item => item.contactStatus === 'contacted')
            .sort((a, b) => a.updateTime > b.updateTime ? -1 : 1);
        consultantList = agents
            .filter(item => item.contactStatus !== 'contacted')
            .sort((a, b) => a.updateTime > b.updateTime ? -1 : 1);
        return {
            agents,