| | |
| | | :options="requirementOptions" /> |
| | | </div> |
| | | <div class="pam-paragraph"> |
| | | <div class="mdTxt">諮詢方式</div> |
| | | <SingleSelectBtn class="mt-10" |
| | | :singleSelected.sync="myRequest.consultationMethod" |
| | | :options="consultationMethodOptions" /> |
| | | </div> |
| | | <div class="pam-paragraph"> |
| | | <div class="mdTxt">您的性別</div> |
| | | <SingleSelectBtn class="mt-10" |
| | | :singleSelected.sync="myRequest.gender" |
| | |
| | | } |
| | | ]; |
| | | |
| | | consultationMethodOptions = [ |
| | | { |
| | | title: '線上', |
| | | label: 'online' |
| | | }, |
| | | { |
| | | title: '線下', |
| | | label: 'offline' |
| | | } |
| | | ]; |
| | | |
| | | requirementOptions=[ |
| | | { |
| | | title:'健康與保障', |
| | |
| | | selectTimesOptions: [], |
| | | }], |
| | | agentNo: '', |
| | | consultationMethod: '', |
| | | }; |
| | | |
| | | showDrawer= false; |
| | |
| | | return { |
| | | ...appointmentInfo, |
| | | hopeContactTime: hopeContactTime, |
| | | requirement: appointmentInfo.requirement.split(',') |
| | | requirement: appointmentInfo.requirement |
| | | ? appointmentInfo.requirement.split(',') |
| | | : [] |
| | | } |
| | | } else { |
| | | return null; |
| | |
| | | |
| | | //////////////////////////////////////////////////////////////////////////// |
| | | |
| | | sentDemand() { |
| | | if (this.isEditBtn) { |
| | | this.editAppointmentDemand(); |
| | | async sentDemand() { |
| | | if (typeof this.isEditBtn !== 'undefined' && this.isEditBtn) { |
| | | await this.editAppointmentDemand(); |
| | | } else { |
| | | queryConsultantService.addFavoriteConsultant([{ agentNo: this.$route.params.agentNo, createdTime: new Date().toISOString()}]).then(res => this.sentAppointmentDemand()); |
| | | } |
| | | const editSettingInfo: UserSetting = { |
| | | name: this.myRequest.name, |
| | | phone: this.myRequest.phone, |
| | | email: this.myRequest.email, |
| | | // 使用 async/await 來等待異步操作的回傳結果 |
| | | const addFavoriteAgentList = [{ agentNo: this.$route.params.agentNo, createdTime: new Date().toISOString() }]; |
| | | const response = await queryConsultantService.addFavoriteConsultant(addFavoriteAgentList); |
| | | |
| | | // 確保異步操作的回傳結果不為 null 或 undefined |
| | | if (!response) { |
| | | throw new Error('queryConsultantService.addFavoriteConsultant returned null-like value.'); |
| | | } else { |
| | | if (typeof this.editAppointmentDemand === 'function') { |
| | | // 確保 this.editAppointmentDemand 是一個函數 |
| | | await this.editAppointmentDemand(); |
| | | } else { |
| | | // 處理 this.editAppointmentDemand 未定義的情況 |
| | | throw new Error('this.editAppointmentDemand is not defined or not a function.'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | accountSettingService.updateAccountSetting(editSettingInfo).then((_) => { |
| | | this.storageUserInfo(this.userInfo); |
| | | }); |
| | | const editSettingInfo: UserSetting = { |
| | | name: this.myRequest.name, |
| | | phone: this.myRequest.phone, |
| | | email: this.myRequest.email, |
| | | }; |
| | | |
| | | await accountSettingService.updateAccountSetting(editSettingInfo); |
| | | this.storageUserInfo(this.userInfo); |
| | | } |
| | | |
| | | private editAppointmentDemand() { |