VideoSource.vue
7.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<template>
<!-- 视频资源 -->
<div class="video_source">
<Top :active="active"></Top>
<!-- banner -->
<div class="video_banner">
<img :src="videoSrc" alt />
</div>
<!-- 视频分类 -->
<div class="video_main">
<!-- 导航栏 -->
<div class="career_nav clearfix">
<div
class="nav_single"
:class="{nav_bottom:isNav == index}"
v-for="(item,index) in navList"
:key="index"
@click="changeNav(item,index)"
>{{item}}</div>
</div>
<!-- 政策解读 -->
<div class="career_book clearfix" v-show="isNav == 0">
<dl v-for="item in bookList" :key="item.id" @click="toDetail(item)">
<dt>
<img :src="item.video_image" alt />
</dt>
<dd>{{item.name}}</dd>
</dl>
</div>
<!-- 学生课程 -->
<div class="career_book video_course clearfix" v-show="isNav == 1">
<!-- 标签检索 -->
<div class="layout flex_row align_left label_search">
标签检索:
<div
class="label_content"
v-for="item in labeList"
:key="item.id"
:class="{label_content_choice:isChoiced == item.id}"
@click="byLabel(item)"
>{{item.name}}</div>
</div>
<dl v-for="item in bookList" :key="item.id" @click="toDetail(item)">
<dt>
<img :src="item.video_image" alt />
</dt>
<dd>{{item.name}}</dd>
</dl>
<div v-show="bookList.length == 0" class="no_book_list">暂无数据...</div>
</div>
<!-- 专业解读 -->
<div class="career_book video_course clearfix" v-show="isNav == 2">
<div class="layout flex_row align_left label_search">
检索:
<input
type="text"
placeholder="请直接输入专业名称,通过下拉选项检索"
v-model="major"
@input="changeSelect(isNav)"
/>
<div class="major_select clearfix" v-show="isShow">
<div
class="selection"
v-show="selectList.length>0"
v-for="(item,index) in selectList"
:key="index"
@click="toVideoPlay(item)"
>{{item.name}}</div>
<div class="selection" v-show="selectList.length==0">没有检索到对应信息</div>
</div>
</div>
<dl v-for="item in bookList" :key="item.id" @click="toDetail(item)">
<dt>
<img :src="item.video_image" alt />
</dt>
<dd>{{item.name}}</dd>
</dl>
</div>
<!-- 职业解读 -->
<div class="career_book video_course clearfix" v-show="isNav == 3">
<div class="layout flex_row align_left label_search">
检索:
<input
type="text"
placeholder="请直接输入职业名称"
v-model="profession"
@input="changeSelect(isNav)"
/>
<div class="major_select" v-show="isShow">
<div
class="selection"
v-show="selectList.length>0"
v-for="(item,index) in selectList"
:key="index"
@click="toVideoPlay(item)"
>{{item.name}}</div>
<div class="selection" v-show="selectList.length==0">没有检索到对应信息</div>
</div>
</div>
<dl v-for="item in bookList" :key="item.id" @click="toDetail(item)">
<dt>
<img :src="item.video_image" alt />
</dt>
<dd>{{item.name}}</dd>
</dl>
</div>
</div>
<Bottom2></Bottom2>
</div>
</template>
<script>
import Top from "../../common/Top";
import Bottom2 from "../../common/Bottom2";
import { post } from "@/api/http";
export default {
data() {
return {
active: 4,
navList: ["政策解读", "学生课程", "专业解读", "职业解读"],
isNav: 0,
bookList: [],
// 学习标签
labeList: [],
isChoiced:"",
// 参数
type: 1,
signId: "",
keyword: "",
name: "政策解读",
major: "",
profession: "",
// 搜索下拉框
isShow: false,
selectList: [],
videoSrc:"",
};
},
methods: {
imgZip(){
let file = require("@/assets/img/video.png");
lrz(file)
.then(res=>{
this.videoSrc = res.base64;
console.log(res)
})
},
// 导航栏
changeNav(item, index) {
this.isNav = index;
this.type = index + 1;
this.name = item;
this.isShow = false;
this.major = "";
this.profession = "";
this.getVideoList();
},
// 详情
toDetail(item) {
this.$router.push({
path: "/VideoPlay",
query: {
id: item.id,
type: this.type,
name: this.name,
title: item.name,
isNav: this.isNav
}
});
},
// 通过标签获取视频
byLabel(item) {
this.signId = item.id;
this.isChoiced = item.id;
this.getVideoList();
},
// 检索输入
changeSelect(isNav) {
this.isShow = true;
let keyword = "";
if (isNav == 2) {
if (!this.major) {
this.isShow = false;
return "";
}
keyword = this.major;
} else if (isNav == 3) {
if (!this.profession) {
this.isShow = false;
return "";
}
keyword = this.profession;
}
if (keyword) {
this.getSearchList(keyword, isNav);
}
},
// 视频资源智能筛选列表
getSearchList(keyword, isNav) {
let url = "/api/resource/getSearchList/";
let params = {
type: isNav / 1 + 1,
keyword: keyword
};
post(url, params).then(res => {
this.selectList = res.res_list;
});
},
toVideoPlay(item) {
this.$router.push({
path: "/VideoPlay",
query: {
id: item.id,
type: this.type,
name: this.name,
title: item.name,
isNav: this.isNav
}
});
},
// 视频资源列表
getVideoList() {
let url = "/api/resource/getVideoList/";
let params = {
type: this.type,
sign_id: this.signId,
keyword: this.keyword
};
post(url, params).then(res => {
this.bookList = res.res_list;
});
},
// 学生课程标签列表
getStudySignList() {
let url = "/api/resource/getStudySignList/";
post(url).then(res => {
this.labeList = res.sign_list;
});
}
},
components: {
Top,
Bottom2
},
mounted() {
this.isNav = this.$route.query.isNav;
this.type = this.isNav / 1 + 1;
this.getVideoList();
this.getStudySignList();
this.imgZip();
}
};
</script>
<style scoped>
@import "../../../style/career.css";
.video_source {
width: 100%;
background-color: #f2f5fa;
}
.video_banner {
width: 100%;
height: 404px;
}
.video_banner img {
width: 100%;
height: 100%;
}
.video_main {
width: 1200px;
margin: 30px auto 0;
background-color: #fff;
}
.video_course {
padding-top: 0;
}
/* 标签检索 */
.label_search {
line-height: 70px;
color: #5b5e63;
font-size: 14px;
position: relative;
}
.label_content {
height: 22px;
padding: 0 12px;
background-color: #eeeeee;
border-radius: 3px;
margin: 24px 11px;
line-height: 22px;
}
.label_content_choice{
background-color: #409eff;
color: #fff;
}
input {
width: 354px;
margin-top: 18px;
}
/* 下拉搜索框 */
.major_select {
position: absolute;
left: 42px;
top: 52px;
border: 1px solid #eee;
border-top: none;
}
.selection {
width: 354px;
height: 34px;
line-height: 34px;
text-align: left;
padding-left: 14px;
background-color: #fff;
}
.no_book_list {
font-size: 16px;
}
</style>