| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, State, Action, Watch } from 'nuxt-property-decorator'; |
| | | import { Vue, Component, State, Action, Watch, namespace } from 'nuxt-property-decorator'; |
| | | import { addFavoriteConsultant, appointmentDemand, AppointmentParams, AppointmentRequests ,editAppointment,RegisterInfo } from '~/assets/ts/api/consultant'; |
| | | import { getRequestQuestionFromStorage, getRequestsFromStorage, removeRequestQuestionFromStorage, setRequestsToStorage } from '~/assets/ts/storageRequests'; |
| | | import _ from 'lodash'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | import { ContactType } from '~/assets/ts/models/enum/ContactType'; |
| | | import { Gender } from '~/assets/ts/models/enum/Gender'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | @Component |
| | | export default class Questionnaire extends Vue { |
| | | @State('myConsultantList') myConsultantList!: Consultant[]; |
| | | @Action storeConsultantList!: () => Promise<number>; |
| | | @roleStorage.Getter currentRole!:string; |
| | | |
| | | genderOptions=[ |
| | | { |
| | |
| | | |
| | | beforeRouteEnter(to: any, from: any, next: any) { |
| | | next(vm => { |
| | | if (from.name === 'login' && !isLogin()) { |
| | | if (from.name === 'login' && !vm.isLogin) { |
| | | vm.$router.go(-1); |
| | | return; |
| | | } |
| | | |
| | | if (!isLogin()) { |
| | | if (!vm.isLogin) { |
| | | vm.$router.push('/login'); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | async fetch() { |
| | | if (isLogin()) { |
| | | if (this.isLogin) { |
| | | await this.storeConsultantList(); |
| | | }; |
| | | } |
| | |
| | | } |
| | | |
| | | get isLogin() { |
| | | return isLogin(); |
| | | return this.currentRole === Role.USER; |
| | | } |
| | | |
| | | private isHopeContactTimeDone():boolean{ |