rename: change Consultants model to Consultant
| | |
| | | import { ConsultantLoginInfo } from '../models/ConsultantLoginInfo'; |
| | | import _ from 'lodash'; |
| | | import { UserSetting } from '../models/account.model'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | // 顧客登入(TODO: OTP認證開發前 暫時使用) |
| | | export function login(user: any) { |
| | |
| | | |
| | | // 推薦保險顧問 |
| | | export function recommend() { |
| | | return service.get<Consultants[]>('/consultant/recommend') |
| | | return service.get<Consultant[]>('/consultant/recommend') |
| | | .then(res => res.data); |
| | | } |
| | | |
| | |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.get<Consultants[]>('/consultant/favorite', {headers}) |
| | | return service.get<Consultant[]>('/consultant/favorite', {headers}) |
| | | .then(res => res.data); |
| | | } |
| | | |
| | |
| | | agentNo : string, |
| | | status : 'UNFILLED' | 'FILLED', |
| | | score : number, |
| | | // 需要 agentName |
| | | agentName: string, |
| | | clientName: string, |
| | | agentName : string, |
| | | customerName : string, |
| | | } |
| | |
| | | export interface Consultants { |
| | | export interface Consultant { |
| | | agentNo : string; |
| | | name : string; |
| | | img : string; |
| | |
| | | import { Consultants } from "./models/consultant.model"; |
| | | import { Consultant } from "./models/consultant.model"; |
| | | |
| | | |
| | | export function getFavoriteFromStorage(): Consultants[] { |
| | | export function getFavoriteFromStorage(): Consultant[] { |
| | | const consultantList = localStorage.getItem('favoriteConsultant'); |
| | | return consultantList ? JSON.parse(consultantList) : []; |
| | | } |
| | | |
| | | export function setFavoriteToStorage(consultants: Consultants[]) { |
| | | export function setFavoriteToStorage(consultants: Consultant[]) { |
| | | localStorage.setItem('favoriteConsultant', JSON.stringify(consultants)); |
| | | } |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Emit, Action, State, namespace } from 'nuxt-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | const localStorage = namespace('localStorage'); |
| | | @Component |
| | | export default class AddAndReservedBtns extends Vue { |
| | | @Action addToMyConsultantList!: (consultantToAdd: Consultants) => Promise<boolean> |
| | | @State('myConsultantList') myConsultantList!: Consultants[]; |
| | | @Prop() agentInfo!: Consultants; |
| | | @Action addToMyConsultantList!: (consultantToAdd: Consultant) => Promise<boolean> |
| | | @State('myConsultantList') myConsultantList!: Consultant[]; |
| | | @Prop() agentInfo!: Consultant; |
| | | @Prop() cusClass!: string; |
| | | isVisiblePopUp = false; |
| | | addConsultant(item: Consultants) { |
| | | addConsultant(item: Consultant) { |
| | | this.addToMyConsultantList(item).then(addOk => { |
| | | addOk && this.openPopUp(); |
| | | }); |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Emit, Action, State } from 'nuxt-property-decorator'; |
| | | import { getAppointmentDetail, UserReviewsConsultantsParams, userReviewsConsultants } from '~/assets/ts/api/consultant'; |
| | | import { Consultants, Appointment } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant, Appointment } from '~/assets/ts/models/consultant.model'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | import { isMobileDevice } from '~/assets/ts/device'; |
| | | |
| | |
| | | export default class ConsultantCard extends Vue { |
| | | @Action removeFromMyConsultantList!: (agentNo: string) => Promise<boolean>; |
| | | @Action storeConsultantList!: any; |
| | | @Prop() agentInfo!: Consultants; |
| | | @Prop() agentInfo!: Consultant; |
| | | isVisibleDialog = false; |
| | | reviewsBtn = false; |
| | | status = false; |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | |
| | | @Component |
| | | export default class ConsultantList extends Vue { |
| | | @Prop() agents!: Consultants[]; |
| | | @Prop() agents!: Consultant[]; |
| | | |
| | | get isLogin() { |
| | | return isLogin(); |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop } from 'vue-property-decorator'; |
| | | import { SwiperOptions } from 'swiper'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | |
| | | @Component |
| | | export default class UiSwiper extends Vue { |
| | | @Prop() agents!: Consultants[]; |
| | | @Prop() agents!: Consultant[]; |
| | | |
| | | swiperOptions: SwiperOptions = { |
| | | loop: false, |
| | |
| | | <script lang="ts"> |
| | | import { ElCarousel } from 'element-ui/types/carousel'; |
| | | import { Vue, Component, Prop } from 'vue-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | |
| | | @Component |
| | | export default class QuickFilterConsultantList extends Vue { |
| | | @Prop() consultantList!: Consultants[]; |
| | | @Prop() consultantList!: Consultant[]; |
| | | isVisiblePopUp = false; |
| | | popUpTxt = '成功加入顧問清單'; |
| | | |
| | |
| | | if (!this.date) return; |
| | | |
| | | const toDatePromise = new Promise((resolve, reject) => { |
| | | const date: Date = typeof(this.date) === 'string' ? new Date(this.date) : this.date; |
| | | const date: Date = typeof(this.date) === 'string' ? new Date(this.date) : this.date as Date; |
| | | resolve(date); |
| | | }); |
| | | |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Emit, Watch } from 'nuxt-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | @Component |
| | | export default class UiPagination extends Vue { |
| | | @Prop() totalList!: Consultants[]; |
| | | @Prop() totalList!: Consultant[]; |
| | | @Prop({default: 5}) pageSize!: number; |
| | | currentPage = 1; |
| | | pageList: Consultants[] = []; |
| | | pageList: Consultant[] = []; |
| | | |
| | | mounted() { |
| | | this.handleCurrentChange(this.currentPage); |
| | | } |
| | | |
| | | @Emit('changePage') chagnePage(): Consultants[] { |
| | | @Emit('changePage') chagnePage(): Consultant[] { |
| | | return this.pageList |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Watch('totalList') watchtotalList(newValue: Consultants[]) { |
| | | @Watch('totalList') watchtotalList(newValue: Consultant[]) { |
| | | if (newValue) { |
| | | this.handleCurrentChange(this.currentPage); |
| | | } |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, State, Action, Watch } from 'nuxt-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | @Component({ |
| | | layout: 'home' |
| | | }) |
| | | export default class MainComponent extends Vue { |
| | | consultantList: Consultants[] = []; |
| | | agents: Consultants[] = []; |
| | | @State('recommendList') recommendList!: Consultants[]; |
| | | consultantList: Consultant[] = []; |
| | | agents: Consultant[] = []; |
| | | @State('recommendList') recommendList!: Consultant[]; |
| | | @Action storeRecommendList!: any; |
| | | |
| | | @State('myConsultantList') myConsultantList!: Consultants[]; |
| | | @State('myConsultantList') myConsultantList!: Consultant[]; |
| | | @Action storeConsultantList!: any; |
| | | |
| | | @Watch('myConsultantList') |
| | |
| | | |
| | | <script lang='ts'> |
| | | import { Vue, Component, Watch, State, Action } from 'nuxt-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | @Component |
| | | export default class myConsultantList extends Vue { |
| | | activeTabName = 'consultantList'; |
| | | agents: Consultants[] = []; |
| | | contactedList: Consultants[] = []; |
| | | consultantList: Consultants[] = []; |
| | | agents: Consultant[] = []; |
| | | contactedList: Consultant[] = []; |
| | | consultantList: Consultant[] = []; |
| | | |
| | | @State('myConsultantList') myConsultantList!: Consultants[]; |
| | | @State('myConsultantList') myConsultantList!: Consultant[]; |
| | | @Action storeConsultantList!: any; |
| | | |
| | | @Watch('myConsultantList') |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Getter } from 'nuxt-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | |
| | | @Component |
| | | export default class ConsultantPage extends Vue { |
| | | @Prop() consultantList!: Consultants[]; |
| | | @Prop() consultantList!: Consultant[]; |
| | | @Getter isLogin!: boolean; |
| | | pageList: Consultants[] = []; |
| | | pageList: Consultant[] = []; |
| | | |
| | | changePage(pageList: Consultants[]) { |
| | | changePage(pageList: Consultant[]) { |
| | | this.pageList = pageList; |
| | | } |
| | | |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop } from 'nuxt-property-decorator' ; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | |
| | | |
| | | @Component |
| | | export default class ContactedList extends Vue { |
| | | @Prop() contactedList!: Consultants[]; |
| | | pageList: Consultants[] = []; |
| | | @Prop() contactedList!: Consultant[]; |
| | | pageList: Consultant[] = []; |
| | | |
| | | changePage(pageList: Consultants[]) { |
| | | changePage(pageList: Consultant[]) { |
| | | this.pageList = pageList; |
| | | } |
| | | } |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component, namespace } from 'nuxt-property-decorator'; |
| | | import { FastQueryParams } from '~/assets/ts/api/consultant'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | import { Selected } from '~/components/QuickFilter/QuickFilterSelector.vue'; |
| | | import { fastQuery } from '~/assets/ts/api/consultant'; |
| | | |
| | |
| | | @localStorage.Getter quickFilterSelectedData!: Selected[]; |
| | | |
| | | isOpenQuestionPopUp = false; |
| | | consultantList: Consultants[] = []; |
| | | consultantList: Consultant[] = []; |
| | | questionOption = {}; |
| | | confirmItem: Selected[] = []; |
| | | questionList: QuestionOption[] = [ |
| | |
| | | import { ClientInfo, getMyAppointmentList, getMyReviewLog, allAppointmentsView } from '~/assets/ts/api/appointment'; |
| | | // import * as consultant from '~/assets/ts/api/consultant'; |
| | | import { recommend, AgentOfStrictQuery, getFavoriteConsultant, addFavoriteConsultant, deleteConsultant, strictQuery } from '~/assets/ts/api/consultant'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | import { AppointmentLog } from '~/assets/ts/models/appointment.model'; |
| | | import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant'; |
| | | |
| | | @Module |
| | | export default class Store extends VuexModule { |
| | | recommendList: Consultants[] = []; |
| | | recommendList: Consultant[] = []; |
| | | strictQueryList: AgentOfStrictQuery[] = []; |
| | | myConsultantList: Consultants[] = []; |
| | | myConsultantList: Consultant[] = []; |
| | | |
| | | myAppointmentList: ClientInfo[] = []; |
| | | |
| | | myAppointmentReviewLogList: AppointmentLog[] = []; |
| | | |
| | | @Mutation updateRecommend(data: Consultants[]) { |
| | | @Mutation updateRecommend(data: Consultant[]) { |
| | | this.recommendList = data; |
| | | } |
| | | |
| | | @Mutation updateConsultantList(data: Consultants[]) { |
| | | @Mutation updateConsultantList(data: Consultant[]) { |
| | | this.myConsultantList = data; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Action |
| | | async addToMyConsultantList(consultantToAdd: Consultants) { |
| | | async addToMyConsultantList(consultantToAdd: Consultant) { |
| | | if (consultantToAdd) { |
| | | const found = this.myConsultantList.find(item => item.agentNo === consultantToAdd.agentNo); |
| | | if (!found) { |