| | |
| | | import { service } from '~/assets/ts/api/share'; |
| | | import { AxiosResponse } from 'axios'; |
| | | import { AppointmentDetail } from '../models/AppointmentDetail'; |
| | | import { ConsultantLoginInfo } from '../models/ConsultantLoginInfo'; |
| | | |
| | | // 顧客登入(TODO: OTP認證開發前 暫時使用) |
| | | export function login(user: any) { |
| | |
| | | |
| | | // 推薦保險顧問 |
| | | export function recommend() { |
| | | return service.get('/consultant/recommend') |
| | | return service.get<Consultants[]>('/consultant/recommend') |
| | | .then(res => res.data); |
| | | } |
| | | |
| | | // 我的顧問清單 |
| | | export function getFavoriteConsultant():Promise<AxiosResponse<Consultants[]>> { |
| | | export function getFavoriteConsultant() { |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.get('/consultant/favorite', {headers}); |
| | | return service.get<Consultants[]>('/consultant/favorite', {headers}) |
| | | .then(res => res.data); |
| | | } |
| | | |
| | | // 快速篩選 |
| | |
| | | } |
| | | |
| | | // 嚴選配對 |
| | | export function strictQuery(data:StrictQueryParams):Promise<AxiosResponse<AgentOfStrictQuery>>{ |
| | | export function strictQuery(data:StrictQueryParams):Promise<AxiosResponse<AgentOfStrictQuery[]>>{ |
| | | return service.post('/consultant/strictQuery', data) |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | // 取得驗證碼圖片 |
| | | // 取得驗證碼圖片 |
| | | export function getVerificationCodeImg():Promise<string>{ |
| | | return new Promise((resolve, reject)=>{ |
| | | resolve(''); |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 顧問登入 |
| | | export function logInToConsultant(consultantDto:ConsultantLoginInfo):Promise<boolean>{ |
| | | console.log('consultantDto',consultantDto); |
| | | return new Promise((resolve, reject)=>{ |
| | | setTimeout(()=>{ |
| | | resolve(true); |
| | | },1000) |
| | | }) |
| | | export function logInToConsultant(consultantDto:ConsultantLoginInfo):Promise<AxiosResponse<RequestOfLoginSuccess>>{ |
| | | return service.post('/eService/authenticate',consultantDto); |
| | | } |
| | | |
| | | // 取得預約單細節 |
| | |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return service.get('/appointment/getDetail/'+apointmentId, {headers}) |
| | | } |
| | | export interface ConsultantLoginInfo{ |
| | | account:string, |
| | | password:string, |
| | | verificationCode:string, |
| | | } |
| | | export interface Consultants { |
| | | agentNo: string, |
| | |
| | | seniority: string, |
| | | contactStatus?: string; |
| | | latestAppointmentId: number; |
| | | role: string; |
| | | image?: string; |
| | | expertises?: string; |
| | | } |
| | | |
| | | export interface FastQueryParams { |
| | |
| | | status: string |
| | | } |
| | | |
| | | export interface AppointmentRequests { |
| | | connectDevices: any[], |
| | | hopeContactTime: any, |
| | | email?: string, |
| | | job?: string, |
| | | otherJob?: string, |
| | | gender?: string, |
| | | myQuestion: any[], |
| | | age?: string, |
| | | } |
| | | export interface AppointmentParams { |
| | | phone: string, |
| | | email: string, |
| | | phone?: string, |
| | | email?: string, |
| | | contactType: string, |
| | | gender: string, |
| | | age: string, |
| | | job: string, |
| | | gender?: string, |
| | | age?: string, |
| | | job?: string, |
| | | requirement: string, |
| | | hopeContactTime: string, |
| | | otherRequirement: string, |
| | | hopeContactTime?: string, |
| | | agentNo: string |
| | | } |
| | | export interface StrictQueryParams{ |
| | |
| | | new: boolean; |
| | | } |
| | | |
| | | export interface AppointmentDetail { |
| | | id: number, |
| | | phone: string, |
| | | email: string, |
| | | contactType: string, |
| | | gender: string, |
| | | age: string, |
| | | job: string, |
| | | requirement: string, |
| | | communicateStatus: string, |
| | | hopeContactTime: string, |
| | | otherRequirement: string, |
| | | appointmentDate: Date, |
| | | agentNo: string, |
| | | customerId: number, |
| | | name: string |
| | | } |