Merge branch 'master' of https://192.168.0.10:8443/r/pcalife/PAM
| | |
| | | import { AxiosResponse } from 'axios'; |
| | | import { AppointmentDetail } from '../models/AppointmentDetail'; |
| | | import { ConsultantLoginInfo } from '../models/ConsultantLoginInfo'; |
| | | import _ from 'lodash'; |
| | | import { UserSetting } from '../models/account.model'; |
| | |
| | | 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 = { |
| | |
| | | } |
| | | |
| | | // åæ¶é ç´ |
| | | export function cancelAppointment(appointment: number) { |
| | | const headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | } |
| | | return http.delete('/appointment/'+appointment ,{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) { |
| | |
| | | updateTime : Date | string; |
| | | contactStatus : string; |
| | | } |
| | | |
| | | 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 : string; |
| | | agentNo : string; |
| | | customerId : number; |
| | | name : string; |
| | | } |
| | | |
| | |
| | | import { http } from "./httpClient"; |
| | | |
| | | import { ClientInfo } from "../models/client.model"; |
| | | import { AppointmentDetail } from "../models/appointment.model"; |
| | | |
| | | class AppointmentService { |
| | | |
| | |
| | | return http.post(`/appointment/recordRead/${appointmentId}`); |
| | | } |
| | | |
| | | // åå¾é ç´å®ç´°ç¯ |
| | | async getAppointmentDetail(appointmentId: number):Promise<AppointmentDetail> { |
| | | return http.get(`/appointment/getDetail/${appointmentId}`).then((res) => res.data); |
| | | } |
| | | |
| | | // åæ¶é ç´ |
| | | cancelAppointment(appointmentId: number): Promise<void> { |
| | | return http.delete(`/appointment/${appointmentId}`); |
| | | } |
| | | |
| | | } |
| | | |
| | | export default new AppointmentService(); |
| | |
| | | <script lang="ts"> |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { Vue, Component,} from 'vue-property-decorator'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | import * as _ from 'lodash'; |
| | | import { Role } from '~/assets/ts/models/enum/role'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | @Component |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Action, namespace } from 'nuxt-property-decorator'; |
| | | import { getAppointmentDetail, UserReviewsConsultantsParams, userReviewsConsultants, cancelAppointment } from '~/assets/ts/api/consultant'; |
| | | import { Vue, Component, Prop, Action, namespace, State } from 'nuxt-property-decorator'; |
| | | |
| | | import appointmentService from '~/assets/ts/services/appointment.service'; |
| | | import { isMobileDevice } from '~/assets/ts/device'; |
| | | import { hideReviews } from '~/assets/ts/const/hide-reviews'; |
| | | import { UserReviewsConsultantsParams, userReviewsConsultants } from '~/assets/ts/api/consultant'; |
| | | import { Consultant, ConsultantWithAppointmentId } from '~/assets/ts/models/consultant.model'; |
| | | import { Appointment } from '~/assets/ts/models/appointment.model'; |
| | | import { isMobileDevice } from '~/assets/ts/device'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | import { hideReviews } from '~/assets/ts/const/hide-reviews'; |
| | | import { Role } from '~/assets/ts/models/enum/role'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | const localStorage = namespace('localStorage'); |
| | | @Component({ |
| | | filters: { |
| | | formatNumber(index: number) { |
| | |
| | | }) |
| | | export default class ConsultantCard extends Vue { |
| | | |
| | | @Action |
| | | removeFromMyConsultantList!: (agentNo: string) => Promise<boolean>; |
| | | |
| | | @Action |
| | | storeConsultantList!: any; |
| | | |
| | | @Prop() |
| | | agentInfo!: Consultant | ConsultantWithAppointmentId; |
| | | |
| | | @roleStorage.Getter currentRole!:string; |
| | | @localStorage.State('current_role') |
| | | currentRole!: string; |
| | | |
| | | isVisibleDialog = false; |
| | | reviewsBtn = false; |
| | |
| | | isCancelPopup = false; |
| | | hideReviews = hideReviews; |
| | | isConfirmPopup = false; |
| | | |
| | | |
| | | appointmentDetail: any = { |
| | | age : '', |
| | | agentNo : '', |
| | | appointmentDate : '', |
| | | communicateStatus : '', |
| | | consultantReadTime: null, |
| | | consultantViewTime: null, |
| | | contactTime : '', |
| | | contactType : '', |
| | | customerId : 0, |
| | | email : '', |
| | | gender : '', |
| | | hopeContactTime : "", |
| | | id : 0, |
| | | job : "", |
| | | lastModifiedDate : '', |
| | | name : '', |
| | | otherRequirement : null, |
| | | phone : "", |
| | | requirement : '', |
| | | satisfactionScore : 0, |
| | | }; |
| | | |
| | | get notScoreAppointmentYet(): boolean { |
| | | const isAppointment = !!this.agentInfo['appointmentStatus']; |
| | |
| | | return time as string; |
| | | } |
| | | |
| | | appointmentDetail: any = { |
| | | age : '', |
| | | agentNo : '', |
| | | appointmentDate : '', |
| | | communicateStatus : '', |
| | | consultantReadTime: null, |
| | | consultantViewTime: null, |
| | | contactTime : '', |
| | | contactType : '', |
| | | customerId : 0, |
| | | email : '', |
| | | gender : '', |
| | | hopeContactTime : "", |
| | | id : 0, |
| | | job : "", |
| | | lastModifiedDate : '', |
| | | name : '', |
| | | otherRequirement : null, |
| | | phone : "", |
| | | requirement : '', |
| | | satisfactionScore : 0, |
| | | }; |
| | | |
| | | get avatarFileName() { |
| | | return this.agentInfo.img; |
| | | } |
| | |
| | | |
| | | get hopeContactTime() { |
| | | const contactList = this.appointmentDetail.hopeContactTime |
| | | .split("'").map(item => item.slice(0, item.length)); |
| | | return contactList.filter(item => !!item && item !== ",") |
| | | .split("'").map((item: any) => item.slice(0, item.length)); |
| | | return contactList.filter((item: any) => !!item && item !== ",") |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | @Action |
| | | removeFromMyConsultantList!: (agentNo: string) => Promise<boolean>; |
| | | |
| | | @Action |
| | | storeConsultantList!: () => void; |
| | | |
| | | reserveCommunication() { |
| | | const isAppointment = !!this.agentInfo['appointmentStatus']; |
| | |
| | | ? this.agentInfo['appointmentId'] |
| | | : this.latestReservedAppointment.id; |
| | | |
| | | getAppointmentDetail(appointmentId!).then(res => { |
| | | appointmentService.getAppointmentDetail(appointmentId!).then(res => { |
| | | this.appointmentDetail = { |
| | | ...this.appointmentDetail, |
| | | ...res.data, |
| | | ...res, |
| | | satisfactionScore: this.agentInfo['appointmentScore'], |
| | | }; |
| | | this.width = isMobileDevice() ? '80%' : ''; |
| | |
| | | } |
| | | |
| | | cancel() { |
| | | cancelAppointment(this.latestReservedAppointment.id).then(res => { |
| | | appointmentService.cancelAppointment(this.latestReservedAppointment.id).then(res => { |
| | | this.storeConsultantList(); |
| | | this.isVisibleDialog = false; |
| | | this.isCancelPopup = false; |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, namespace } from 'nuxt-property-decorator'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | |
| | | @Component |
| | | export default class ConsultantList extends Vue { |
| | | @Prop() agents!: Consultant[]; |
| | | @Prop() title! : string; |
| | | @Prop() title! : string; |
| | | @roleStorage.Getter isUserLogin!:boolean; |
| | | |
| | | get agentList(){ |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component } from 'vue-property-decorator'; |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | import { Role } from '~/assets/ts/models/enum/role'; |
| | | import * as _ from 'lodash'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | |
| | | import myConsultantService from '~/assets/ts/services/my-consultant.service'; |
| | | import { AgentInfo } from '~/assets/ts/models/agent-info.model'; |
| | | import { hideReviews } from '~/assets/ts/const/hide-reviews'; |
| | | import { Role } from '~/assets/ts//models/enum/Role'; |
| | | import { Role } from '~/assets/ts/models/enum/role'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | |
| | |
| | | <script lang="ts"> |
| | | import { Vue, Component , namespace } from 'nuxt-property-decorator'; |
| | | import { AxiosError } from 'axios'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | import { Role } from '~/assets/ts/models/enum/role'; |
| | | import ErrorMessageBox from '~/assets/ts/errorService'; |
| | | import loginService from '~/assets/ts/services/login.service' |
| | | |
| | |
| | | import { Vue, Component, Ref } from 'vue-property-decorator'; |
| | | import ErrorMessageBox from '~/assets/ts/errorService'; |
| | | import { OtpErrorCode } from '~/assets/ts/models/enum/otpErrorCode'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | import { Role } from '~/assets/ts/models/enum/role'; |
| | | import { LoginRequest } from '~/assets/ts/models/loginRequest.model'; |
| | | import { LoginVerify } from '~/assets/ts/models/loginVerify.model'; |
| | | import { OtpInfo } from '~/assets/ts/models/otpInfo.model'; |
| | |
| | | clearInterval(this.autoRedirectInterval); |
| | | } |
| | | |
| | | |
| | | ////////////////////////////////////////////////////////// |
| | | |
| | | detectContractReadStatus(event: any): void { |
| | | const scrollTop = Math.round(event.target.scrollTop); |
| | | const height = event.target.scrollHeight - event.target.clientHeight; |