| | |
| | | <div class="ques-page--reset"> |
| | | <div class="ques-header"> |
| | | <div class="ques-header__mob-banner"></div> |
| | | <div class="ques-header__info" v-if="myRequest.contactType==='phone'"> |
| | | <div |
| | | class="ques-header__info" |
| | | v-if="myRequest.contactType==='phone'"> |
| | | <div class="text--middle"> |
| | | <div class="mdTxt">你指定的聯繫方式</div> |
| | | <div class="mt-10"> |
| | |
| | | <span v-show="!phoneValid">手機號碼格式有誤</span> |
| | | </div> |
| | | </div> |
| | | <div class="mt-30" v-if="checkPhoneLength&&phoneValid"> |
| | | <div class="mt-30" v-if="phoneValid"> |
| | | <div class="datepicker"> |
| | | <span class="mdTxt">手機連絡的方便時間</span> |
| | | <PhoneContactTimePicker |
| | |
| | | </div> |
| | | <div class="pam-paragraph ques-footer"> |
| | | <el-button type="primary" |
| | | :disabled="isRequiredByInit || !phoneValid" |
| | | :disabled="isDisabledSubmitBtn" |
| | | @click.native="sentDemand"> |
| | | 送出 |
| | | </el-button> |
| | |
| | | import { Gender } from '~/assets/ts/models/enum/Gender'; |
| | | import { ContactType } from '~/assets/ts/models/enum/ContactType'; |
| | | import _ from 'lodash'; |
| | | |
| | | @Component |
| | | export default class Questionnaire extends Vue { |
| | | genderOptions=[ |
| | |
| | | label:Gender.FEMALE, |
| | | } |
| | | ]; |
| | | |
| | | requirementOptions=[ |
| | | { |
| | | title:'健康與保障', |
| | |
| | | label:'分紅保單相關', |
| | | }, |
| | | ]; |
| | | |
| | | ageRangeOptions=[ |
| | | { |
| | | title:'20歲以下', |
| | |
| | | label:'over_71', |
| | | } |
| | | ]; |
| | | |
| | | quesAboutList = [ |
| | | { |
| | | title:'健康與保障', |
| | |
| | | content:'匹配度是透過嚴選配對或快速篩選後,將每一位保險顧問資料進行比對後排序推薦給您的媒合數值,您可以作為選擇適合顧問的參考值。' |
| | | } |
| | | ]; |
| | | myRequest= { |
| | | |
| | | myRequest: AppointmentRequests = { |
| | | phone:this.userInfo?.phone ? this.userInfo.phone :'', |
| | | email:this.userInfo?.email ? this.userInfo.email :'', |
| | | contactType:_.includes(this.userInfo.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL , |
| | | contactType: _.isEqual(this.userInfo.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL , |
| | | gender: '', |
| | | age: '', |
| | | job: '', |
| | |
| | | this.myRequest = storageMyRequest; |
| | | } |
| | | } |
| | | |
| | | get phoneValid():boolean{ |
| | | const rule = /^09[0-9]{8}$/; |
| | | return this.myRequest.phone ? rule.test(this.myRequest.phone) : true; |
| | | return this.myRequest.phone ? rule.test(this.myRequest.phone) && _.isEqual(this.myRequest.phone.length,10) : true; |
| | | } |
| | | |
| | | get userInfo():RegisterInfo{ |
| | | const initUserInfo = JSON.parse(localStorage.getItem('userInfo')); |
| | | const initUserInfo = JSON.parse(localStorage.getItem('userInfo')!); |
| | | return initUserInfo; |
| | | } |
| | | |
| | | get isMainContractPhoneByLocalStorage():boolean{ |
| | | return true; |
| | | } |
| | | |
| | | get isRequiredByInit():boolean{ |
| | | get isDisabledSubmitBtn(): boolean { |
| | | return _.includes(this.myRequest.contactType,ContactType.PHONE) |
| | | ? !this.isHopeContactTimeDone() |
| | | :false; |
| | | : !this.phoneValid; |
| | | } |
| | | get checkPhoneLength():boolean{ |
| | | return _.isEqual(this.myRequest.phone.length,10); |
| | | } |
| | | |
| | | private isHopeContactTimeDone():boolean{ |
| | | return this.myRequest.hopeContactTime[0].selectWeekOptions.length >0 && this.myRequest.hopeContactTime[0].selectTimesOptions.length >0; |
| | | } |
| | | |
| | | |
| | | sentDemand() { |
| | | addFavoriteConsultant([this.myRequest.agentNo]).then(res => this.sentAppointmentDemand()); |
| | | } |
| | | |
| | | private sentAppointmentDemand() { |
| | | |
| | | const data: AppointmentParams = { |
| | | ...this.myRequest, |
| | | requirement: _.map(this.myRequest.requirement,o=>o).toString(), |
| | | hopeContactTime:this.phoneValid&&this.checkPhoneLength ? this.getHopeContactTime() :'', |
| | | hopeContactTime:this.phoneValid ? this.getHopeContactTime() :'', |
| | | }; |
| | | |
| | | appointmentDemand(data).then(res => { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | export interface SelectedQuestion { |
| | | name: string; |
| | | selected: boolean; |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | margin-bottom: 26px; |
| | | } |
| | | |
| | | //drawer最底下文字樣式 |
| | | .qa-dialog-footer{ |
| | | display: flex; |
| | | justify-content: center; |
| | | margin-bottom: 81px; |
| | | color: #ED1B2E; |
| | | cursor: pointer; |
| | | }//drawer最底下文字樣式 |
| | | } |
| | | |
| | | //送出按鈕樣式與排版 |
| | | .ques-footer{ |
| | | justify-content: center; |
| | | margin: 30px 0; |
| | |
| | | pointer-events: none; |
| | | } |
| | | } |
| | | }//送出按鈕樣式與排版 |
| | | } |
| | | |
| | | //詳細問題drawer中間內容空間大小設置 |
| | | .qa-dialog{ |
| | | overflow-y:auto; |
| | | height: 500px; |
| | | margin-top: 20px; |
| | | }//詳細問題drawer中間內容空間大小設置 |
| | | } |
| | | |
| | | //詳細問題drawer主要標題 |
| | | .qaTextTitle{ |
| | | margin-top:30px; |
| | | display: flex; |
| | | justify-content: center; |
| | | }//詳細問題drawer主要標題 |
| | | } |
| | | |
| | | .el-button+.el-button{ |
| | | margin-left: 0; |
| | |
| | | .ques-page--reset.pam-page-container{ |
| | | margin: 0px auto; |
| | | } |
| | | |
| | | .ques-header{ |
| | | position: relative; |
| | | } |
| | | |
| | | .ques-header__mob-banner{ |
| | | width: 100%; |
| | | min-height: 80px; |
| | |
| | | background-size: cover; |
| | | background-position: center; |
| | | } |
| | | |
| | | .ques-header__info{ |
| | | position: relative; |
| | | padding:30px 20px; |
| | |
| | | background-color: #B3E7E3; |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | .ques-header__input-block{ |
| | | display: flex; |
| | | align-items: center; |