保誠-保戶業務員媒合平台
Tomas
2021-11-26 9209e46a91f6a255ddfb1dc1db3a02dd2b349663
fixed: npm run generate fail
修改3個檔案
83 ■■■■ 已變更過的檔案
PAMapp/assets/ts/api/consultant.ts 21 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/careerSelect.vue 2 ●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/questionnaire/_agentNo.vue 60 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/assets/ts/api/consultant.ts
@@ -133,20 +133,23 @@
    gender:string,
    age:string,
    job:string,
    requirement:string,
    hopeContactTime:string[],
    otherRequirement:string,
    requirement    : string[],
    hopeContactTime: ContactTime[],
    agentNo:string,
}
export interface ContactTime {
  selectWeekOptions : string[],
  selectTimesOptions: string[]
}
export interface AppointmentParams {
    phone?: string,
    email?: string,
    phone          : string,
    email          : string,
    contactType: string,
    gender?: string,
    age?: string,
    job?: string,
    gender         : string,
    age            : string,
    job            : string,
    requirement: string,
    hopeContactTime?: string,
    hopeContactTime: string,
    agentNo: string
}
export interface StrictQueryParams{
PAMapp/components/careerSelect.vue
@@ -43,7 +43,7 @@
  import * as _ from 'lodash';
  @Component
  export default class CareerSelect extends Vue {
    @PropSync('careerSelect',{ type: String, default :''}) syncCareerSelect :string;
    @PropSync('careerSelect',{ type: String, default :''}) syncCareerSelect! :string;
    showJobDrawer = false;
    career='';
    career_Other='';
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">
@@ -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,10 +236,11 @@
        content:'匹配度是透過嚴選配對或快速篩選後,將每一位保險顧問資料進行比對後排序推薦給您的媒合數值,您可以作為選擇適合顧問的參考值。'
      }
    ];
    myRequest= {
    myRequest: AppointmentRequests = {
      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  ,
      contactType: _.isEqual(this.userInfo.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL  ,
      gender: '',
      age: '',
      job: '',
@@ -254,42 +261,36 @@
        this.myRequest = storageMyRequest;
      }
    }
    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'));
      const initUserInfo = JSON.parse(localStorage.getItem('userInfo')!);
      return initUserInfo;
    }
    get isMainContractPhoneByLocalStorage():boolean{
      return true;
    }
    get isRequiredByInit():boolean{
    get isDisabledSubmitBtn(): boolean {
     return _.includes(this.myRequest.contactType,ContactType.PHONE) 
      ? !this.isHopeContactTimeDone()
      :false;
      : !this.phoneValid;
    }
    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;
@@ -363,19 +361,21 @@
    pointer-events: none;
    }
    }
}//送出按鈕樣式與排版
}
//詳細問題drawer中間內容空間大小設置
.qa-dialog{
    overflow-y:auto;
    height: 500px;
    margin-top: 20px;
}//詳細問題drawer中間內容空間大小設置
}
//詳細問題drawer主要標題
.qaTextTitle{
    margin-top:30px;
    display: flex;
    justify-content: center;
}//詳細問題drawer主要標題
}
.el-button+.el-button{
    margin-left: 0;
@@ -399,9 +399,11 @@
.ques-page--reset.pam-page-container{
    margin: 0px auto;
}
.ques-header{
    position: relative;
}
.ques-header__mob-banner{
  width: 100%;
  min-height: 80px;
@@ -411,6 +413,7 @@
  background-size: cover;
  background-position: center;
}
.ques-header__info{
  position: relative;
  padding:30px 20px;
@@ -418,6 +421,7 @@
  background-color: #B3E7E3;
  border-radius: 10px;
}
.ques-header__input-block{
  display: flex;
  align-items: center;