my_que.html
4.1 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<script src="../../assets/js/fontsize.js"></script>
<link rel="stylesheet" href="../../assets/css/api.css"/>
<link rel="stylesheet" href="../../assets/css/my_f.css"/>
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<title></title>
<style>
.que_box {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 15px;
color: #D8B25F;
padding-bottom: 0.35rem;
}
.que_body {
border-bottom: 1px solid #E4E4E4;
padding: 0.32rem;
height: 0.88rem;
overflow: hidden;
}
.que_box .icon-wenhao1 {
color: #D8B25F;
margin-right: 0.16rem;
}
.que_box .icon-xiangyou {
font-size: 15px;
color: #d1d1d1;
}
.que_content {
display: flex;
font-size: 14px;
color: #333333;
}
.que_content .icon-xiaoxiwei {
color: #7A96E1;
font-size: 14px;
margin-right: 0.16rem;
}
.tans {
transform: rotate(0deg);
transition: 0.2s;
}
.tanss {
transition: 0.2s;
transform: rotate(90deg);
}
.que_show {
height: auto;
}
</style>
</head>
<body>
<div id="app">
<div :class="['que_body',item.ind==index?'':'que_show']" v-for="(item,index) in getQA_data">
<div class="que_box" @click="transform_fn(index)">
<div class="describle"><span class="iconfont icon-wenhao1"></span><span>{{item.question}}</span></div>
<div :class="['iconfont','icon-xiangyou',item.ind==index?'tans':'tanss']"></div>
</div>
<div class="que_content">
<span class="iconfont icon-xiaoxiwei"></span>
<p>{{item.answer}}</p>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
getQA_data: [],
ind: -1
},
created: function () {
this.getQA()
},
methods: {
getQA: function () {
var app = this;
var post = {};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/getQA', post, header).then(function (res) {
if (res.data.code == 1) {
for(var i in res.data.data){
res.data.data[i].ind = i
}
app.getQA_data = res.data.data;
}
})
},
transform_fn: function (index) {
var app = this;
// if (app.ind == index) {
// app.ind = -1
// } else {
// app.ind = index
// }
if (app.getQA_data[index].ind == index) {
app.getQA_data[index].ind = -1
} else {
app.getQA_data[index].ind = index
}
}
}
})
</script>