mulschoolexample.vue
5.8 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
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<template>
<div class="mul_ex_wrap">
<!-- 多元测评例题 -->
<div class="mul_ex_box clearfix">
<!-- 上部 分类 -->
<div class="mul_ex_classify clearfix">
<div
v-for="item in list"
:key="item.id"
class="mul_ex_subject layout align_center justify"
:class="{color_blue:isBlue == item.id,bg_color:item.complete}"
>
<div class="mul_sub_pic">
<img :src="item.complete?src2:isBlue == item.id?src1:src" alt />
</div>
<div class="mul_sub_name">{{item.name}}</div>
</div>
</div>
<!-- 下部 各种学科例题-->
<router-view></router-view>
</div>
</div>
</template>
<script>
import { post } from "../../../api/http";
export default {
data() {
return {
list: [],
isBlue: 1,
src: require("@/assets/img/wait.png"),
src1: require("@/assets/img/progress.png"),
src2: require("@/assets/img/complete.png")
};
},
methods: {
// 多元性向测评题目类型
getTestPluralisticType() {
let url = "/api/primary_pluralistic/getTestPluralisticType/";
let params = {
id: localStorage.getItem("evaluteId")
};
post(url, params).then(res => {
console.log('测评例题',res)
this.list = res;
for (let obj of res) {
if (obj.is_answer == 1) {
this.$set(obj, "complete", true);
}
}
let routerArr = [];
for (let obj of this.list) {
switch (obj.id) {
case 1:
localStorage.setItem("chineseStatus", obj.is_answer);
break;
case 2:
localStorage.setItem("wenfaStatus", obj.is_answer);
break;
case 3:
localStorage.setItem("chouxiangStatus", obj.is_answer);
break;
case 4:
localStorage.setItem("shuziStatus", obj.is_answer);
break;
case 5:
localStorage.setItem("tuwenStatus", obj.is_answer);
break;
case 6:
localStorage.setItem("studystyleStatus", obj.is_answer);
break;
}
console.log('3477377',obj)
if (obj.is_answer != 1) {
routerArr.push(obj.id);
}
}
switch (routerArr[0]) {
case 1:
this.$router.replace({ path: "/ChineseExample" });
// 题目类型
localStorage.setItem("typeId", 1);
// 答题状态
this.isBlue = 1;
break;
case 2:
this.$router.replace({ path: "/WenfaApplyexample" });
// 题目类型
localStorage.setItem("typeId", 2);
// 答题状态
this.isBlue = 2;
break;
case 3:
this.$router.replace({ path: "/LogicExample" });
// 题目类型
localStorage.setItem("typeId", 3);
// 答题状态
this.isBlue = 3;
break;
case 4:
this.$router.replace({ path: "/SpeedExample" });
// 题目类型
localStorage.setItem("typeId", 4);
// 答题状态
this.isBlue = 4;
break;
case 5:
this.$router.replace({ path: "/MomentExample" });
// 题目类型
localStorage.setItem("typeId", 5);
// 答题状态
this.isBlue = 5;
break;
case 6:
this.$router.replace({ path: "/SpaceExample" });
// 题目类型
localStorage.setItem("typeId", 6);
// 答题状态
this.isBlue = 6;
break;
case 7:
this.$router.replace({ path: "/WordExample" });
// 题目类型
localStorage.setItem("typeId", 7);
// 答题状态
this.isBlue = 7;
break;
case 8:
this.$router.replace({ path: "/GrammerExample" });
// 题目类型
localStorage.setItem("typeId", 8);
// 答题状态
this.isBlue = 8;
break;
case 9:
this.$router.replace({ path: "/EnglishExample" });
// 题目类型
localStorage.setItem("typeId", 9);
// 答题状态
this.isBlue = 9;
break;
case 10:
this.$router.replace({ path: "/StyleExample" });
// 题目类型
localStorage.setItem("typeId", 10);
// 答题状态
this.isBlue = 10;
break;
}
}).catch(err => {
console.log(err,347843787)
});;
}
},
mounted() {
},
created(){
console.log(3434439)
this.getTestPluralisticType();
// if (!localStorage.getItem("typeId")) {
// localStorage.setItem("typeId", 1);
// }
}
};
</script>
<style scoped>
.mul_ex_wrap {
width: 100%;
background-color: #f2f5fa;
padding: 22px 0 27px;
}
.mul_ex_box {
width: 1200px;
margin: 0 auto;
}
/* 上部分类 */
.mul_ex_classify {
height: 177px;
width: 1200px;
background-color: #fff;
margin-bottom: 21px;
}
.mul_ex_all {
width: 1116px;
height: 177px;
margin: 0 auto;
}
/* 学科名称 */
.mul_ex_subject {
width: 181px;
height: 48px;
background: rgba(243, 243, 243, 1);
font-size: 18px;
color: #8c9198;
float: left;
margin-left: 47px;
margin-top: 26px;
border-radius: 3px;
border: 1px solid rgba(243, 243, 243, 1);
}
.color_blue {
color: #409eff;
border-color: #409eff;
background-color: #fff;
}
.bg_color {
background-color: #409eff;
color: #fff;
}
/* 图标 */
.mul_sub_pic {
margin-left: 21px;
}
/* 名字 */
.mul_sub_name {
margin-right: 11px;
width: 108px;
}
/* 下部 各种学科例题 */
</style>