| | |
| | | <template> |
| | | <div class="pam-background"> |
| | | <UiGoToTop></UiGoToTop> |
| | | <BackActionBar></BackActionBar> |
| | | <div class="banner" :class="bannerClassName"></div> |
| | | <Nuxt class="page-container"></Nuxt> |
| | | <Footer ref="defaultLayoutFooter"></Footer> |
| | | <div class="pam-background"> |
| | | <UiGoToTop></UiGoToTop> |
| | | <NavBar></NavBar> |
| | | <BackActionBar></BackActionBar> |
| | | <div class="pam-banner" |
| | | :class="bannerClassName"> |
| | | <div class="pam-banner__text text--dark-blue"> |
| | | <div class="mt-5" |
| | | v-for="(bannerText, index) in bannerTextList" |
| | | :key="index"> |
| | | {{ bannerText }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div |
| | | class="pam-container" |
| | | :class="[containClassName, {'mt-navBar': bannerClassName === 'pam-no-banner'} ]" |
| | | > |
| | | <Nuxt class="pam-page-container"></Nuxt> |
| | | </div> |
| | | <Footer></Footer> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component } from 'vue-property-decorator'; |
| | | import { Vue, Component } from 'vue-property-decorator'; |
| | | |
| | | @Component |
| | | export default class DefaultLayout extends Vue { |
| | | pageHieght = ''; |
| | | @Component |
| | | export default class DefaultLayout extends Vue { |
| | | |
| | | get bannerClassName() { |
| | | if (this.$route.name) { |
| | | return this.noBanner(this.$route.name) ? 'noBanner' : this.$route.name.split('-')[0] |
| | | } else { |
| | | return ''; |
| | | get route(): string{ |
| | | const routeName = this.$route.name; |
| | | return routeName ? routeName : ''; |
| | | }; |
| | | |
| | | 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 needContainBgRoutes = ['recommendConsultant', 'questionnaire-agentNo']; |
| | | return needContainBgRoutes.includes(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', 'notification']; |
| | | return needBannerRoutes.includes(route) ? route + '-banner' : 'pam-no-banner'; |
| | | }; |
| | | |
| | | private bannerText: FeatureBannerTitle= { |
| | | [FeaturePage.RECOMMEND_CONSULTANT]: ['輸入個人需求及偏好', '即可獲得量身推薦之嚴選顧問清單'], |
| | | [FeaturePage.QUICK_FILTER] : ['依個人偏好快速搜尋', '找到你的最佳顧問'], |
| | | [FeaturePage.MY_CONSULTANT_LIST] : [], |
| | | [FeaturePage.QUESTIONNAIRE] : [], |
| | | } |
| | | |
| | | } |
| | | |
| | | noBanner(routerName : string) { |
| | | return routerName.match('questionnaire') || routerName.match('agentInfo'); |
| | | enum FeaturePage { |
| | | RECOMMEND_CONSULTANT = 'recommendConsultant', |
| | | QUICK_FILTER = "quickFilter", |
| | | MY_CONSULTANT_LIST = "myConsultantList", |
| | | QUESTIONNAIRE = 'questionnaire', |
| | | } |
| | | |
| | | } |
| | | interface FeatureBannerTitle { |
| | | [x:string]: string[]; |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | <style lang="scss" |
| | | scoped> |
| | | .pam-background { |
| | | background-color: #F8F9FA; |
| | | display: flex; |
| | | flex-direction: column; |
| | | min-height: 100vh; |
| | | .page-container { |
| | | .pam-container{ |
| | | flex: 1; |
| | | } |
| | | } |
| | | |
| | | .page-container { |
| | | padding: 30px 40px; |
| | | .pam-page-container { |
| | | margin: 30px 20px; |
| | | } |
| | | |
| | | @include desktop { |
| | | .page-container{ |
| | | width: 700px; |
| | | margin: 0 auto; |
| | | overflow-x: hidden; |
| | | } |
| | | } |
| | | |
| | | .banner { |
| | | .pam-banner { |
| | | width: 100%; |
| | | height: 120px; |
| | | background-size: cover; |
| | | background-repeat: no-repeat; |
| | | background-position: center; |
| | | position: relative; |
| | | @extend .mt-navBar; |
| | | } |
| | | |
| | | .noBanner { |
| | | .mt-navBar { |
| | | margin-top: calc($MOB_NAV_BAR * 2); |
| | | } |
| | | |
| | | @include desktop { |
| | | .pam-banner { |
| | | height: 150px; |
| | | } |
| | | .mt-navBar { |
| | | margin-top: calc($DESKTOP_NAV_BAR + $MOB_NAV_BAR); |
| | | } |
| | | .pam-page-container { |
| | | width: 700px; |
| | | margin: 30px auto; |
| | | } |
| | | .pam-banner__text{ |
| | | width: 700px; |
| | | position: static !important; |
| | | margin: 30px auto 0px auto; |
| | | } |
| | | } |
| | | |
| | | .pam-banner__text { |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | position: absolute; |
| | | bottom: 15px; |
| | | left: 25px; |
| | | |
| | | div:first-child { |
| | | margin: 0px; |
| | | } |
| | | } |
| | | |
| | | .pam-no-banner { |
| | | display: none; |
| | | } |
| | | |
| | | // page |
| | | .quickFilter { |
| | | background-image: url('~/assets/images/quickFilter/banner_mob.svg'); |
| | | &-banner { |
| | | background-image: url('~/assets/images/quickFilter/banner_mob.svg'); |
| | | } |
| | | |
| | | @include desktop { |
| | | &-banner { |
| | | background-image: url('~/assets/images/quickFilter/banner_web.svg'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | .recommendConsultant { |
| | | background-image: url('~/assets/images/recommendConsultant/banner_mob.svg'); |
| | | } |
| | | |
| | | .myConsultantList { |
| | | background-image: url('~/assets/images/myConsultantList/banner_mob.svg'); |
| | | } |
| | | |
| | | @media (min-width: 768px) { |
| | | |
| | | .quickFilter { |
| | | background-image: url('~/assets/images/quickFilter/banner_web.svg'); |
| | | &-banner { |
| | | background-image: url('~/assets/images/recommendConsultant/banner_mob.svg'); |
| | | background-size: cover; |
| | | } |
| | | |
| | | .recommendConsultant { |
| | | background-image: url('~/assets/images/recommendConsultant/banner_web.svg'); |
| | | &-container { |
| | | background-image: url('~/assets/images/recommendConsultant/bg_flower_mob.svg'); |
| | | background-size: contain; |
| | | } |
| | | |
| | | .myConsultantList { |
| | | background-image: url('~/assets/images/myConsultantList/banner_web.svg'); |
| | | @include desktop { |
| | | &-banner { |
| | | background-image: url('~/assets/images/recommendConsultant/banner_web.svg'); |
| | | background-size: cover; |
| | | } |
| | | |
| | | &-container { |
| | | background-image: url('~/assets/images/recommendConsultant/bg_flower_web.svg'); |
| | | background-size: cover; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | .myConsultantList-consultantList,.myConsultantList-contactedList { |
| | | &-banner { |
| | | background-image: url('~/assets/images/myConsultantList/banner_mob.svg'); |
| | | } |
| | | |
| | | @include desktop { |
| | | &-banner { |
| | | background-image: url('~/assets/images/myConsultantList/banner_web.svg'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | .questionnaire-agentNo { |
| | | &-container { |
| | | background-image: url('~/assets/images/recommendConsultant/bg_flower_mob.svg'); |
| | | background-size: contain; |
| | | } |
| | | |
| | | @include desktop { |
| | | &-container { |
| | | background-image: url('~/assets/images/recommendConsultant/bg_flower_web.svg'); |
| | | background-size: cover; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .login { |
| | | &-banner { |
| | | background-image: url('~/assets/images/login/login_mob.svg'); |
| | | } |
| | | |
| | | @include desktop { |
| | | &-banner { |
| | | background-image: url('~/assets/images/login/login_web.svg'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | .notification { |
| | | &-banner { |
| | | background-image: url('~/assets/images/notification/banner_mob.svg'); |
| | | } |
| | | |
| | | @include desktop { |
| | | &-banner { |
| | | background-image: url('~/assets/images/notification/banner_web.svg'); |
| | | } |
| | | } |
| | | } |
| | | |