保誠-保戶業務員媒合平台
Tomas
2021-11-30 5ca8f6e6e554696cb8add0fc91396b2d905b0d7a
add: age.filter
修改3個檔案
新增1個檔案
30 ■■■■ 已變更過的檔案
PAMapp/components/Client/ClientCard.vue 2 ●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Consultant/ConsultantCard.vue 2 ●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/nuxt.config.js 5 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/plugins/filters/age.filter.ts 21 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Client/ClientCard.vue
@@ -52,7 +52,7 @@
                <p>電話:{{client.phone}}</p>
                <p>Email:{{client.email}}</p>
                <p>性別:{{gender}}</p>
                <p>年齡:{{client.age}}</p>
                <p>年齡:{{client.age | toAgeLabel }}</p>
                <p>職業:{{client.job}}</p>
                <p>需求:{{client.requirement.split(',').join('、')}}</p>
                <p v-for="(item, index) in hopeContactTime" :key="index">連絡時段{{index + 1 | formatNumber}}:{{ item | formatHopeContactTime}}</p>
PAMapp/components/Consultant/ConsultantCard.vue
@@ -56,7 +56,7 @@
                    <p>電話:{{appointmentDetail.phone}}</p>
                    <p>Email:{{appointmentDetail.email}}</p>
                    <p>性別:{{gender}}</p>
                    <p>年齡:{{appointmentDetail.age}}</p>
                    <p>年齡:{{appointmentDetail.age | toAgeLabel }}</p>
                    <p>職業:{{appointmentDetail.job}}</p>
                    <p>需求:{{appointmentDetail.requirement.split(',').join('、')}}</p>
                    <p
PAMapp/nuxt.config.js
@@ -37,12 +37,13 @@
    { src: '~/plugins/vue-awesome-swiper.js', mode: 'client' },
    '~/plugins/service.ts',
    '~/plugins/vue-scroll-picker',
    '~/plugins/filters/date.filter.ts'
    '~/plugins/filters/date.filter.ts',
    '~/plugins/filters/age.filter.ts',
  ],
  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,
  // loading
  // loading
  loading: '~/components/loading.vue',
  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
PAMapp/plugins/filters/age.filter.ts
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,21 @@
import Vue from 'vue'
Vue.filter('toAgeLabel', (value: string): string => {
  if (!value ||  typeof value !== 'string') {
    return '--';
  };
  const ageLabel = {
    'under_20': '20歲以下',
    '21-30': '21-30 æ­²',
    '31-40': '31-40 æ­²',
    '41-50': '41-50 æ­²',
    '46-55': '46-55 æ­²',
    '51-60': '51-60 æ­²',
    '61-70': '61-70 æ­²',
    'over_71': '71 æ­²ä»¥ä¸Š'
  };
  return  ageLabel[value];
})