From 435fa4eca47eab9b41f254dd55dc6572244b96a4 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期二, 18 七月 2023 12:34:30 +0800
Subject: [PATCH] Update: 依據來源 url parameters 切換 banner (FILM1: education, FILM2: Health)

---
 PAMapp/pages/index.vue |   38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/PAMapp/pages/index.vue b/PAMapp/pages/index.vue
index 260a326..0826e0c 100644
--- a/PAMapp/pages/index.vue
+++ b/PAMapp/pages/index.vue
@@ -145,22 +145,21 @@
 </template>
 
 <script lang="ts">
-  import { Vue, Component, State, Action, Watch, namespace } from 'nuxt-property-decorator';
+import {Action, Component, Mutation, namespace, State, Vue, Watch} from 'nuxt-property-decorator';
 
-  import appointmentService from '~/shared/services/appointment.service';
-  import utilService, {AccessFroms} from '~/shared/services/utils.service';
-  import reviewsService from '~/shared/services/reviews.service';
-  import UtilsService from '~/shared/services/utils.service';
-  import myConsultantService from '~/shared/services/my-consultant.service';
-  import { Appointment, AppointmentClosedInfo } from '~/shared/models/appointment.model';
-  import { Consultant } from '~/shared/models/consultant.model';
-  import { UserReviewParams } from '~/shared/models/reviews.model';
-  import { StrictQueryParams } from '~/shared/models/strict-query.model';
-  import { AgentInfo } from '~/shared/models/agent-info.model';
-  import { ContactStatus } from '~/shared/models/enum/contact-status';
-import { SatisfactionType } from '~/shared/models/enum/satisfaction-type';
+import appointmentService from '~/shared/services/appointment.service';
+import utilService, {AccessFroms} from '~/shared/services/utils.service';
+import reviewsService from '~/shared/services/reviews.service';
+import myConsultantService from '~/shared/services/my-consultant.service';
+import {Appointment, AppointmentClosedInfo} from '~/shared/models/appointment.model';
+import {Consultant} from '~/shared/models/consultant.model';
+import {UserReviewParams} from '~/shared/models/reviews.model';
+import {StrictQueryParams} from '~/shared/models/strict-query.model';
+import {AgentInfo} from '~/shared/models/agent-info.model';
+import {ContactStatus} from '~/shared/models/enum/contact-status';
+import {SatisfactionType} from '~/shared/models/enum/satisfaction-type';
 
-  const localStorage = namespace('localStorage');
+const localStorage = namespace('localStorage');
   const roleStorage = namespace('localStorage');
 
   @Component({
@@ -185,6 +184,9 @@
 
     @Action
     storeConsultantList!: any;
+
+    @Mutation
+    setAccessSource!: (accessSource: AccessFroms) => void;
 
     @localStorage.Mutation
     storageClearQuickFilter!: () => void;
@@ -224,7 +226,7 @@
       appointmentDate   : '',
       appointmentMemoList: [],
       appointmentNoticeLogs: [],
-      communicateStatus : this.contactStatus.PICKED,
+      communicateStatus: this.contactStatus.PICKED,
       consultantReadTime: '',
       consultantViewTime: '',
       contactTime       : '',
@@ -263,7 +265,9 @@
 
     mounted() {
       if (this.$route.query.from) {
-        utilService.insertAccessFrom(this.$route.query.from as AccessFroms);
+        const fromSource = this.$route.query.from as AccessFroms;
+        this.setAccessSource(fromSource);
+        utilService.insertAccessFrom(fromSource);
       }
       if (this.isAdminLogin) {
         this.$router.push('/myAppointmentList/appointmentList');
@@ -333,7 +337,7 @@
           const appointmentInfo = values[1] as Appointment;
           this.consultantName = agentInfo.name;
           this.appointmentDetail = appointmentInfo;
-          this.appointmentDialogWidth = UtilsService.isMobileDevice() ? '80%' : '';
+          this.appointmentDialogWidth = utilService.isMobileDevice() ? '80%' : '';
           this.isShowAppointmentDialog = true;
           switch (reason) {
             case 'inviteReviewConsultant':

--
Gitblit v1.8.0