保誠-保戶業務員媒合平台
Mila
2021-12-22 bdae23a40c461c2c6b6ee614f661eac731c949c8
PAMapp/pages/myAppointmentList.vue
@@ -6,20 +6,21 @@
                <div
                    class="cus-tab-item"
                    :class="{'is-active': activeTabName === 'appointmentList'}"
                    @click="tabClick('appointmentList')"
                    @click="clickTab('appointmentList')"
                >客戶預約
                    <span class="p">({{appointmentList.length}})</span>
                </div>
                <div
                    class="cus-tab-item"
                    :class="{'is-active': activeTabName === 'contactedList'}"
                    @click="tabClick('contactedList')"
                    @click="clickTab('contactedList')"
                >已聯絡
                    <span class="p">({{contactedList.length}})</span>
                </div>
            </div>
            <NuxtChild></NuxtChild>
        </div>
        <!-- DIALOG -->
@@ -44,7 +45,7 @@
import * as _ from 'lodash';
import { ClientInfo } from '~/assets/ts/models/client.model';
import { ClientInfo } from '~/shared/models/client.model';
@Component({
    layout: 'home',
@@ -52,20 +53,8 @@
})
export default class ClientReservedList extends Vue {
    activeTabName = 'appointmentList';
    appointmentList: ClientInfo[] = [];
    contactedList: ClientInfo[] = [];
    clients: ClientInfo[] = [];
    showNewAppointmentHint = false;
    @State('myAppointmentList')
    myAppointmentList!: ClientInfo[];
    @State('myNewAppointmentSum')
    newAppointmentSum!: number;
    @Action
    storeMyAppointmentList!: () => Promise<number>;
    @Watch('myAppointmentList')
    onMyAppointmentListChange() {
@@ -76,22 +65,39 @@
            .filter(item => item.communicateStatus !== 'contacted');
    }
    //////////////////////////////////////////////////////////////////////
    @State('myNewAppointmentSum')
    newAppointmentSum!: number;
    mounted() {
      this.setActivatedTab();
      this.storeMyAppointmentList();
    @Watch('newAppointmentSum')
    newAppointmentSumChange(): void {
      this.showNewAppointmentHint = this.newAppointmentSum > 0;
    }
    //////////////////////////////////////////////////////////////////////
    activeTabName = 'appointmentList';
    appointmentList: ClientInfo[] = [];
    contactedList: ClientInfo[] = [];
    clients: ClientInfo[] = [];
    showNewAppointmentHint = false;
    get bannerClassName() {
        const routeName = this.$route.name || '';
        return this.routeFormatBannerClass(routeName);
    };
    tabClick(path: string) {
    //////////////////////////////////////////////////////////////////////
    mounted() {
      this.setActivatedTab();
      this.storeMyAppointmentList();
    }
    //////////////////////////////////////////////////////////////////////
    @Action
    storeMyAppointmentList!: () => Promise<number>;
    clickTab(path: string): void {
      this.activeTabName = path;
      this.$router.push(`/myAppointmentList/${this.activeTabName}`);
    }