refactor components: AddAndReservedBtns, AddressPicker, BackActionBar
| | |
| | | <template> |
| | | <el-row type="flex" justify="center" :class="cusClass"> |
| | | <el-button @click="addConsultant(agentInfo)" :disabled="isAdded"> |
| | | <span> {{isAdded ? 'å·²å å
¥é¡§åæ¸
å®' : '+ 顧忏
å®'}}</span> |
| | | <span> {{ isAdded ? 'å·²å å
¥é¡§åæ¸
å®' : '+ 顧忏
å®' }}</span> |
| | | </el-button> |
| | | <el-button |
| | | @click="reserveCommunication" |
| | | @click="navigateToReservationForm" |
| | | type="primary" |
| | | >é²è¡é ç´</el-button> |
| | | </el-row> |
| | |
| | | import { Vue, Component, Prop, Emit, Action, State, namespace } from 'nuxt-property-decorator'; |
| | | import { Consultant } from '~/shared/models/consultant.model'; |
| | | |
| | | const localStorage = namespace('localStorage'); |
| | | @Component |
| | | export default class AddAndReservedBtns extends Vue { |
| | | @Action addToMyConsultantList!: (consultantToAdd: Consultant) => Promise<boolean> |
| | | @State('myConsultantList') myConsultantList!: Consultant[]; |
| | | @Prop() agentInfo!: Consultant; |
| | | @Prop() cusClass!: string; |
| | | |
| | | @Action |
| | | addToMyConsultantList!: (consultantToAdd: Consultant) => Promise<boolean> |
| | | |
| | | @State('myConsultantList') |
| | | myConsultantList!: Consultant[]; |
| | | |
| | | @Prop() |
| | | agentInfo!: Consultant; |
| | | |
| | | @Prop() |
| | | cusClass!: string; |
| | | |
| | | isVisiblePopUp = false; |
| | | addConsultant(item: Consultant) { |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | @Emit('openPopUp') |
| | | openPopUp(popUpTxt: string = 'æåå å
¥é¡§åæ¸
å®'): string { |
| | | return popUpTxt; |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | addConsultant(item: Consultant): void { |
| | | this.addToMyConsultantList(item).then(addOk => { |
| | | addOk && this.openPopUp(); |
| | | }); |
| | | } |
| | | |
| | | reserveCommunication() { |
| | | navigateToReservationForm(): void { |
| | | this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`); |
| | | } |
| | | |
| | | @Emit('openPopUp') openPopUp(popUpTxt: string = 'æåå å
¥é¡§åæ¸
å®') { |
| | | return popUpTxt |
| | | } |
| | | |
| | | get isAdded() { |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Emit } from 'nuxt-property-decorator'; |
| | | |
| | | import { taiwanCities } from '~/shared/const/taiwan-cities'; |
| | | |
| | | @Component |
| | | export default class AddressPicker extends Vue { |
| | | |
| | | options = ['åºéå¸', 'å°åå¸', 'æ°åå¸', 'æ¡åå¸', 'æ°ç«¹å¸', 'æ°ç«¹ç¸£', 'èæ ç¸£', 'å°ä¸å¸', 'å½°å縣', 'åæç¸£', 'é²æç¸£', 'å義å¸', 'å義縣', 'å°åå¸', 'é«éå¸', '屿±ç¸£', 'å°æ±ç¸£', 'è±è®ç¸£', 'å®è縣', 'æ¾æ¹ç¸£', 'éé縣', '飿±ç¸£']; |
| | | keyWord = ''; |
| | | options : string[] = taiwanCities; |
| | | keyWord : string = ''; |
| | | filterOptions: string[] = []; |
| | | district = 'å°åå¸'; |
| | | district : string = 'å°åå¸'; |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | mounted() { |
| | | this.filterOptions = JSON.parse(JSON.stringify(this.options)); |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | @Emit('confirm') |
| | | confirm(): string { |
| | | return this.district; |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | searchDistrict() { |
| | | this.filterOptions = this.options.filter(e => e.match(this.keyWord)); |
| | |
| | | this.district = value; |
| | | } |
| | | |
| | | @Emit('confirm') |
| | | confirm() { |
| | | return this.district; |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <nav class="pam-back-action-bar fix-chrome-click--issue"> |
| | | <a @click="pushRouterByLoginRole"> |
| | | <i class="icon-left "></i> |
| | | <a @click="goBack"> |
| | | <i class="icon-left "></i> |
| | | </a> |
| | | <div class="label">{{ label }}</div> |
| | | </nav> |
| | |
| | | <script lang="ts"> |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { Vue, Component,} from 'vue-property-decorator'; |
| | | |
| | | import * as _ from 'lodash'; |
| | | |
| | | import { Role } from '~/shared/models/enum/Role'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | |
| | | @Component |
| | | export default class UiCarousel extends Vue { |
| | | @roleStorage.Getter currentRole!:string; |
| | | get label(): string { |
| | | |
| | | @roleStorage.Getter |
| | | currentRole!:string; |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | goBack(): void { |
| | | const pathName = this.$route.name; |
| | | pathName?.includes('myConsultantList') ? this.$router.push('/') : this.$router.go(-1); |
| | | } |
| | | |
| | | get label(): string { |
| | | if (this.$route.name) { |
| | | const routeName = this.$route.name.split('-')[0]; |
| | | let featureLabel = ''; |
| | |
| | | } |
| | | } |
| | | |
| | | pushRouterByLoginRole():void{ |
| | | const pathName = this.$route.name; |
| | | pathName?.includes('myConsultantList') ? this.$router.push('/') : this.$router.go(-1); |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .pam-back-action-bar { |
| | | height: $MOB_NAV_BAR; |
| | | border: 1px solid #CCCCCC; |
| | | display: flex; |
| | | align-items: center; |
| | | position: fixed; |
| | | top: $MOB_NAV_BAR; |
| | | left: 0; |
| | | width: 100%; |
| | | height : $MOB_NAV_BAR; |
| | | border : 1px solid #CCCCCC; |
| | | display : flex; |
| | | align-items : center; |
| | | position : fixed; |
| | | top : $MOB_NAV_BAR; |
| | | left : 0; |
| | | width : 100%; |
| | | background-color: $PRIMARY_WHITE; |
| | | z-index: 6; |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | z-index : 6; |
| | | font-size : 20px; |
| | | font-weight : bold; |
| | | i { |
| | | display: block; |
| | | display : block; |
| | | padding-right: 14px; |
| | | } |
| | | a { |
| | | cursor: pointer; |
| | | cursor : pointer; |
| | | padding: 0 20px; |
| | | width: 26px; |
| | | width : 26px; |
| | | } |
| | | .label { |
| | | margin: 0 auto; |
| | | margin : 0 auto; |
| | | transform: translateX(-33px); |
| | | } |
| | | } |
| | | |
| | | @include desktop { |
| | | .pam-back-action-bar { |
| | | top: $DESKTOP_NAV_BAR; |
| | | top : $DESKTOP_NAV_BAR; |
| | | font-size: 24px; |
| | | } |
| | | } |
¤ñ¹ï·sÀÉ®× |
| | |
| | | export const taiwanCities = ['åºéå¸', 'å°åå¸', 'æ°åå¸', 'æ¡åå¸', 'æ°ç«¹å¸', 'æ°ç«¹ç¸£', 'èæ ç¸£', 'å°ä¸å¸', 'å½°å縣', 'åæç¸£', 'é²æç¸£', 'å義å¸', 'å義縣', 'å°åå¸', 'é«éå¸', '屿±ç¸£', 'å°æ±ç¸£', 'è±è®ç¸£', 'å®è縣', 'æ¾æ¹ç¸£', 'éé縣', '飿±ç¸£']; |