保誠-保戶業務員媒合平台
Tomas
2021-12-23 cedd1f296cdb1b14cdb4e7d1c5c080e507c7eeb1
refactor: layouts/default.vue
修改1個檔案
82 ■■■■ 已變更過的檔案
PAMapp/layouts/default.vue 82 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/layouts/default.vue
@@ -7,15 +7,15 @@
      :class="bannerClassName">
      <div class="pam-banner__text text--dark-blue">
        <div class="mt-5"
          v-for="(item,index) in getBannerTextList"
          v-for="(bannerText, index) in bannerTextList"
          :key="index">
          {{item}}
          {{ bannerText }}
        </div>
      </div>
    </div>
    <div
      class="pam-container"
      :class="[containClassName,{'mt-navBar': bannerClassName === 'pam-no-banner'}]"
      :class="[containClassName, {'mt-navBar': bannerClassName === 'pam-no-banner'} ]"
    >
      <Nuxt class="pam-page-container"></Nuxt>
    </div>
@@ -27,53 +27,60 @@
  import { Vue, Component } from 'vue-property-decorator';
  import * as _ from 'lodash';
  @Component
  export default class DefaultLayout extends Vue {
    private bannerTextDto:BannerDto= {
      [RouterPage.RECOMMEND_CONSULTANT]: ['輸入問題回答', '依照你的需求推薦嚴選顧問'],
      [RouterPage.QUICK_FILTER]: ['點選下方選項', '尋找你的BEST Match'],
      [RouterPage.MY_CONSULTANT_LIST]:[],
      [RouterPage.QUESTIONNAIRE]:[],
    }
    get getBannerTextList(): string[] {
      return this.bannerTextDto[this.route] ? this.bannerTextDto[this.route] : [];
    };
    get route(): string{
      const routeName = this.$route.name;
      return routeName ? routeName:'';
      return routeName ? routeName : '';
    };
    get bannerClassName() {
      return this.routeFormatBannerClass(this.route);
    };
    // format to {page}-banner or pam-no-banner tag
    private routeFormatBannerClass(route: string): string {
      const needBannerTags = ['recommendConsultant', 'quickFilter', 'myConsultantList-consultantList', 'myConsultantList-contactedList', 'myAppointmentList-appointmentList', 'myAppointmentList-contactedList', 'login'];
      return _.includes(needBannerTags, route) ? route + '-banner' : 'pam-no-banner';
    get bannerTextList(): string[] {
      return this.bannerText[this.route];
    };
    get containClassName(): string {
      return this.routeFormatContainClass(this.route);
    };
    get bannerClassName() {
      return this.routeFormatBannerClass(this.route);
    };
    //////////////////////////////////////////////////////////////////////
    // format to {page}-container tag
    private routeFormatContainClass(route: string): string {
      const needContainBgTags = ['recommendConsultant', 'questionnaire-agentNo'];
      return _.includes(needContainBgTags, route) ? route + '-container' : '';
      const needContainBgRoutes = ['recommendConsultant', 'questionnaire-agentNo'];
      return _.includes(needContainBgRoutes, route) ? route + '-container' : '';
    };
    // format to {page}-banner or pam-no-banner tag
    private routeFormatBannerClass(route: string): string {
      const needBannerRoutes = ['recommendConsultant', 'quickFilter', 'myConsultantList-consultantList', 'myConsultantList-contactedList', 'myAppointmentList-appointmentList', 'myAppointmentList-contactedList', 'login'];
      return _.includes(needBannerRoutes, route) ? route + '-banner' : 'pam-no-banner';
    };
    private bannerText: FeatureBannerTitle= {
      [FeaturePage.RECOMMEND_CONSULTANT]: ['輸入問題回答', '依照你的需求推薦嚴選顧問'],
      [FeaturePage.QUICK_FILTER]        : ['點選下方選項', '尋找你的BEST Match'],
      [FeaturePage.MY_CONSULTANT_LIST]  : [],
      [FeaturePage.QUESTIONNAIRE]       : [],
    }
  }
  enum RouterPage {
  enum FeaturePage {
    RECOMMEND_CONSULTANT = 'recommendConsultant',
    QUICK_FILTER = "quickFilter",
    MY_CONSULTANT_LIST = "myConsultantList",
    QUESTIONNAIRE = 'questionnaire',
    QUICK_FILTER         = "quickFilter",
    MY_CONSULTANT_LIST   = "myConsultantList",
    QUESTIONNAIRE        = 'questionnaire',
  }
  type BannerDto={
    [x:string]:string[];
  interface FeatureBannerTitle {
    [x:string]: string[];
  };
</script>
<style lang="scss"
@@ -121,8 +128,6 @@
    }
  }
  .pam-banner__text {
    font-size: 18px;
    font-weight: bold;
@@ -144,8 +149,8 @@
      background-image: url('~/assets/images/quickFilter/banner_mob.svg');
    }
    @media (min-width: 768px) {
      &-banner {
    @include desktop {
        &-banner {
        background-image: url('~/assets/images/quickFilter/banner_web.svg');
      }
    }
@@ -162,7 +167,7 @@
      background-size: contain;
    }
    @media (min-width: 768px) {
    @include desktop {
      &-banner {
        background-image: url('~/assets/images/recommendConsultant/banner_web.svg');
        background-size: cover;
@@ -173,6 +178,7 @@
        background-size: cover;
      }
    }
  }
  .myConsultantList-consultantList,.myConsultantList-contactedList {
@@ -180,7 +186,7 @@
      background-image: url('~/assets/images/myConsultantList/banner_mob.svg');
    }
    @media (min-width: 768px) {
    @include desktop {
      &-banner {
        background-image: url('~/assets/images/myConsultantList/banner_web.svg');
      }
@@ -193,7 +199,7 @@
      background-size: contain;
    }
    @media (min-width: 768px) {
    @include desktop {
      &-container {
        background-image: url('~/assets/images/recommendConsultant/bg_flower_web.svg');
        background-size: cover;
@@ -206,7 +212,7 @@
      background-image: url('~/assets/images/login/login_mob.svg');
    }
    @media (min-width: 768px) {
    @include desktop {
      &-banner {
        background-image: url('~/assets/images/login/login_web.svg');
      }