From f2f30919daac6f577c5236785009c510ebb2ccb7 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期二, 07 十二月 2021 12:18:08 +0800
Subject: [PATCH] update#132068: 嚴選配對篩選後,進行預約,想要詢問的問題等沒有自動帶入

---
 PAMapp/pages/agentInfo/_agentNo.vue        |   33 ++++++++--------
 PAMapp/pages/questionnaire/_agentNo.vue    |   45 +++++++++++++++-------
 PAMapp/pages/recommendConsultant/index.vue |    4 ++
 PAMapp/assets/ts/api/consultant.ts         |   32 ++++++++--------
 4 files changed, 66 insertions(+), 48 deletions(-)

diff --git a/PAMapp/assets/ts/api/consultant.ts b/PAMapp/assets/ts/api/consultant.ts
index 08935d3..a797075 100644
--- a/PAMapp/assets/ts/api/consultant.ts
+++ b/PAMapp/assets/ts/api/consultant.ts
@@ -167,26 +167,26 @@
     agentNo        : string
 }
 export interface StrictQueryParams{
-    gender:           string;
-    avgScore:         number;
-    status:           string; //phase 1 disable
-    area:             string;
-    requirements:     string[];
+    gender          : string;
+    avgScore        : number;
+    status          : string;    //phase 1 disable
+    area            : string;
+    requirements    : string[];
     otherRequirement: string;
-    seniority:        string;
-    popularTags:      string[];
+    seniority       : string;
+    popularTags     : string[];
     otherPopularTags: string;
 }
 export interface AgentOfStrictQuery {
-    agentNo:       string;
-    name:          string;
-    img:           string;
-    expertise:     string[];
-    avgScore:      number;
+    agentNo      : string;
+    name         : string;
+    img          : string;
+    expertise    : string[];
+    avgScore     : number;
     contactStatus: null;
-    updateTime:    null;
-    seniority:     string;
-    new:           boolean;
+    updateTime   : null;
+    seniority    : string;
+    new          : boolean;
 }
 export interface RequestOfLoginSuccess{
   id_token: string;
@@ -230,4 +230,4 @@
 export interface UserReviewsConsultantsParams{
     appointmentId:number,
     score:number,
-}
\ No newline at end of file
+}
diff --git a/PAMapp/pages/agentInfo/_agentNo.vue b/PAMapp/pages/agentInfo/_agentNo.vue
index 9a75eec..03478ed 100644
--- a/PAMapp/pages/agentInfo/_agentNo.vue
+++ b/PAMapp/pages/agentInfo/_agentNo.vue
@@ -218,7 +218,6 @@
 
   alertFieldInfo(field: string): void {
     this.isAlertFieldInfo = true;
-    console.log(field);
     switch(field) {
       case 'suitability':
         this.fieldInfoTitle = '���漲';
@@ -233,23 +232,23 @@
 }
 
 interface AgentInfo {
-  name: string;
-  agentNo:string;
-  role: string;
-  image: string;
-  avgScore: number;
-  title: string;
-  phoneNumber: string;
-  serveArea: string;
-  companyAddress: string;
+  name            : string;
+  agentNo         : string;
+  role            : string;
+  image           : string;
+  avgScore        : number;
+  title           : string;
+  phoneNumber     : string;
+  serveArea       : string;
+  companyAddress  : string;
   lastestLoginTime: Date | null;
-  seniority: string;
-  suitability: number;
-  evaluation: number;
-  expertises: string[];
-  concept: string;
-  experiences: string[];
-  awards: string;
+  seniority       : string;
+  suitability     : number;
+  evaluation      : number;
+  expertises      : string[];
+  concept         : string;
+  experiences     : string[];
+  awards          : string;
 }
 </script>
 
diff --git a/PAMapp/pages/questionnaire/_agentNo.vue b/PAMapp/pages/questionnaire/_agentNo.vue
index 483d395..547af0a 100644
--- a/PAMapp/pages/questionnaire/_agentNo.vue
+++ b/PAMapp/pages/questionnaire/_agentNo.vue
@@ -128,13 +128,13 @@
 </template>
 
 <script lang="ts">
-  import { Vue, Component, namespace } from 'nuxt-property-decorator';
+  import { Vue, Component } from 'nuxt-property-decorator';
   import { addFavoriteConsultant, appointmentDemand, AppointmentParams, AppointmentRequests ,RegisterInfo } from '~/assets/ts/api/consultant';
-  import { getRequestsFromStorage, setRequestsToStorage } from '~/assets/ts/storageRequests';
+  import { getRequestsFromStorage, setRequestsToStorage, getRequestQuestionFromStorage, removeRequestQuestionFromStorage  } from '~/assets/ts/storageRequests';
   import { Gender } from '~/assets/ts/models/enum/Gender';
   import { ContactType } from '~/assets/ts/models/enum/ContactType';
   import _ from 'lodash';
-import { isLogin } from '~/assets/ts/auth';
+  import { isLogin } from '~/assets/ts/auth';
 
   @Component
   export default class Questionnaire extends Vue {
@@ -171,8 +171,8 @@
         label:'靽�瑼�/閬��',
       },
       {
-        title:'��������',
-        label:'��������',
+        title:'����',
+        label:'����',
       },
     ];
 
@@ -239,15 +239,15 @@
     ];
 
     myRequest: AppointmentRequests = {
-      phone: this.userInfo?.phone ? this.userInfo.phone :'',
-      email: this.userInfo?.email ? this.userInfo.email :'',
-      contactType: _.isEqual(this.userInfo?.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL  ,
-      gender: '',
-      age: '',
-      job: '',
-      requirement: [],
+      phone          : this.userInfo?.phone ? this.userInfo.phone                               : '',
+      email          : this.userInfo?.email ? this.userInfo.email                               : '',
+      contactType    : _.isEqual(this.userInfo?.contactType,ContactType.SMS) ? ContactType.PHONE: ContactType.EMAIL,
+      gender         : '',
+      age            : '',
+      job            : '',
+      requirement    : [],
       hopeContactTime: [{
-        selectWeekOptions: [],
+        selectWeekOptions : [],
         selectTimesOptions: [],
       }],
       agentNo: '',
@@ -256,7 +256,7 @@
     showDrawer= false;
     sendReserve = false;
 
-    beforeRouteEnter (to, from, next) {
+    beforeRouteEnter(to: any, from: any, next: any) {
       next(vm => {
         if (from.name === 'login' && !isLogin()) {
           vm.$router.go(-1);
@@ -268,8 +268,15 @@
         }
       })
     }
-    mounted() {
+
+    mounted(): void {
+      this.setMyRequest();
+    }
+
+    private setMyRequest(): void {
       const storageMyRequest = getRequestsFromStorage();
+      const storageMyQuestion = getRequestQuestionFromStorage();
+
       if (storageMyRequest) {
         this.myRequest = {
           ...storageMyRequest,
@@ -281,6 +288,14 @@
                               }],
         };
       }
+
+      if (storageMyQuestion) {
+        this.myRequest = {
+          ...this.myRequest,
+          requirement: storageMyQuestion
+        }
+        removeRequestQuestionFromStorage();
+      }
     }
 
     get phoneValid(): boolean {
diff --git a/PAMapp/pages/recommendConsultant/index.vue b/PAMapp/pages/recommendConsultant/index.vue
index 9095aa3..37598dc 100644
--- a/PAMapp/pages/recommendConsultant/index.vue
+++ b/PAMapp/pages/recommendConsultant/index.vue
@@ -82,6 +82,7 @@
     </PopUpFrame>
   </div>
 </template>
+
 <script lang="ts">
   import {
     Vue,
@@ -93,6 +94,7 @@
   } from 'nuxt-property-decorator';
   import * as _ from 'lodash';
   import { Seniority } from '~/assets/ts/models/enum/seniority';
+  import { setRequestQuestionToStorage } from '~/assets/ts/storageRequests';
 
   const localStorage = namespace('localStorage');
 
@@ -238,6 +240,8 @@
     }
     async makePair() {
       await this.storeStrictQueryList(this.strictQueryDto).then(dataLength => {
+        const questions = this.strictQueryDto.requirements.length ? this.strictQueryDto.requirements : [];
+        setRequestQuestionToStorage(questions);
         if (dataLength === 0) {
           this.isVisiblePopUp = true;
           return;

--
Gitblit v1.8.0