| | |
| | | <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" |
| | | @removeAgent="removeAgent" |
| | | ></ConsultantCard> |
| | | </template> |
| | | <template v-else-if="noLogin"> |
| | | <div class="emptyRowStyle"> |
| | | <div class="mdTxt login" @click="$router.push('/login')">登入</div> |
| | | <div class="smTxt txt">查看更多已選顧問</div> |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <template v-if="isLogin && agentList.length === 0"> |
| | | <div class="emptyRowStyle"> |
| | | <div class="smTxt txt">您目前無已選顧問</div> |
| | | </div> |
| | | </template> |
| | | <template v-if="!isLogin"> |
| | | <div class="emptyRowStyle"> |
| | | <div class="mdTxt login fix-chrome-click--issue" @click="$router.push('/login')">登入 | 註冊</div> |
| | | <div class="smTxt txt ">查看更多</div> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Emit } from 'nuxt-property-decorator'; |
| | | import { Agents } from '~/plugins/api/home'; |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | |
| | | @Component |
| | | export default class ConsultantList extends Vue { |
| | | @Prop() agents!: Agents[]; |
| | | @Prop() agents!: Consultants[]; |
| | | |
| | | noLogin = false; |
| | | |
| | | @Emit('removeAgent') removeAgent(agentId: number) { |
| | | return agentId; |
| | | get isLogin() { |
| | | return isLogin(); |
| | | } |
| | | get agentList(){ |
| | | return this.agents.map((agentDto)=> |
| | | ({...agentDto,customerScore:0,}) |
| | | ) |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | .emptyRowStyle { |
| | | background-color: #FFFFFF; |
| | | background-color: $PRIMARY_WHITE; |
| | | width: 100%; |
| | | height: 100px; |
| | | display: flex; |
| | |
| | | align-items: center; |
| | | |
| | | .login { |
| | | color: #ED1B2E; |
| | | color: $PRIMARY_RED; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .txt { |
| | | color: #68737A; |
| | | color: $PRUDENTIAL_GREY; |
| | | margin-left: 17px; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | | </style> |