保誠-保戶業務員媒合平台
wayne
2021-11-19 e05f762bc8bd7e93db954a748bf15dd2dcb4b0d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<template>
  <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,{'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 * 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:'';
    };
 
    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;
    @extend .mt-navBar;
  }
 
  .mt-navBar {
    margin-top: $MOB_NAV_BAR;
  }
 
 
  .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>