From 6fa4bba623713c396432ba8b863846883d6a1906 Mon Sep 17 00:00:00 2001 From: wayne <wayne8692wayne8692@gmail.com> Date: 星期三, 26 一月 2022 10:52:23 +0800 Subject: [PATCH] Merge branch 'pollex-dev' into sit --- PAMapp/shared/services/my-consultant.service.ts | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/PAMapp/shared/services/my-consultant.service.ts b/PAMapp/shared/services/my-consultant.service.ts index c4d4fa2..3d4dd78 100644 --- a/PAMapp/shared/services/my-consultant.service.ts +++ b/PAMapp/shared/services/my-consultant.service.ts @@ -1,8 +1,9 @@ -import { http } from "./httpClient"; +import _ from "lodash"; +import { http } from "./httpClient"; import { AgentInfo } from '~/shared/models/agent-info.model'; import { Consultant } from "../models/consultant.model"; - +import { Appointment } from "../models/appointment.model"; class MyConsultantService { async getFavoriteConsultantList(): Promise<Consultant[]> { @@ -29,6 +30,23 @@ return http.delete(`/consultant/favorite/${agentId}`); } + // 璅�撌脰蝯� + markAsContact(appointmentId: number): Promise<Appointment> { + return http.post(`/appointment/markAsContacted/${appointmentId}`).then(res => res.data); + } + + // ���“����� + getConsultantAvatar(agentNo:string):Promise<string>{ + return http.get(`/consultant/avatar/${agentNo}`,{ responseType : 'arraybuffer' }) + .then( response => { + const toBase64 = window.btoa( + _.reduce( new Uint8Array(response.data),(data,byte) => + data + String.fromCharCode(byte),'') + ); + const imgSrc = `data:image/png;base64,${toBase64}`; + return imgSrc; + }); + } } export default new MyConsultantService(); -- Gitblit v1.8.0