| | |
| | | <div> |
| | | <Ui-Carousel></Ui-Carousel> |
| | | <div class="page-container"> |
| | | <div class="mb-30"> |
| | | <div> |
| | | <h5 class="mdTxt">預約保險顧問</h5> |
| | | <div class="mt-10 pam-reserveBtn--block"> |
| | | <el-button class="reserveBtn recommendConsultant" |
| | | @click="routerPush('/recommendConsultant')"> |
| | | @click="navigateToRoute('/recommendConsultant')"> |
| | | <p>嚴選配對</p> |
| | | </el-button> |
| | | <el-button class="reserveBtn quickFilter" |
| | | @click="routerPush('/quickFilter')"> |
| | | @click="navigateToRoute('/quickFilter')"> |
| | | <p>快速篩選</p> |
| | | </el-button> |
| | | </div> |
| | |
| | | <el-row class="rowStyle"> |
| | | <el-col :span="16"> |
| | | <span class="mdTxt">我的顧問清單</span> |
| | | <span class="smTxt_bold amount">共 {{consultantList.length}} 筆</span> |
| | | <span class="smTxt_bold amount">共 {{ consultantList.length }} 筆</span> |
| | | </el-col> |
| | | <el-col :span="8" |
| | | class="mdTxt readMore fix-chrome-click--issue" |
| | | v-if="consultantList.length > 3" |
| | | @click.native="routerPush('/myConsultantList/consultantList')">查看更多</el-col> |
| | | @click.native="navigateToRoute('/myConsultantList/consultantList')">查看更多</el-col> |
| | | </el-row> |
| | | <ConsultantList class="mt-10" |
| | | :agents="consultantList.slice(0, 3)"></ConsultantList> |
| | |
| | | import { Consultant } from '~/shared/models/consultant.model'; |
| | | |
| | | const localStorage = namespace('localStorage'); |
| | | |
| | | @Component({ |
| | | layout: 'home' |
| | | }) |
| | | export default class MainComponent extends Vue { |
| | | consultantList: Consultant[] = []; |
| | | |
| | | @State('recommendList') recommendList!: Consultant[]; |
| | | @Action storeRecommendList!: any; |
| | | @State('recommendList') |
| | | recommendList!: Consultant[]; |
| | | |
| | | @State('myConsultantList') myConsultantList!: Consultant[]; |
| | | @State('myConsultantList') |
| | | myConsultantList!: Consultant[]; |
| | | |
| | | @Action |
| | | storeRecommendList!: any; |
| | | |
| | | @Action storeConsultantList!: any; |
| | | |
| | | @localStorage.Mutation storageClearQuickFilter!: () => void; |
| | | @localStorage.Mutation storageClearRecommendConsultant!: () => void; |
| | | @localStorage.Mutation |
| | | storageClearQuickFilter!: () => void; |
| | | |
| | | @Watch('myConsultantList') |
| | | onMyConsultantListChange() { |
| | | this.consultantList = (this.myConsultantList || []) |
| | | .filter(item => item.contactStatus !== 'contacted') |
| | | .map((item) => ({ ...item, formatDate: new Date(item.updateTime || item.createTime)})) |
| | | .sort((preItem, nextItem) => +nextItem.formatDate - +preItem.formatDate) |
| | | } |
| | | @localStorage.Mutation |
| | | storageClearRecommendConsultant!: () => void; |
| | | |
| | | consultantList: Consultant[] = []; |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | mounted() { |
| | | if (!this.recommendList?.length) { |
| | |
| | | this.storageClearRecommendConsultant(); |
| | | } |
| | | |
| | | routerPush(path: string) { |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | @Watch('myConsultantList') |
| | | onMyConsultantListChange() { |
| | | this.consultantList = (this.myConsultantList || []) |
| | | .filter(item => item.contactStatus !== 'contacted') |
| | | .map((item) => ({ ...item, formatDate: new Date(item.updateTime || item.createTime)})) |
| | | .sort((preItem, nextItem) => +nextItem.formatDate - +preItem.formatDate) |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | navigateToRoute(path: string): void { |
| | | this.$router.push(path); |
| | | } |
| | | |