| | |
| | | <template> |
| | | <div class="ques-page--reset"> |
| | | <div class="ques-page--reset" v-if="isLogin"> |
| | | <div class="ques-header"> |
| | | <div class="ques-header__mob-banner"></div> |
| | | <div |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component } from 'vue-property-decorator'; |
| | | import { Vue, Component, namespace } from 'nuxt-property-decorator'; |
| | | import { addFavoriteConsultant, appointmentDemand, AppointmentParams, AppointmentRequests ,RegisterInfo } from '~/assets/ts/api/consultant'; |
| | | import { getRequestsFromStorage, setRequestsToStorage } from '~/assets/ts/storageRequests'; |
| | | import { Gender } from '~/assets/ts/models/enum/Gender'; |
| | | import { ContactType } from '~/assets/ts/models/enum/ContactType'; |
| | | import _ from 'lodash'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | |
| | | @Component |
| | | export default class Questionnaire extends Vue { |
| | |
| | | myRequest: AppointmentRequests = { |
| | | phone: this.userInfo?.phone ? this.userInfo.phone :'', |
| | | email: this.userInfo?.email ? this.userInfo.email :'', |
| | | contactType: _.isEqual(this.userInfo.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL , |
| | | contactType: _.isEqual(this.userInfo?.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL , |
| | | gender: '', |
| | | age: '', |
| | | job: '', |
| | |
| | | showDrawer= false; |
| | | sendReserve = false; |
| | | |
| | | beforeRouteEnter (to, from, next) { |
| | | next(vm => { |
| | | if (from.name === 'login' && !isLogin()) { |
| | | vm.$router.go(-1); |
| | | return; |
| | | } |
| | | |
| | | if (!isLogin()) { |
| | | vm.$router.push('/login'); |
| | | } |
| | | }) |
| | | } |
| | | mounted() { |
| | | const storageMyRequest = getRequestsFromStorage(); |
| | | if (storageMyRequest) { |
| | |
| | | : !this.phoneValid; |
| | | } |
| | | |
| | | get isLogin() { |
| | | return isLogin(); |
| | | } |
| | | |
| | | private isHopeContactTimeDone():boolean{ |
| | | return this.myRequest.hopeContactTime[0]?.selectWeekOptions.length >0 && this.myRequest.hopeContactTime[0]?.selectTimesOptions.length >0; |
| | | } |