mykaoshi.vue
3.3 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
<template>
<div class="container">
<div class="mykaoshitop flexone" v-if="show">
<div class="tieziimg">
<img :src="userinfo.avatar" alt="" />
</div>
<div class="tieziright">
<div class="tiezirighttop flex">
<div>
<div class="tieziming">{{ userinfo.nickname }}</div>
</div>
<div>
<div class="vipimg" style="margin-left:0.4rem">
<img src="../../../assets/vip_icon@2x.png" alt="" />
<div class="vipname" >{{ userinfo.level.name1 }}</div>
</div>
</div>
<img
:src="item.logo_image"
class="banggongimg"
alt=""
v-for="(item, index) in userinfo.label"
:key="index"
/>
<img
src="../../../assets/yirenzheng_icon@2x.png"
class="banggongimg"
alt=""
v-if="userinfo.is_card == 1"
/>
</div>
<div class="tiezibto flexone"></div>
</div>
</div>
<div class="kaoshilist flextwo">
<div
class="homepageboxitem flexfour"
v-for="(item, index) in questionlist"
:key="index"
@click="examinetext(item)"
>
<img :src="item.imageexaminetext" alt="" class="homepageitemimg" />
<div class="homepageitemname">{{ item.name }}</div>
</div>
</div>
<div class="kaoshirule">
<div class="kaoshiruletitle">考试规则</div>
<div class="kaoshiruletext" v-html="rulecontent">
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
rulecontent: '',//考试规则
userinfo: '',
show: false,
questionlist: []
}
},
created() {
document.body.style.backgroundColor = "#fff";
this.getuserinfo()
this.getrulecontent();
this.getquestionlist()
},
methods: {
// 获取用户信息
getuserinfo() {
let that = this;
var url = '/api/member/index';
var params = {
}
console.log('7766554', params)
that.$axios.post(url, params).then((res) => {
console.log('用户信息', res);
that.userinfo = res.data;
setTimeout(function () {
that.show = true
}, 200)
}).catch((err) => {
console.log(err)
})
},
// 获取问卷列表
getquestionlist() {
let that = this;
var url = '/api/question/get_questionnaire';
var params = {
}
console.log('7766554', params)
that.$axios.post(url, params).then((res) => {
console.log(res);
that.questionlist = res.data
}).catch((err) => {
})
},
// 考试规则
getrulecontent() {
let that = this;
var url = '/api/sundry/get_page';
var params = {
id: 5
}
console.log('7766554', params)
that.$axios.post(url, params).then((res) => {
console.log(res);
that.rulecontent = res.data.content == null ? '' : res.data.content
}).catch((err) => {
console.log(err)
})
},
//帮工考试
examinetext(item) {
this.$router.push({
path: '/kaoshenginfo',
query: { id: item.id }
})
},
}
};
</script>
<style scoped>
@import "../../style/homepage.css";
</style>