From bf6ad8eecf59e08504178d97625b5ddd080f1d08 Mon Sep 17 00:00:00 2001 From: Mila <Mila@pollex.com.tw> Date: 星期三, 17 十一月 2021 09:56:21 +0800 Subject: [PATCH] update 預約清單更改 layout --- PAMapp/layouts/default.vue | 193 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 185 insertions(+), 8 deletions(-) diff --git a/PAMapp/layouts/default.vue b/PAMapp/layouts/default.vue index 465734a..1c15771 100644 --- a/PAMapp/layouts/default.vue +++ b/PAMapp/layouts/default.vue @@ -1,13 +1,190 @@ <template> - <div> - <BackActionBar></BackActionBar> - <Nuxt class="container"></Nuxt> + <div class="pam-background"> + <UiGoToTop></UiGoToTop> + <BackActionBar></BackActionBar> + <div class="pam-banner" + :class="bannerClassName"> + <div class="pam-banner__text text--dark-blue"> + <div class="mt-5" + v-for="(item,index) in getBannerTextList" + :key="index"> + {{item}} + </div> + </div> </div> + <div class="pam-container" :class="containClassName"> + <Nuxt class="pam-page-container"></Nuxt> + </div> + <Footer></Footer> + </div> </template> -<style lang="scss" scoped> - .container { - background-color: #F8F9FA; - padding: 0 20px; +<script lang="ts"> + 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]: ['暺銝����', '撠雿�EST Match'], + [RouterPage.MY_CONSULTANT_LIST]:[], + [RouterPage.QUESTIONNAIRE]:[], } -</style> \ No newline at end of file + get getBannerTextList(): string[] { + return this.bannerTextDto[this.route] ? this.bannerTextDto[this.route] : []; + }; + + get route(): string{ + const routeName = this.$route.name; + 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']; + return _.includes(needBannerTags, route) ? route + '-banner' : 'pam-no-banner'; + }; + + get containClassName(): string { + return this.routeFormatContainClass(this.route); + }; + + // format to {page}-container tag + private routeFormatContainClass(route: string): string { + const needContainBgTags = ['recommendConsultant', 'questionnaire-agentNo']; + return _.includes(needContainBgTags, route) ? route + '-container' : ''; + }; + } + enum RouterPage { + RECOMMEND_CONSULTANT = 'recommendConsultant', + QUICK_FILTER = "quickFilter", + MY_CONSULTANT_LIST = "myConsultantList", + QUESTIONNAIRE = 'questionnaire', + } + type BannerDto={ + [x:string]:string[]; + }; +</script> + +<style lang="scss" + scoped> + .pam-background { + background-color: #F8F9FA; + display: flex; + flex-direction: column; + min-height: 100vh; + .pam-container{ + flex: 1; + } + } + + .pam-page-container { + margin: 30px 20px; + } + + @include desktop { + .pam-page-container { + width: 700px; + margin: 30px auto 0px auto; + } + .pam-banner__text{ + width: 700px; + position: static !important; + margin: 30px auto 0px auto; + } + } + + .pam-banner { + width: 100%; + height: 120px; + background-size: cover; + background-repeat: no-repeat; + background-position: center; + position: relative; + } + + .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 { + &-banner { + background-image: url('~/assets/images/quickFilter/banner_mob.svg'); + } + + @media (min-width: 768px) { + &-banner { + background-image: url('~/assets/images/quickFilter/banner_web.svg'); + } + } + } + + .recommendConsultant { + &-banner { + background-image: url('~/assets/images/recommendConsultant/banner_mob.svg'); + background-size: cover; + } + + &-container { + background-image: url('~/assets/images/recommendConsultant/bg_flower_mob.svg'); + background-size: contain; + } + + @media (min-width: 768px) { + &-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'); + } + + @media (min-width: 768px) { + &-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; + } + + @media (min-width: 768px) { + &-container { + background-image: url('~/assets/images/recommendConsultant/bg_flower_web.svg'); + background-size: cover; + } + } + } + +</style> -- Gitblit v1.8.0