保誠-保戶業務員媒合平台
PAMapp/pages/index.vue
@@ -22,7 +22,7 @@
                </el-col>
                <el-col
                    :span="8"
                    class="mdTxt readMore"
                    class="mdTxt readMore fix-chrome-click--issue"
                    v-if="consultantList.length > 3"
                    @click.native="routerPush('/myConsultantList/consultantList')">查看更多</el-col>
            </el-row>
@@ -62,20 +62,27 @@
        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)
        if (agentNoList.length > 0) {
            addFavoriteConsultant(agentNoList).then(res => res);
            addFavoriteConsultant(agentNoList).then(res => this.getMyConsutant());
            localStorage.removeItem('favoriteConsultant');
            return;
        }
        this.getMyConsutant();
    }
    routerPush(path: string) {