fixed TODO#131428 從我的顧問清單或是進行預約來登入,登入成功後自動跳轉回原來頁面
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Emit, Action, State } from 'nuxt-property-decorator'; |
| | | import { Vue, Component, Prop, Emit, Action, State, namespace } from 'nuxt-property-decorator'; |
| | | import { Consultants } from '~/assets/ts/api/consultant'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | |
| | | const localStorage = namespace('localStorage'); |
| | | @Component |
| | | export default class AddAndReservedBtns extends Vue { |
| | | @Action addToMyConsultantList!: (consultantToAdd: Consultants) => Promise<boolean> |
| | | @State('myConsultantList') myConsultantList!: Consultants[]; |
| | | |
| | | @Prop() agentInfo!: Consultants; |
| | | @Prop() cusClass!: string; |
| | | isVisiblePopUp = false; |
| | |
| | | } |
| | | |
| | | reserveCommunication() { |
| | | isLogin() ? this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`) : this.$router.push('/login'); |
| | | this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`); |
| | | } |
| | | |
| | | @Emit('openPopUp') openPopUp(popUpTxt: string = '成功加入顧問清單') { |
| | |
| | | <template> |
| | | <nav class="pam-back-action-bar fix-chrome-click--issue"> |
| | | <a @click="pushRouterByLoginRole"> |
| | | <a @click="pushRouterByLoginRole" v-if="questionnaireState"> |
| | | <i class="icon-left "></i>{{ label }} |
| | | </a> |
| | | </nav> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { namespace, Watch } from 'nuxt-property-decorator'; |
| | | import { Vue, Component,} from 'vue-property-decorator'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | import * as _ from 'lodash'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | @Component |
| | | export default class UiCarousel extends Vue { |
| | | @roleStorage.Getter currentRole!:string; |
| | | questionnaireState: boolean = true; |
| | | get label(): string { |
| | | if (this.$route.name) { |
| | | const routeName = this.$route.name.split('-')[0]; |
| | |
| | | } |
| | | |
| | | pushRouterByLoginRole():void{ |
| | | const backToPrevious = ['recommendConsultant-result', 'agentInfo-agentNo', 'questionnaire-agentNo']; |
| | | const find = backToPrevious.findIndex(item => this.$route.name?.includes(item)); |
| | | find > -1 ? this.$router.go(-1) : this.$router.push('/'); |
| | | const pathName = this.$route.name; |
| | | pathName?.includes('myConsultantList') ? this.$router.push('/') : this.$router.go(-1); |
| | | } |
| | | |
| | | set label(value) { |
| | | this.questionnaireState = value === '進行預約' ? isLogin() : true; |
| | | } |
| | | } |
| | | </script> |
| | |
| | | reserveCommunication() { |
| | | const contactStatus = this.agentInfo.contactStatus; |
| | | if (!contactStatus || contactStatus === 'picked') { |
| | | isLogin() |
| | | ? this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`) |
| | | : this.$router.push('/login'); |
| | | this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`) |
| | | } else { |
| | | this.openPopUp(); |
| | | } |
| | |
| | | </template> |
| | | </div> |
| | | |
| | | |
| | | <el-row type="flex" justify="center" class="pam-login-page__action-bar mt-30"> |
| | | <el-button |
| | | type="primary" |
| | |
| | | 歡迎您登入成功,如您預約諮詢,顧問會以您留下的{{ connectDevice === 'MOBILE' ? '手機號碼' : 'Email'}}與您聯繫 |
| | | </div> |
| | | <div class="pam-popUp-txt text--center mb-10 mt-5" |
| | | >即將導回首頁</div> |
| | | >即將轉跳頁面...{{autoRedirectCounter}}秒</div> |
| | | <div class="pam-popUp-confirm-bolck pam-paragraph"> |
| | | <div class="text--center"> |
| | | <el-button |
| | |
| | | <div class="pam-popUp-title text--center" |
| | | >歡迎您登入成功</div> |
| | | <div class="pam-popUp-txt text--center mb-30 mt-5 xsTxt" |
| | | >即將導回首頁</div> |
| | | >即將轉跳頁面...{{autoRedirectCounter}}秒</div> |
| | | <div class="pam-popUp-confirm-bolck pam-paragraph"> |
| | | <div class="text--center"> |
| | | <el-button |
| | |
| | | emailResendInterval: any; |
| | | emailOtpInfo!: OtpInfo; |
| | | |
| | | autoRedirectCounter = 3; |
| | | autoRedirectInterval: any; |
| | | |
| | | name = ''; |
| | | agreeContract = false; |
| | | isReadContract = false; |
| | |
| | | |
| | | applyAccount_onAction = false; |
| | | |
| | | previousPath = ''; |
| | | mounted() { |
| | | const phoneOtpTime = localStorage.getItem('phoneOtpTime'); |
| | | const emailOtpTime = localStorage.getItem('emailOtpTime'); |
| | |
| | | this.storageIdToken(res.data.id_token); |
| | | this.storageRole(Role.USER); |
| | | this.storagePhoneOrEmail(registerInfo); |
| | | this.registerSuccessConfirmVisable = true; |
| | | this.autoRedirect(); |
| | | this.registerSuccessConfirmVisable = true; |
| | | }).catch(() => { |
| | | this.applyAccount_onAction = false; |
| | | }); |
| | |
| | | } |
| | | |
| | | private autoRedirect() { |
| | | setTimeout(() => { |
| | | this.$router.push('/') |
| | | }, 3000) |
| | | this.autoRedirectInterval = setInterval(() => { |
| | | this.autoRedirectCounter -= 1; |
| | | |
| | | if (this.autoRedirectCounter === 0) { |
| | | clearInterval(this.autoRedirectInterval); |
| | | const backToPrevious = ['questionnaire', 'myConsultantList']; |
| | | const find = backToPrevious.findIndex(item => this.previousPath.includes(item)); |
| | | find > -1 ? this.$router.go(-1) : this.$router.push('/'); |
| | | } |
| | | }, 1000) |
| | | } |
| | | |
| | | beforeRouteEnter (to, from, next) { |
| | | next(vm => { |
| | | vm.previousPath = from.path; |
| | | }) |
| | | } |
| | | |
| | | login() { |
| | | const login: LoginVerify = this.setLoginInfo(); |
| | |
| | | this.removeOtpTime(); |
| | | clearInterval(this.otpInterval); |
| | | clearInterval(this.emailResendInterval); |
| | | clearInterval(this.autoRedirectInterval); |
| | | } |
| | | |
| | | private phoneDiffTime(parseOtpTime: any) { |
| | |
| | | <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; |
| | | } |