| | |
| | | <div> |
| | | <el-row |
| | | type="flex" |
| | | ref="clientCardRef" |
| | | class="rowStyle cursor--pointer" |
| | | justify="space-between" |
| | | :class="{'new': newAppointment }" |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Action } from 'nuxt-property-decorator'; |
| | | import { Vue, Component, Prop, Action, namespace, Watch } from 'nuxt-property-decorator'; |
| | | |
| | | import appointmentService from '~/shared/services/appointment.service'; |
| | | import UtilsService from '~/shared/services/utils.service'; |
| | | import { hideReviews } from '~/shared/const/hide-reviews'; |
| | | import { ClientInfo } from '~/shared/models/client.model'; |
| | | import myConsultantService from '~/shared/services/my-consultant.service'; |
| | | import { ElRow } from 'element-ui/types/row'; |
| | | |
| | | |
| | | const localStorage = namespace('localStorage'); |
| | | @Component({ |
| | | filters: { |
| | | formatNumber(index: number) { |
| | |
| | | }) |
| | | export default class ClientList extends Vue { |
| | | @Action |
| | | updateMyAppointment!: (data: ClientInfo) => void |
| | | |
| | | @Action |
| | | storeConsultantList!: () => void; |
| | | updateMyAppointment!: (data: ClientInfo) => void; |
| | | |
| | | @Prop() |
| | | client!: ClientInfo; |
| | | |
| | | @localStorage.Mutation |
| | | storageClearAppointmentIdFromMsg!: () => void; |
| | | |
| | | isVisibleDialog = false; |
| | | dialogWidth = ''; |
| | | hideReviews = hideReviews; |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | @Watch('$route', {immediate: true}) |
| | | onRouteChange() { |
| | | const appointmentIdFromMsg = this.$route.query.appointmentId; |
| | | if (appointmentIdFromMsg && +appointmentIdFromMsg === this.client.id) { |
| | | this.openDetail(); |
| | | } |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | |
| | | } |
| | | |
| | | openDetail() { |
| | | setTimeout(() => { |
| | | (this.$refs.clientCardRef as any).$el.classList.add('currentShowStyle'); |
| | | }, 0) |
| | | |
| | | this.dialogWidth = UtilsService.isMobileDevice() ? '80%' : ''; |
| | | this.isVisibleDialog = true; |
| | | } |
| | |
| | | updatedClient.consultantReadTime = new Date().toString(); |
| | | this.updateMyAppointment(updatedClient); |
| | | }); |
| | | } |
| | | }; |
| | | this.clearAppointmentIdFromMsg(); |
| | | } |
| | | |
| | | private clearAppointmentIdFromMsg() { |
| | | this.storageClearAppointmentIdFromMsg(); |
| | | this.$router.push({query: {}}); |
| | | setTimeout(() => { |
| | | (this.$refs.clientCardRef as ElRow).$el.classList.remove('currentShowStyle') |
| | | },1000) |
| | | } |
| | | |
| | | } |
| | |
| | | margin-bottom: 10px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | transition: background-color 0.5s; |
| | | |
| | | &.new { |
| | | border-left: solid 4px $YELLOW; |
| | | } |
| | | |
| | | &.currentShowStyle { |
| | | background-color: rgba(236, 195, 178, 0.5); |
| | | transition: background-color 0.5s; |
| | | } |
| | | |
| | | .unread { |
| | | align-self: center; |
| | | |