From 9209e46a91f6a255ddfb1dc1db3a02dd2b349663 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期五, 26 十一月 2021 16:43:10 +0800
Subject: [PATCH] fixed: npm run generate fail

---
 PAMapp/pages/questionnaire/_agentNo.vue |   92 ++++++++++++++++++++++++----------------------
 1 files changed, 48 insertions(+), 44 deletions(-)

diff --git a/PAMapp/pages/questionnaire/_agentNo.vue b/PAMapp/pages/questionnaire/_agentNo.vue
index d746e44..0b8ee76 100644
--- a/PAMapp/pages/questionnaire/_agentNo.vue
+++ b/PAMapp/pages/questionnaire/_agentNo.vue
@@ -2,7 +2,9 @@
   <div class="ques-page--reset">
     <div class="ques-header">
         <div class="ques-header__mob-banner"></div>
-        <div class="ques-header__info" v-if="myRequest.contactType==='phone'">
+        <div
+          class="ques-header__info"
+          v-if="myRequest.contactType==='phone'">
           <div class="text--middle">
               <div class="mdTxt">雿���蝜急撘�</div>
               <div class="mt-10">
@@ -21,7 +23,7 @@
               <div class="mdTxt">�隞��蝜急撘�</div>
               <div class="ques-header__input-block">
                   <span>Email嚗�</span>
-                  <input class="ques-header__input" 
+                  <input class="ques-header__input"
                     placeholder="隢撓�"
                     v-model="myRequest.email">
               </div>
@@ -49,7 +51,7 @@
                 <span v-show="!phoneValid">����Ⅳ�撘�炊</span>
               </div>
           </div>
-          <div class="mt-30" v-if="checkPhoneLength&&phoneValid">
+          <div class="mt-30" v-if="phoneValid">
               <div class="datepicker">
                   <span class="mdTxt">�����蝯∠�靘踵���</span>
                   <PhoneContactTimePicker
@@ -88,7 +90,7 @@
       </div>
       <div class="pam-paragraph ques-footer">
         <el-button type="primary"
-          :disabled="isRequiredByInit || !phoneValid"
+          :disabled="isDisabledSubmitBtn"
           @click.native="sentDemand">
           �
         </el-button>
@@ -132,6 +134,7 @@
   import { Gender } from '~/assets/ts/models/enum/Gender';
   import { ContactType } from '~/assets/ts/models/enum/ContactType';
   import _ from 'lodash';
+
   @Component
   export default class Questionnaire extends Vue {
     genderOptions=[
@@ -144,6 +147,7 @@
         label:Gender.FEMALE,
       }
     ];
+
     requirementOptions=[
       {
         title:'�摨瑁����',
@@ -170,6 +174,7 @@
         label:'��������',
       },
     ];
+
     ageRangeOptions=[
       {
         title:'20甇脖誑銝�',
@@ -204,6 +209,7 @@
         label:'over_71',
       }
     ];
+
     quesAboutList = [
       {
         title:'�摨瑁����',
@@ -230,19 +236,20 @@
         content:'���漲��������翰�祟�敺����雿�憿批����脰�������蝯行�����潘��隞乩������“������潦��'
       }
     ];
-    myRequest= {
-      phone:this.userInfo?.phone ? this.userInfo.phone :'',
-      email:this.userInfo?.email ? this.userInfo.email :'',
-      contactType:_.includes(this.userInfo.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL  ,
+
+    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: [],
       hopeContactTime: [{
-        selectWeekOptions:[],
-        selectTimesOptions:[],
+        selectWeekOptions: [],
+        selectTimesOptions: [],
       }],
-      agentNo:this.$route.params.agentNo,
+      agentNo: this.$route.params.agentNo,
     };
 
     showDrawer= false;
@@ -254,42 +261,36 @@
         this.myRequest = storageMyRequest;
       }
     }
-    get phoneValid():boolean{
+
+    get phoneValid(): boolean {
       const rule = /^09[0-9]{8}$/;
-      return this.myRequest.phone ? rule.test(this.myRequest.phone) : true;
+      return this.myRequest.phone ? rule.test(this.myRequest.phone) && _.isEqual(this.myRequest.phone.length,10) : true;
     }
-    get userInfo():RegisterInfo{
-      const initUserInfo = JSON.parse(localStorage.getItem('userInfo'));
+
+    get userInfo(): RegisterInfo {
+      const initUserInfo = JSON.parse(localStorage.getItem('userInfo')!);
       return initUserInfo;
     }
 
-    get isMainContractPhoneByLocalStorage():boolean{
-      return true;
+    get isDisabledSubmitBtn(): boolean {
+           return _.includes(this.myRequest.contactType,ContactType.PHONE)
+      ? !this.isHopeContactTimeDone()
+      : !this.phoneValid;
     }
 
-    get isRequiredByInit():boolean{
-     return _.includes(this.myRequest.contactType,ContactType.PHONE) 
-      ? !this.isHopeContactTimeDone()
-      :false;
-    }
-    get checkPhoneLength():boolean{
-      return _.isEqual(this.myRequest.phone.length,10);
-    }
     private isHopeContactTimeDone():boolean{
       return this.myRequest.hopeContactTime[0].selectWeekOptions.length >0 && this.myRequest.hopeContactTime[0].selectTimesOptions.length >0;
     }
-  
 
     sentDemand() {
       addFavoriteConsultant([this.myRequest.agentNo]).then(res => this.sentAppointmentDemand());
     }
 
     private sentAppointmentDemand() {
-      
         const data: AppointmentParams = {
           ...this.myRequest,
           requirement: _.map(this.myRequest.requirement,o=>o).toString(),
-          hopeContactTime:this.phoneValid&&this.checkPhoneLength ? this.getHopeContactTime() :'',
+          hopeContactTime:this.phoneValid ? this.getHopeContactTime() :'',
         };
 
         appointmentDemand(data).then(res => {
@@ -310,11 +311,6 @@
     }
 
   }
-
-  export interface SelectedQuestion {
-      name: string;
-      selected: boolean;
-  }
 </script>
 
 <style lang="scss" scoped>
@@ -325,14 +321,16 @@
     margin-bottom: 26px;
 }
 
+//drawer��摨���見撘�
 .qa-dialog-footer{
     display: flex;
     justify-content: center;
     margin-bottom: 81px;
     color: #ED1B2E;
     cursor: pointer;
-}//drawer��摨���見撘�
+}
 
+//����見撘����
 .ques-footer{
     justify-content: center;
     margin: 30px 0;
@@ -362,20 +360,22 @@
     border-style: solid;
     pointer-events: none;
     }
-    }
-}//����見撘����
+  }
+}
 
+//閰喟敦���rawer銝剝�摰寧征��之撠身蝵�
 .qa-dialog{
     overflow-y:auto;
     height: 500px;
     margin-top: 20px;
-}//閰喟敦���rawer銝剝�摰寧征��之撠身蝵�
+}
 
+//閰喟敦���rawer銝餉����
 .qaTextTitle{
     margin-top:30px;
     display: flex;
     justify-content: center;
-}//閰喟敦���rawer銝餉����
+}
 
 .el-button+.el-button{
     margin-left: 0;
@@ -396,13 +396,15 @@
     }
 }
 
-.ques-page--reset.pam-page-container{
+.ques-page--reset.pam-page-container {
     margin: 0px auto;
 }
-.ques-header{
+
+.ques-header {
     position: relative;
 }
-.ques-header__mob-banner{
+
+.ques-header__mob-banner {
   width: 100%;
   min-height: 80px;
   background-color: #F8F9FA;
@@ -411,14 +413,16 @@
   background-size: cover;
   background-position: center;
 }
-.ques-header__info{
+
+.ques-header__info {
   position: relative;
   padding:30px 20px;
   margin: 0px 20px;
   background-color: #B3E7E3;
   border-radius: 10px;
 }
-.ques-header__input-block{
+
+.ques-header__input-block {
   display: flex;
   align-items: center;
   @extend .text--middle,.mt-10 ;
@@ -438,7 +442,7 @@
   }
 }
 
-.ques-container{
+.ques-container {
   position: relative;
   margin: 0px 20px;
 }

--
Gitblit v1.8.0