PAMapp/assets/ts/api/consultant.ts | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/assets/ts/const/quickFilter-questionList.ts | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/assets/ts/models/quickFilter.model.ts | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/components/QuickFilter/QuickFilterConsultantList.vue | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/components/QuickFilter/QuickFilterSelector.vue | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/pages/login/index.vue | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/pages/quickFilter/index.vue | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
PAMapp/store/localStorage.ts | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 |
PAMapp/assets/ts/api/consultant.ts
@@ -5,6 +5,7 @@ import { UserSetting } from '../models/account.model'; import { Consultant } from '~/assets/ts/models/consultant.model'; import { http } from '../services/httpClient'; import { FastQueryParams } from '../models/quickFilter.model'; // 顧客ç»å ¥(TODO: OTPèªèéç¼å æ«æä½¿ç¨) export function login(user: any) { @@ -34,7 +35,7 @@ // å¿«éç¯©é¸ export function fastQuery(data: FastQueryParams) { return http.post('/consultant/fastQuery', data) return http.post<Consultant[]>('/consultant/fastQuery', data).then(res => res.data); } // å´é¸é å° @@ -138,13 +139,6 @@ Authorization: 'Bearer ' + localStorage.getItem('id_token') } return http.put('/appointment', editAppointmentParams, {headers}); } export interface FastQueryParams { gender : string, communicationStyles: string[], avgScore : number, status : string } export interface AppointmentRequests { PAMapp/assets/ts/const/quickFilter-questionList.ts
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,36 @@ import { QuestionOption } from "../models/quickFilter.model"; export const questionList: QuestionOption[] = [ { name: 'gender', title: 'é¡§åæ§å¥', detail: [ { name: 'ç·æ§', value: 'male', className: 'btn_man'}, { name: '女æ§', value: 'female', className: 'btn_woman'} ], type: 'radio' }, // { TODO:é±è滿æåº¦ // name: 'avgScore', // title: 'é¡§åæ»¿æåº¦', // detail: [], // type: '' // }, { name: 'communicationStyles', title: 'æºéé¢¨æ ¼', detail: [ { value: '謹æ å實', className: 'btn_owl'}, { value: 'æå¿«ä¸»å', className: 'btn_tiger'}, { value: 'èå¿å¾è½', className: 'btn_koala'}, { value: 'å¥è«é¢¨è¶£', className: 'btn_peacock'} ], type: 'checkbox' }, // { // name: 'status', // title: 'ä¸ç·çæ ', // detail: [], // type: 'radio' // } ]; PAMapp/assets/ts/models/quickFilter.model.ts
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,24 @@ export interface QuestionOption { title: string; detail: Detail[]; type: string; name: string; } interface Detail { value: string; name?: string; className: string; } export interface FastQueryParams { gender : string, communicationStyles: string[], avgScore : number, status : string } export interface Selected { option: string; value: any; } PAMapp/components/QuickFilter/QuickFilterConsultantList.vue
@@ -96,6 +96,15 @@ endYPosition = 0; hideReviews = hideReviews ; openPopUp(txt: string) { this.popUpTxt = txt; this.isVisiblePopUp = true; } showAgentDetail(agentNo: string): void { this.$router.push(`/agentInfo/${agentNo}`); } moveStart(event: TouchEvent) { this.startPosition = event.changedTouches[0].clientX; this.startYPosition = event.changedTouches[0].clientY; @@ -124,14 +133,6 @@ (this.$refs.carouselRef as ElCarousel).prev(); } openPopUp(txt: string) { this.popUpTxt = txt; this.isVisiblePopUp = true; } showAgentDetail(agentNo: string): void { this.$router.push(`/agentInfo/${agentNo}`); } } </script> PAMapp/components/QuickFilter/QuickFilterSelector.vue
@@ -66,13 +66,10 @@ <script lang="ts"> import { Vue, Component, Prop, Watch, Emit } from 'nuxt-property-decorator'; import { FastQueryParams } from '~/assets/ts/api/consultant'; import { QuestionOption } from '~/pages/quickFilter/index.vue'; import { hideReviews } from '~/assets/ts/const/hide-reviews'; import { FastQueryParams, QuestionOption, Selected } from '~/assets/ts/models/quickFilter.model'; @Component export default class QuickFilterDrawer extends Vue { pickedItem: FastQueryParams = { communicationStyles: [], status: '', @@ -80,7 +77,7 @@ avgScore: 0 } hideReviews = hideReviews ; @Prop() questionOption!: QuestionOption; @Prop() isOpenQuestionPopUp!: boolean; @Prop() confirmItem!: Selected[]; @@ -131,12 +128,6 @@ value: this.pickedItem[name] } } } export interface Selected { option: string; value: any; } </script> PAMapp/pages/login/index.vue
@@ -353,14 +353,14 @@ phoneNumber = ''; otpCode = ''; onPhoneVerifyStep: 'APPLY_OTP' | 'INPUT_OTP' | 'SUBMIT_OTP' = 'APPLY_OTP'; otpCounterSec = 900; otpCounterSec = 300; otpResendCounter = 30; otpInterval: any; phoneOtpInfo!: OtpInfo; email = ''; onEmailVerifyResendStatus: 'APPLY_OTP' | 'CAN_RESEND' = 'APPLY_OTP'; emailCounterSec = 900; emailCounterSec = 300; emailResendCounter = 30; emailOtpCode = ''; emailResendInterval: any; @@ -607,11 +607,11 @@ if (type === 'MOBILE') { clearInterval(this.otpInterval); this.otpResendCounter = 30; this.otpCounterSec = 900; this.otpCounterSec = 300; } else { clearInterval(this.emailResendInterval); this.emailResendCounter = 30; this.emailCounterSec = 900; this.emailCounterSec = 300; } } PAMapp/pages/quickFilter/index.vue
@@ -66,10 +66,10 @@ <script lang="ts"> import { Vue, Component, namespace } from 'nuxt-property-decorator'; import { FastQueryParams } from '~/assets/ts/api/consultant'; import { Consultant } from '~/assets/ts/models/consultant.model'; import { Selected } from '~/components/QuickFilter/QuickFilterSelector.vue'; import { fastQuery } from '~/assets/ts/api/consultant'; import { questionList } from '~/assets/ts/const/quickFilter-questionList'; import { FastQueryParams, QuestionOption, Selected } from '~/assets/ts/models/quickFilter.model'; const localStorage = namespace('localStorage'); @Component @@ -81,41 +81,9 @@ consultantList: Consultant[] = []; questionOption = {}; confirmItem: Selected[] = []; questionList: QuestionOption[] = [ { name: 'gender', title: 'é¡§åæ§å¥', detail: [ { name: 'ç·æ§', value: 'male', className: 'btn_man'}, { name: '女æ§', value: 'female', className: 'btn_woman'} ], type: 'radio' }, // { TODO:é±è滿æåº¦ // name: 'avgScore', // title: 'é¡§åæ»¿æåº¦', // detail: [], // type: '' // }, { name: 'communicationStyles', title: 'æºéé¢¨æ ¼', detail: [ { value: '謹æ å實', className: 'btn_owl'}, { value: 'æå¿«ä¸»å', className: 'btn_tiger'}, { value: 'èå¿å¾è½', className: 'btn_koala'}, { value: 'å¥è«é¢¨è¶£', className: 'btn_peacock'} ], type: 'checkbox' }, // { // name: 'status', // title: 'ä¸ç·çæ ', // detail: [], // type: 'radio' // } ]; questionList = questionList; //////////////// lifecycle //////////////// mounted() { if (this.quickFilterSelectedData && this.quickFilterSelectedData.length > 0) { this.confirmItem = this.quickFilterSelectedData; @@ -123,26 +91,8 @@ } } gender(): string { const filter = this.confirmItem.filter(item => item.option === 'gender').map(i => i.value); return filter.length === 0 ? '' : filter[0]; } avgScore(): number { const filter = this.confirmItem.filter(item => item.option === 'avgScore').map(i => i.value); return filter.length === 0 ? '' : filter[0]; } communicationStyles(): string[] { return this.confirmItem.filter(item => item.option === 'communicationStyles').map(i => i.value); } isActive(name: string) { return name === 'gender' && !!this.gender() || name === 'avgScore' && !!this.avgScore() || name === 'communicationStyles' && !!this.communicationStyles().length } ////////////////////////////////////////// openPopUp(question: QuestionOption) { this.questionOption = question; this.isOpenQuestionPopUp =true; @@ -159,7 +109,29 @@ this.isOpenQuestionPopUp = false; } setConfirmData(event: Selected) { isActive(name: string) { return name === 'gender' && !!this.gender() || name === 'avgScore' && !!this.avgScore() || name === 'communicationStyles' && !!this.communicationStyles().length } //////////////// private //////////////// private gender(): string { const filter = this.confirmItem.filter(item => item.option === 'gender').map(i => i.value); return filter.length === 0 ? '' : filter[0]; } private avgScore(): number { const filter = this.confirmItem.filter(item => item.option === 'avgScore').map(i => i.value); return filter.length === 0 ? '' : filter[0]; } private communicationStyles(): string[] { return this.confirmItem.filter(item => item.option === 'communicationStyles').map(i => i.value); } private setConfirmData(event: Selected) { if (event.option === 'communicationStyles') { this.filterCommunicationStyles(event); } else { @@ -168,7 +140,7 @@ } } filterCommunicationStyles(event: Selected) { private filterCommunicationStyles(event: Selected) { const confirmValue = this.confirmItem .filter(item => item.option === 'communicationStyles') .map(i => i.value); @@ -188,7 +160,7 @@ } } getRecommendList() { private getRecommendList() { const data: FastQueryParams = { gender: this.gender(), communicationStyles: this.communicationStyles(), @@ -196,25 +168,12 @@ status: '' } fastQuery(data).then((res) => { this.consultantList = res.data; fastQuery(data).then((consultantList) => { this.consultantList = consultantList; this.storageQuickFilter(JSON.stringify(this.confirmItem)) }) } } export interface QuestionOption { title: string; detail: Detail[]; type: string; name: string; } interface Detail { value: string; name?: string; className: string; } </script> @@ -240,7 +199,7 @@ .quickBtnBlock { display: flex; width: 100%; height: 132px; // height: 132px; flex-wrap: wrap; justify-content: space-between; PAMapp/store/localStorage.ts
@@ -1,6 +1,6 @@ import { Selected } from '~/components/QuickFilter/QuickFilterSelector.vue'; import { Module, Mutation, VuexModule ,Action } from 'vuex-module-decorators'; import { Role } from '~/assets/ts/models/enum/Role'; import { Selected } from '~/assets/ts/models/quickFilter.model'; @Module export default class LocalStorage extends VuexModule { id_token = localStorage.getItem('id_token');