保誠-保戶業務員媒合平台
Mila
2021-12-16 6b88c4b2695f21103322ab1fc8dc331806c56fa6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import { AxiosResponse } from 'axios';
import { AppointmentDetail } from '../models/AppointmentDetail';
import { ConsultantLoginInfo } from '../models/ConsultantLoginInfo';
import _ from 'lodash';
import { UserSetting } from '../models/account.model';
import { Consultant } from '~/assets/ts/models/consultant.model';
import { http } from '../services/httpClient';
import { FastQueryParams } from '../models/quickFilter.model';
 
 
// 推薦保險顧問
export function recommend() {
    return http.get<Consultant[]>('/consultant/recommend')
            .then(res => res.data);
}
 
// 快速篩選
export function fastQuery(data: FastQueryParams) {
    return http.post<Consultant[]>('/consultant/fastQuery', data).then(res => res.data);
}
 
// 嚴選配對
export function strictQuery(data:StrictQueryParams):Promise<AxiosResponse<AgentOfStrictQuery[]>>{
    return http.post('/consultant/strictQuery', data)
}
 
// 加入顧問
export function addFavoriteConsultant(agentNoList: string[]) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.post('/consultant/favorite', {agentNoList}, {headers})
}
 
// 預約前詢問
export function appointmentDemand(data: AppointmentParams) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.post('/appointment/customer/create', data, {headers})
}
 
//顧問詳細資訊
export function getConsultantDetail(agentNo:string){
    return http.get('/consultant/detail', {params:{agentNo:agentNo}})
}
 
// 移除顧問
export function deleteConsultant(agentId: string) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.delete('/consultant/favorite/'+agentId, {headers})
}
 
// 取得預約單細節
export function getAppointmentDetail(apointmentId: number):Promise<AxiosResponse<AppointmentDetail>> {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.get('/appointment/getDetail/'+apointmentId, {headers})
}
 
//取得使用者帳號資訊
export function getUserAccountSetting() : Promise<UserSetting> {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.get<UserSetting>('/customer/info', {headers}).then(res => res.data);
}
 
//更新使用者帳號資訊
export function updateAccountSetting(params: any) : any {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.put('/customer/info', params ,{headers}).then(res => res.data);
}
 
//客戶進行滿意度評分
 
export function userReviewsConsultants(data: UserReviewsConsultantsParams) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.post('/satisfaction/create', data ,{headers});
}
 
// 取消預約
export function cancelAppointment(appointment: number) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.delete('/appointment/'+appointment ,{headers});
}
 
// 編輯預約
export function editAppointment(editAppointmentParams: editAppointmentParams) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.put('/appointment', editAppointmentParams, {headers});
}
 
export interface AppointmentRequests {
    phone          : string,
    email          : string,
    contactType    : string,
    gender         : string,
    age            : string,
    job            : string,
    requirement    : string[],
    hopeContactTime: ContactTime[],
    agentNo        : string,
}
export interface ContactTime {
  selectWeekOptions : string[],
  selectTimesOptions: string[]
}
export interface AppointmentParams {
    phone          : string,
    email          : string,
    contactType    : string,
    gender         : string,
    age            : string,
    job            : string,
    requirement    : string,
    hopeContactTime: string,
    agentNo        : string
}
export interface StrictQueryParams{
    gender          : string;
    avgScore        : number;
    status          : string;    //phase 1 disable
    area            : string;
    requirements    : string[];
    otherRequirement: string;
    seniority       : string;
    popularTags     : string[];
    otherPopularTags: string;
}
export interface AgentOfStrictQuery {
    agentNo      : string;
    name         : string;
    img          : string;
    expertise    : string[];
    avgScore     : number;
    contactStatus: null;
    updateTime   : null;
    seniority    : string;
    new          : boolean;
}
export interface RequestOfLoginSuccess{
  id_token: string;
}
 
export interface UserReviewsConsultantsParams{
    appointmentId:number,
    score:number,
}
 
export interface editAppointmentParams {
    id: number,
    phone: string,
    email: string,
    contactType: string,
    gender: string,
    age: string,
    job: string,
    requirement: string,
    hopeContactTime: string,
    otherRequirement: null
}