FAQItem.vue
2.2 KB
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
<template>
<div :class="['share-item', { hideBorder }, { indexType }]">
<div class="faq-item">
<div class="q flex">
<template v-if="indexType">
<div class="icon text-center">问</div>
</template>
<template v-else>
<div class="sprite-icon icon-faq-left"></div>
</template>
<div :class="['value', { 'text-hide': indexType }]">{{ item.question }}</div>
</div>
<div class="a flex">
<template v-if="indexType">
<div class="icon text-center">答</div>
</template>
<template v-else>
<div class="sprite-icon icon-faq-right"></div>
</template>
<div :class="['value', { 'text-hide': indexType }]">{{ item.answer }}</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'FAQItem',
props: {
hideBorder: Boolean,
indexType: Boolean,
item: {
type: Object,
default: () => { }
}
},
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/sharegoods.scss';
.faq-item {
padding-top: 16px;
.flex {
margin-bottom: 12px;
align-items: flex-start;
.sprite-icon {
margin-right: 8px;
flex-shrink: 0;
}
}
.icon {
color: #ffffff;
font-size: 12px;
width: 14px;
height: 14px;
background: linear-gradient(108deg, #ffbe68 0%, #ff5446 60%, #f45454 100%);
border-radius: 2px;
flex-shrink: 0;
margin-right: 4px;
}
.q {
.value {
font-weight: 500;
font-size: 16px;
color: #2c2c2c;
}
}
.a {
.value {
font-size: 14px;
color: #282829;
}
.icon {
background: linear-gradient(108deg, #4f7bf6 0%, #3d6ced 60%, #3162e6 100%);
}
}
.value {
line-height: 20px;
line-break: anywhere;
word-break: break-all;
}
}
.indexType {
.faq-item {
padding-top: 0;
}
.flex {
margin-bottom: 0;
align-items: center;
}
.q {
margin-bottom: 6px;
&:last-of-type {
margin-bottom: 0;
}
.value {
color: #2c2c2c;
}
}
.value {
font-weight: 400;
font-size: 12px !important;
}
}
</style>