From 76c1ce3c2eb001560bfb785f7b2f62d4ec64dcb6 Mon Sep 17 00:00:00 2001
From: Mila <Mila@pollex.com.tw>
Date: 星期五, 10 十二月 2021 09:49:50 +0800
Subject: [PATCH] update 使用 currentRole 判斷目前是否為顧問/客戶登入狀態

---
 PAMapp/pages/questionnaire/_agentNo.vue |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/PAMapp/pages/questionnaire/_agentNo.vue b/PAMapp/pages/questionnaire/_agentNo.vue
index f79843c..402e190 100644
--- a/PAMapp/pages/questionnaire/_agentNo.vue
+++ b/PAMapp/pages/questionnaire/_agentNo.vue
@@ -97,7 +97,7 @@
       </div>
     </div>
 
-    <PopUpFrame :isOpen.sync="showDrawer" :drawerSize=" '95%' ">
+    <PopUpFrame :isOpen.sync="showDrawer">
       <div class="qaTextTitle mdTxt">
         <strong>�閬岷������</strong>
       </div>
@@ -136,19 +136,21 @@
 </template>
 
 <script lang="ts">
-import { Vue, Component, State, Action, Watch } from 'nuxt-property-decorator';
+import { Vue, Component, State, Action, Watch, namespace } from 'nuxt-property-decorator';
 import { addFavoriteConsultant, appointmentDemand, AppointmentParams, AppointmentRequests ,editAppointment,RegisterInfo } from '~/assets/ts/api/consultant';
 import { getRequestQuestionFromStorage, getRequestsFromStorage, removeRequestQuestionFromStorage, setRequestsToStorage } from '~/assets/ts/storageRequests';
 import _ from 'lodash';
-import { isLogin } from '~/assets/ts/auth';
 import { Consultant } from '~/assets/ts/models/consultant.model';
 import { ContactType } from '~/assets/ts/models/enum/ContactType';
 import { Gender } from '~/assets/ts/models/enum/Gender';
+import { Role } from '~/assets/ts/models/enum/Role';
 
+  const roleStorage = namespace('localStorage');
   @Component
   export default class Questionnaire extends Vue {
     @State('myConsultantList') myConsultantList!: Consultant[];
     @Action storeConsultantList!: () => Promise<number>;
+    @roleStorage.Getter currentRole!:string;
 
     genderOptions=[
       {
@@ -204,10 +206,6 @@
       {
         title:'41-50 甇�',
         label:'41-50'
-      },
-      {
-        title:'46-55 甇�',
-        label:'46-55',
       },
       {
         title:'51-60 甇�',
@@ -274,19 +272,19 @@
 
     beforeRouteEnter(to: any, from: any, next: any) {
       next(vm => {
-        if (from.name === 'login' && !isLogin()) {
+        if (from.name === 'login' && !vm.isLogin) {
           vm.$router.go(-1);
           return;
         }
 
-        if (!isLogin()) {
+        if (!vm.isLogin) {
           vm.$router.push('/login');
         }
       })
     }
 
     async fetch() {
-      if (isLogin()) {
+      if (this.isLogin) {
         await this.storeConsultantList();
       };
     }
@@ -339,7 +337,7 @@
     }
 
     get isLogin() {
-      return isLogin();
+      return this.currentRole === Role.USER;
     }
 
     private isHopeContactTimeDone():boolean{
@@ -521,7 +519,7 @@
 //閰喟敦���rawer銝剝�摰寧征��之撠身蝵�
 .qa-dialog{
   overflow-y:auto;
-  height: 500px;
+  height: 60vh;
   margin-top: 20px;
 }
 

--
Gitblit v1.8.0