保誠-保戶業務員媒合平台
Tomas
2021-12-08 b6661a090e8bcf8f45be24a01b6a7bb08e3aaff1
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
<template>
    <div>
        <div class="pam-tags">
            <div class="pb-10" v-for="(qaItem,index) in questionList" :key="index">
                <el-button  class="tags" :class="{'active': qaItem.selected}"
                @click="selectQuestion(index)">
                {{qaItem.name}}
                </el-button>
            </div>
        </div>
 
    </div>
</template>
 
<script lang="ts">
import { Vue, Component, Emit, Prop} from 'vue-property-decorator';
 
@Component
    export default class ConsultantQues extends Vue{
 
        showDialog = false;
        other = '';
        otherQuestion = '';
 
        @Prop({ default: () => []}) selectedQuestions!: string[];
 
        get questionList(): any[] {
          return this.defaultQuestionList.map((question) => {
            const isSeleted = (quesName: string): boolean => this.selectedQuestions.some((question) => question === quesName);
            if (isSeleted(question.name)) {
                question.selected = true;
              }
            return question;
            }
          );
        }
 
        defaultQuestionList = [
          {
            name:'健康與保障',
            selected:false
          },
          {
            name:'子女教育',
            selected:false
          },
          {
            name:'資產規劃',
            selected:false
          },
          {
            name:'樂活退休',
            selected:false
          },
          {
            name:'保單健檢/規劃',
            selected:false
          },
          {
            name:'分紅保單',
            selected:false
          }
        ];
 
        @Emit('change')
        selectQuestion(questionIndex: number): any[] {
            this.questionList[questionIndex].selected = !this.questionList[questionIndex].selected;
            return this.questionList;
        }
 
    }
</script>
<style lang="scss">
.con-input{
    input:focus,textarea:focus {
    outline: none;
    border: 1px solid #ED1B2E;
  }
}
 
.other-input{
    height: 50px;
    width:316px;
    border:1px solid #CCCCCC;
    margin-top: 10px;
}
 
.tags{
    height: 47px;
}
 
.qa-dialog-footer{
    display: flex;
    justify-content: center;
    font-size: 20px;
    color: red;
}
 
.el-dialog__wrapper{
    overflow: hidden;
}
 
.qa-dialog{
    overflow:hidden;
    height: 500px;
    margin-top: 20px;
}
 
.qaTextTitle{
    font-size: 20px;
    font-family: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -15px;
 
}
.qa-title{
    font-size: 20px;
    margin-bottom: 10px;
}
.qa-content{
    font-size: 18px;
    margin-bottom: 10px;
}
 
@include desktop
{
  .pam-tags{
      display:flex;
      flex-wrap:wrap;
 
  }
  .tags{
      margin-right: 10px;
      height: 47px;
  }
}
</style>