update: 我的顧問清單/預約清單: 按照時間排序
| | |
| | | contactStatus?: string; |
| | | latestAppointmentId: number; |
| | | role: string; |
| | | image?: string; |
| | | expertises?: string; |
| | | } |
| | | |
| | | export interface FastQueryParams { |
| | |
| | | <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"> |
| | |
| | | <div class="professionals"> |
| | | <span |
| | | class="professionalsTxt" |
| | | v-for="(expertise, index) in agentInfo.expertise" |
| | | v-for="(expertise, index) in expertises" |
| | | :key="index" |
| | | >#{{expertise}}</span> |
| | | </div> |
| | |
| | | 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' ? '男性' : '女性'; |
| | |
| | | <template> |
| | | <div> |
| | | |
| | | <template v-if="agents.length > 0"> |
| | | <ConsultantCard |
| | | v-for="(agent, index) in agents" |
| | |
| | | @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> |
| | |
| | | |
| | | 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) { |
| | |
| | | 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, |
| | |
| | | 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, |