保誠-保戶業務員媒合平台
HelenHuang
2021-12-06 1076fdc06d40646d1d6f125a3ce4d43cf4eac673
PAMapp/assets/ts/api/consultant.ts
@@ -3,6 +3,8 @@
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';
// 顧客登入(TODO: OTP認證開發前 暫時使用)
export function login(user: any) {
@@ -26,7 +28,7 @@
// 推薦保險顧問
export function recommend() {
    return service.get<Consultants[]>('/consultant/recommend')
    return service.get<Consultant[]>('/consultant/recommend')
            .then(res => res.data);
}
@@ -35,7 +37,7 @@
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.get<Consultants[]>('/consultant/favorite', {headers})
    return service.get<Consultant[]>('/consultant/favorite', {headers})
            .then(res => res.data);
}
@@ -105,20 +107,30 @@
    }
    return service.get('/appointment/getDetail/'+apointmentId, {headers})
}
export interface Consultants {
    agentNo            : string,
    name               : string,
    img                : string,
    new                : boolean,
    avgScore           : number,
    expertise          : string[],
    updateTime         : Date,
    seniority          : string,
    contactStatus?     : string;
    latestAppointmentId: number;
    role               : string;
    image?             : string;
    expertises?        : string;
//取得使用者帳號資訊
export function getUserAccountSetting() : Promise<UserSetting> {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.get<UserSetting>('/customer/info', {headers}).then(res => res.data);
}
//更新使用者帳號資訊
export function updateAccountSetting(params: any) : any {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.put('/customer/info', params ,{headers}).then(res => res.data);
}
//客戶進行滿意度評分
export function userReviewsConsultants(data: UserReviewsConsultantsParams) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.post('/satisfaction/create', data ,{headers});
}
export interface FastQueryParams {
@@ -214,3 +226,8 @@
    /** "SMS":Otp發送手機,"EMAIL":Otp發email */
    contactType: string
}
export interface UserReviewsConsultantsParams{
    appointmentId:number,
    score:number,
}