usercenter.vue
4.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
<template>
<div class="container">
<div class="usertop">
<div class="usertophead flextwo" @click="changeziliao">
<div class="usertopheadleft flexone">
<div class="userimg">
<img :src="avatar" alt />
</div>
<div class="username">{{username==''?'暂无昵称':username}}</div>
</div>
<img src="../../../assets/grayrow.png" alt class="yourow" />
</div>
<div class="userlsit flexsix">
<div class="userlistitem flexseven" @click="join(1)">
<img src="../../../assets/fatiezi.png" alt class="userlistimg" />
<div class="iserlistname">发帖子</div>
</div>
<div class="userlistitem flexseven" @click="join(2)">
<img src="../../../assets/joinus.png" alt class="userlistimg" />
<div class="iserlistname">加入我们</div>
</div>
<div class="userlistitem flexseven" @click="join(3)">
<img src="../../../assets/kefu.png" alt class="userlistimg" />
<div class="iserlistname">客服中心</div>
</div>
<div class="userlistitem flexseven" @click="join(4)">
<img src="../../../assets/jiangquan.png" alt class="userlistimg" />
<div class="iserlistname">获得奖券</div>
</div>
<div class="userlistitem flexseven" @click="join(5)">
<img src="../../../assets/collect.png" alt class="userlistimg" />
<div class="iserlistname">我的收藏</div>
</div>
</div>
</div>
<div class="kaikeitem flextwo" @click="jump(1)">
<div class="kaikeitemleft flexone">
<div class="courseimg">
<img src="../../../assets/kaike.png" alt />
</div>
<span class="kaiketext">去开课</span>
</div>
<img src="../../../assets/grayrow.png" alt class="yourow" />
</div>
<div class="kaikeitem flextwo" @click="jump(2)">
<div class="kaikeitemleft flexone">
<div class="courseimg">
<img src="../../../assets/zuozhan.png" alt />
</div>
<span class="kaiketext">作战包</span>
</div>
<img src="../../../assets/grayrow.png" alt class="yourow" />
</div>
<div class="kaikeitem flextwo" @click="jump(3)">
<div class="kaikeitemleft flexone">
<div class="courseimg">
<img src="../../../assets/sucai.png" alt />
</div>
<span class="kaiketext">素材</span>
</div>
<img src="../../../assets/grayrow.png" alt class="yourow" />
</div>
<tabBar v-bind:active="3" />
</div>
</template>
<script>
import tabBar from "@/components/views/tabBar.vue";
export default {
components: {
tabBar
},
data() {
return {
selnav: 3,
username:'',
avatar:''
};
},
created(){
this.getuserinfo()
},
methods: {
getuserinfo(){
let that = this;
var url = "/api/user/index";
let param = {
};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res);
that.username=res.data.nickname,
that.avatar=res.data.avatar
})
.catch(function (error) {
console.log(error);
});
},
selcourse(e) {
console.log(37344);
console.log(e);
this.selnav = e.currentTarget.dataset.id;
},
// 修改资料
changeziliao() {
let that=this;
this.$router.push({
path: "/changeziliao",
query: { username: that.username,avatar:that.avatar }
});
},
jump(id) {
if (id == 1) {
this.$router.push({
path: "/opencourse",
// query: { testId: item.test_student_id }
});
} else if (id == 2) {
this.$router.push({
path: "/zuozhanbao",
// query: { testId: item.test_student_id }
});
} else if (id == 3) {
this.$router.push({
path: "/sucaibao",
// query: { testId: item.test_student_id }
});
}
},
// 上面跳转
join(id) {
if (id == 1) {
this.$router.push({
path: "/publish"
// query: { testId: item.test_student_id }
});
} else if (id == 2) {
this.$router.push({
path: "/joinus",
// query: { testId: item.test_student_id }
});
} else if (id == 3) {
this.$router.push({
path: "/kefucenter",
// query: { testId: item.test_student_id }
});
} else if (id == 4) {
this.$router.push({
path: "/coupon",
// query: { testId: item.test_student_id }
});
} else if (id == 5) {
this.$router.push({
path: "/mycollect",
// query: { testId: item.test_student_id }
});
}
}
}
};
</script>
<style>
@import "../../../style/usercenter.css";
</style>