| | |
| | | import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators' |
| | | import { ClientInfo, getMyAppointmentList } from '~/assets/ts/api/appointment'; |
| | | import { ClientInfo, getMyAppointmentList, getMyReviewLog } from '~/assets/ts/api/appointment'; |
| | | // import * as consultant from '~/assets/ts/api/consultant'; |
| | | import { Consultants,recommend,AgentOfStrictQuery, getFavoriteConsultant, addFavoriteConsultant, deleteConsultant, strictQuery } from '~/assets/ts/api/consultant'; |
| | | import { recommend, AgentOfStrictQuery, getFavoriteConsultant, addFavoriteConsultant, deleteConsultant, strictQuery } from '~/assets/ts/api/consultant'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | import { AppointmentLog } from '~/assets/ts/models/appointment.model'; |
| | | import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant'; |
| | | |
| | | @Module |
| | |
| | | myConsultantList: Consultants[] = []; |
| | | |
| | | myAppointmentList: ClientInfo[] = []; |
| | | |
| | | myAppointmentReviewLogList: AppointmentLog[] = []; |
| | | |
| | | @Mutation updateRecommend(data: Consultants[]) { |
| | | this.recommendList = data; |
| | |
| | | |
| | | @Mutation updateMyAppointmentList(data: ClientInfo[]) { |
| | | this.myAppointmentList = data; |
| | | } |
| | | |
| | | @Mutation updateMyAppointmentReviewLog(data: AppointmentLog[]) { |
| | | this.myAppointmentReviewLogList = data; |
| | | } |
| | | |
| | | @Action storeRecommendList() { |
| | |
| | | }); |
| | | } |
| | | |
| | | @Action |
| | | storeMyAppointmentReviewLog() { |
| | | getMyReviewLog().then((data) => { |
| | | this.context.commit('updateMyAppointmentReviewLog', data); |
| | | }); |
| | | } |
| | | |
| | | @Action updateMyAppointment(myAppointment: ClientInfo) { |
| | | const data = this.myAppointmentList.filter(item => item.id !== myAppointment.id); |
| | | data.unshift(myAppointment); |