Character.vue
5.7 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
<template>
<!-- 人物介绍 -->
<div class="character_intro">
<div class="major_det_box clearfix">
<!-- 面包屑 -->
<div class="major_title layout align_left">
<el-breadcrumb separator="|">
<el-breadcrumb-item @click.native="toUniversityIndex()">首页</el-breadcrumb-item>
<el-breadcrumb-item>生涯人物</el-breadcrumb-item>
</el-breadcrumb>
</div>
<!-- 内容 -->
<div class="charact_msg_box">
<!-- 人物信息 -->
<div class="charact_msg clearfix">
<!-- 左侧图片 -->
<div class="charact_msg_l">
<img :src="charactList.avatar" alt />
</div>
<!-- 右侧信息 -->
<div class="charact_msg_r">
<div class="charact_name">{{charactList.name}}</div>
<div class="charact_det_msg clearfix">
<div class="charact_det_msg_l">
<div>性别:</div>
<div>籍贯:</div>
<div>出生年月:</div>
</div>
<div class="charact_det_msg_l">
<div>{{charactList.sex == 1?"男":"女"}}</div>
<div>{{charactList.place}}</div>
<div>{{charactList.birthday}}({{charactList.constellation}})</div>
</div>
<div class="charact_det_msg_l">
<div>职业:</div>
<div>所学专业:</div>
<div>毕业院校:</div>
</div>
<div class="charact_det_msg_l">
<div
class="charact_det_color"
@click="toProfession(charactList.profession_id)"
>{{charactList.profession}}</div>
<div
class="charact_det_color"
@click="toMajor(charactList.majors_id)"
>{{charactList.majors_name}}</div>
<div
class="charact_det_color"
@click="toUniversity(charactList.school_id)"
>{{charactList.school_name}}</div>
</div>
</div>
</div>
</div>
<!-- 人物简介 -->
<div class="charact_profile">
<h2>人物简介</h2>
<div class="profile" v-html="charactList.introduce"></div>
</div>
<!-- 人物经历 -->
<div class="charact_experience">
<h2>人物经历</h2>
<div class="profile" v-html="charactList.experience"></div>
</div>
<div class="charact_experience" v-show="charactList.achieve">
<h2>成就</h2>
<div class="profile" v-html="charactList.achieve"></div>
</div>
<div class="charact_tips">以上内容来源于网络,如有侵权,请及时联系,我方将在24小时内删除</div>
</div>
<!-- 生涯人物风云榜 -->
<div class="others_box">
<h2>生涯人物风云榜</h2>
<div class="charact_others clearfix">
<div class="charact_single clearfix" v-for="(item,index) in classicaList" :key="index">
<div class="single_pic">
<img :src="item.avatar" alt />
</div>
<div class="single_msg">
<div class="single_name" @click="currentDet(item)">{{item.name}}</div>
<div class="charact_det_msg clearfix">
<div class="charact_det_msg_l single_det_msg">
<div>职业:</div>
<div>毕业院校:</div>
<div>所学专业:</div>
</div>
<div class="charact_det_msg_l single_det_msg">
<div>{{item.profession}}</div>
<div>{{item.school_name}}</div>
<div>{{item.majors_name}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { post } from "@/api/http";
export default {
data() {
return {
id: "",
charactList: [],
classicaList: []
};
},
methods: {
toUniversityIndex(){
this.$router.push({path:'/University'})
},
// 职业详情
toProfession(id) {
if (id) {
this.$router.push({ path: "/Occupation", query: { id: id } });
}
},
// 专业详情
toMajor(id) {
this.$router.push({ path: "/HotMajor", query: { id: id } });
},
// 院校详情
toUniversity(id) {
this.$router.push({ path: "/UniversityIntroduc", query: { id: id } });
},
currentDet(item) {
this.id = item.id;
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
this.getClassicalDetail();
},
// 经典人物详情
getClassicalDetail() {
let url = "/api/profession/getClassicalDetail/";
let params = {
id: this.id
};
post(url, params).then(res => {
this.charactList = res.classical;
});
},
// 生涯人物风云榜
getClassicalList() {
let url = "/api/profession/getClassicalList/";
post(url).then(res => {
this.classicaList = res.classical;
});
}
},
mounted() {
this.id = this.$route.query.id;
this.getClassicalDetail();
this.getClassicalList();
},
watch:{
'$route'(to,from){
this.id = this.$route.query.id;
this.getClassicalDetail();
}
},
};
</script>
<style scoped>
@import "../../../../style/majorDetail.css";
@import "../../../../style/charact.css";
.character_intro {
width: 100%;
background-color: #f2f5fa;
}
.charact_single:hover .single_name {
color: #409eff;
}
.charact_det_color {
color: #409eff;
}
.charact_tips{
color: #F44A5E;
font-size: 14px;
margin-top:20px;
}
</style>