| | |
| | | <template> |
| | | <div> |
| | | |
| | | <template v-if="agentList.length > 0"> |
| | | <ConsultantCard |
| | | v-for="(agent, index) in agentList" |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator'; |
| | | |
| | | import authService from '~/shared/services/auth.service'; |
| | | import { Consultant } from '~/shared/models/consultant.model'; |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator'; |
| | | import authService from '~/shared/services/auth.service'; |
| | | |
| | | @Component |
| | | export default class ConsultantList extends Vue { |
| | |
| | | |
| | | isUserLogin = false; |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | get agentList(){ |
| | | return this.agents.map((agentDto)=> |
| | | ({...agentDto,customerScore:0,}) |
| | |
| | | @Component |
| | | export default class UiSwiper extends Vue { |
| | | |
| | | @Prop() agents!: Consultant[]; |
| | | @Prop() |
| | | agents!: Consultant[]; |
| | | |
| | | hideReviews = hideReviews ; |
| | | |
| | | swiperOptions: SwiperOptions = { |
| | | loop: false, |
| | | slideToClickedSlide: false, |
| | |
| | | } |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | clkItem(loopIndex: number, realIndex: number) { |
| | | const agentNo = this.agents[loopIndex].agentNo; |
| | | this.$router.push(`/agentInfo/${agentNo}`); |
| | |
| | | |
| | | @Component |
| | | export default class QuickFilterConsultantList extends Vue { |
| | | @Prop() consultantList!: Consultant[]; |
| | | @Prop() |
| | | consultantList!: Consultant[]; |
| | | |
| | | isVisiblePopUp = false; |
| | | popUpTxt = '成功加入顧問清單'; |
| | | startPosition = 0; |
| | |
| | | hideReviews = hideReviews ; |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | moveStart(event: TouchEvent) { |
| | | this.startPosition = event.changedTouches[0].clientX; |
| | | this.startYPosition = event.changedTouches[0].clientY; |
| | |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | openPopUp(txt: string) { |
| | | this.popUpTxt = txt; |
| | | this.isVisiblePopUp = true; |
| | |
| | | import { FastQueryParams, QuestionOption, Selected } from '~/shared/models/quick-filter.model'; |
| | | @Component |
| | | export default class QuickFilterDrawer extends Vue { |
| | | @Prop() |
| | | questionOption!: QuestionOption; |
| | | |
| | | @Prop() |
| | | isOpenQuestionPopUp!: boolean; |
| | | |
| | | @Prop() |
| | | confirmItem!: Selected[]; |
| | | |
| | | pickedItem: FastQueryParams = { |
| | | communicationStyles: [], |
| | | status: '', |
| | |
| | | } |
| | | hideReviews = hideReviews ; |
| | | |
| | | @Prop() questionOption!: QuestionOption; |
| | | @Prop() isOpenQuestionPopUp!: boolean; |
| | | @Prop() confirmItem!: Selected[]; |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | @Watch('isOpenQuestionPopUp', {immediate: true}) |
| | | onPopUpChange() { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | get isDisabled() { |
| | | const name = this.questionOption.name; |
| | | return name === 'gender' && !this.pickedItem[name] |
| | |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | private getGender(): string { |
| | | return this.filterSingleSelected('gender'); |
| | | } |
| | |
| | | |
| | | @Component |
| | | export default class UiAvatar extends Vue { |
| | | @Prop() size!: number; |
| | | @Prop() fileName!: string; |
| | | @Prop() |
| | | size!: number; |
| | | |
| | | @Prop() |
| | | fileName!: string; |
| | | |
| | | get imgSrc() { |
| | | return process.env.BASE_URL + '/consultant/avatar/' + this.fileName; |
| | | } |
| | | } |
| | | </script> |
| | | </script> |
| | |
| | | |
| | | @Component |
| | | export default class UiDateFormat extends Vue { |
| | | @Prop() date!: Date | string; |
| | | @Prop() onlyShowSection!: 'DAY' | 'TIME'; |
| | | compareTarget!: Date; |
| | | @Prop() |
| | | date!: Date | string; |
| | | |
| | | @Prop() |
| | | onlyShowSection!: 'DAY' | 'TIME'; |
| | | |
| | | compareTarget!: Date; |
| | | displayValue = ''; |
| | | |
| | | @Watch('date', {immediate: true}) formattedDate(): void { |
| | | |
| | | @Watch('date', {immediate: true}) |
| | | formattedDate(): void { |
| | | if (!this.date) return; |
| | | |
| | | const toDatePromise = new Promise((resolve, reject) => { |
| | |
| | | const isThisYear = (compareDate: Date): boolean => { |
| | | return compareDate.getFullYear() === _now.getFullYear(); |
| | | }; |
| | | |
| | | |
| | | const minutes = compareTarget.getMinutes() > 9 ? compareTarget.getMinutes() : `0${compareTarget.getMinutes()}`; |
| | | const thisYearDayLabel = isToday(compareTarget) ? `今天` : `${compareTarget.getMonth() + 1}/${compareTarget.getDate()}`; |
| | | |
| | |
| | | |
| | | if (this.onlyShowSection) return; |
| | | |
| | | this.displayValue = isThisYear(compareTarget) |
| | | ? `${thisYearDayLabel} ${compareTarget.getHours()}:${minutes}` |
| | | this.displayValue = isThisYear(compareTarget) |
| | | ? `${thisYearDayLabel} ${compareTarget.getHours()}:${minutes}` |
| | | : `${compareTarget.getFullYear()}/${compareTarget.getMonth() + 1}/${compareTarget.getDate()} ${compareTarget.getHours()}:${minutes}`; |
| | | } |
| | | } |
| | | )} |
| | | |
| | | } |
| | | </script> |
| | | </script> |
| | |
| | | |
| | | @Component |
| | | export default class UiDialog extends Vue { |
| | | @PropSync('isVisible') dialogVisible!: boolean; |
| | | @Prop() width!: string; |
| | | @PropSync('isVisible') |
| | | dialogVisible!: boolean; |
| | | |
| | | @Emit('closeDialog') closeDialog() { |
| | | @Prop() |
| | | width!: string; |
| | | |
| | | @Emit('closeDialog') |
| | | closeDialog() { |
| | | return; |
| | | } |
| | | } |
| | | </script> |
| | | </script> |
| | |
| | | |
| | | @Component |
| | | export default class UiDialog extends Vue { |
| | | @PropSync('isVisible') drawerVisible!: boolean; |
| | | @Prop() size!: number; |
| | | @PropSync('isVisible') |
| | | drawerVisible!: boolean; |
| | | |
| | | @Emit('closeDrawer') closeDrawer() { |
| | | @Prop() |
| | | size!: number; |
| | | |
| | | @Emit('closeDrawer') |
| | | closeDrawer() { |
| | | return; |
| | | } |
| | | } |
| | |
| | | border-radius: 10px; |
| | | margin: 10px auto 13px auto; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | @Component |
| | | export default class UiField extends Vue { |
| | | |
| | | @Prop() span!: number; |
| | | @Prop() icon!: string; |
| | | @Prop() label!: string; |
| | | @Prop() content!: string; |
| | | @Prop() displayDevice!: 'MOBILE' | 'DESKTOP' | 'ALL'; |
| | | @Prop() |
| | | span!: number; |
| | | |
| | | @Prop() |
| | | icon!: string; |
| | | |
| | | @Prop() |
| | | label!: string; |
| | | |
| | | @Prop() |
| | | content!: string; |
| | | |
| | | @Prop() |
| | | displayDevice!: 'MOBILE' | 'DESKTOP' | 'ALL'; |
| | | |
| | | currentDevice: 'MOBILE' | 'DESKTOP' = 'MOBILE'; |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | mounted(): void { |
| | | this.currentDevice = UtilsService.isMobileDevice() ? 'MOBILE' : 'DESKTOP'; |
| | | } |
| | |
| | | export default class UiGoToTop extends Vue { |
| | | buttonDisplay = 'none'; |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | created() { |
| | | if (process.browser) { |
| | | document.body.addEventListener('scroll', this.scrollFunction); |
| | | } |
| | | } |
| | | |
| | | destroyed() { |
| | | document.body.removeEventListener('scroll', this.scrollFunction); |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | scrollFunction() { |
| | | if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 300) { |
| | |
| | | topFunction() { |
| | | document.body.scrollTop = 0; |
| | | document.documentElement.scrollTop = 0; |
| | | } |
| | | |
| | | destroyed() { |
| | | document.body.removeEventListener('scroll', this.scrollFunction); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | background-color: $MID_GREY; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | |
| | | @Component |
| | | export default class UiPagination extends Vue { |
| | | @Prop() totalList!: Consultant[]; |
| | | @Prop() |
| | | totalList!: Consultant[]; |
| | | |
| | | @Prop({default: 5}) pageSize!: number; |
| | | currentPage = 1; |
| | | |
| | | pageList: Consultant[] = []; |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | @Emit('changePage') |
| | | changePage(): Consultant[] { |
| | | return this.pageList |
| | | } |
| | | |
| | | @Watch('totalList') |
| | | watchTotalList(newValue: Consultant[]) { |
| | | if (newValue) { |
| | | this.handleCurrentChange(this.currentPage); |
| | | } |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | mounted() { |
| | | this.handleCurrentChange(this.currentPage); |
| | | } |
| | | |
| | | @Emit('changePage') changePage(): Consultant[] { |
| | | return this.pageList |
| | | } |
| | | ////////////////////////////////////////////////////////////////// |
| | | |
| | | handleCurrentChange(currentPage: number) { |
| | | |
| | |
| | | if (this.totalList) { |
| | | this.pageList = this.totalList.slice(this.pageSize * currentPage - this.pageSize, this.pageSize * currentPage) |
| | | this.changePage(); |
| | | } |
| | | } |
| | | |
| | | @Watch('totalList') watchTotalList(newValue: Consultant[]) { |
| | | if (newValue) { |
| | | this.handleCurrentChange(this.currentPage); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @Component |
| | | export default class UiReviewScore extends Vue { |
| | | @Prop() score!: number; |
| | | @Prop() |
| | | score!: number; |
| | | } |
| | | </script> |
| | | </script> |
| | |
| | | export default class UiScrollPicker extends Vue { |
| | | // https://reposhub.com/vuejs/form-input/wan2land-vue-scroll-picker.html |
| | | |
| | | @Prop() options!: string[]; |
| | | @Prop() initValue!: string; |
| | | @Prop() |
| | | options!: string[]; |
| | | |
| | | @Emit('change') selValue(value: string) { |
| | | @Prop() |
| | | initValue!: string; |
| | | |
| | | @Emit('change') |
| | | selValue(value: string) { |
| | | return value |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | </script> |
| | |
| | | @Component |
| | | export default class UiTags extends Vue { |
| | | |
| | | @Emit('removeTag') removeTag() { |
| | | @Emit('removeTag') |
| | | removeTag() { |
| | | return; |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | </script> |