integrated_traffic_uniapp/pages/application/onlinexxks/strengthen_video_study.vue

224 lines
5.5 KiB
Vue
Raw Normal View History

2024-03-25 19:16:41 +08:00
<template>
<view>
<!-- <cu-custom bgColor="bg-gradual-blueness" :isBack="true">-->
<!-- <block slot="backText">返回</block>-->
<!-- <block slot="content">加强学习</block>-->
<!-- </cu-custom>-->
<view class="container">
<view class="fixed">
<view v-if="videoSrc">
2024-07-11 18:33:16 +08:00
<!-- <video-->
<!-- id="video"-->
<!-- :src="baseImgPath + videoSrc"-->
<!-- :poster="videoPoster"-->
<!-- autoplay-->
<!-- controls-->
<!-- style="width: 100vw"-->
<!-- />-->
<web-view-video
ref="video"
:src="videoSrc"
2024-03-25 19:16:41 +08:00
:poster="videoPoster"
/>
</view>
</view>
<scroll-view scroll-y :style="{ height: `calc(100vh - 450upx)` }">
<view class="video_container">
<view
v-for="(item, index) in videoList"
:key="index"
class="video_list_main_wrap"
@click="fnGetPlayInfo(item.VIDEOCOURSEWARE_ID)"
>
<view class="video_list_main_wrap_tit">
{{ item.COURSEWARENAME }}
</view>
<view class="video_list_main_wrap_info">
<text class="ml5">{{ secondsCount(item.VIDEOTIME) }}</text>
<image src="/static/study/play.png"/>
</view>
</view>
</view>
</scroll-view>
<view class="footer">
<button class="cu-btn bg-blue" @click="fnNavigationExamination">
效果评估考试
</button>
</view>
</view>
</view>
</template>
<script>
2024-07-08 17:59:37 +08:00
import {
basePath, baseImgPath
} from "@/common/tool";
2024-07-11 18:33:16 +08:00
import WebViewVideo from "@/pages/application/onlinexxks/web_view_video.vue";
2024-03-25 19:16:41 +08:00
export default {
2024-07-11 18:33:16 +08:00
components: {WebViewVideo},
2024-03-25 19:16:41 +08:00
data() {
return {
2024-07-08 17:59:37 +08:00
baseImgPath: baseImgPath,
2024-03-25 19:16:41 +08:00
CLASS_ID: '',
POST_ID: '',
STUDENT_ID: '',
videoSrc: '',
videoPoster: '',
videoList: [],
info: {}
}
},
onLoad(options) {
this.CLASS_ID = options.CLASS_ID;
this.POST_ID = options.POST_ID;
this.STUDENT_ID = options.STUDENT_ID;
this.fnGetData()
},
methods: {
fnGetData() {
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/stagestudentrelation/listStrengthenVideo',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
CLASS_ID: this.CLASS_ID,
STUDENT_ID: this.STUDENT_ID,
TYPE: "APP",
},
success: (res) => {
uni.hideLoading(); //结束加载中动画
var resData = res.data;
if ("success" == resData.result) {
this.info = resData.relation;
this.videoList = resData.videoList;
}
}
});
},
// 视频秒数转换时分秒
secondsCount(second) {
if (!second) return 0;
const h = parseInt((second / 60 / 60) % 24, 10);
const m = parseInt((second / 60) % 60, 10);
const s = parseInt(second % 60, 10);
return (
(h < 10 ? "0" + h : h) +
":" +
(m < 10 ? "0" + m : m) +
":" +
(s < 10 ? "0" + s : s)
);
},
fnGetPlayInfo(VIDEOCOURSEWARE_ID) {
uni.showLoading({
title: '请稍候'
})
uni.request({
2024-07-08 17:59:37 +08:00
url: basePath + '/app/audioOrVideo/getPlayInfo',
2024-03-25 19:16:41 +08:00
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
VIDEOCOURSEWARE_ID,
},
success: (res) => {
uni.hideLoading(); //结束加载中动画
var resData = res.data;
if ("success" == resData.result) {
if (resData.PLAYURL) {
2024-07-11 18:33:16 +08:00
console.log(resData)
2024-03-25 19:16:41 +08:00
this.videoSrc = resData.PLAYURL;
this.videoPoster = resData.COVERURL;
} else {
uni.showToast({
title: resData.msg,
icon: 'none'
})
}
}
}
})
},
fnNavigationExamination() {
uni.navigateTo({
url: '/pages/application/onlinexxks/course_exam?STAGEEXAMPAPERINPUT_ID=' + this.info.STRENGTHEN_STAGEEXAMPAPER_INPUT_ID + '&STAGEEXAMPAPER_ID=' + this.info.STRENGTHEN_STAGEEXAMPAPER_INPUT_ID + '&CLASS_ID=' + this.CLASS_ID + '&POST_ID=' + this.POST_ID + '&STUDENT_ID=' + this.STUDENT_ID + '&entrySite=strengththen'
})
}
},
}
</script>
<style scoped lang="scss">
.video_container {
width: 100%;
background: #ffffff;
padding: 40upx;
margin-top: 20upx;
box-sizing: border-box;
.video_list_title {
display: flex;
align-items: center;
margin-left: -10upx;
}
.video_list_main_wrap {
width: 100%;
background: #fafafa;
padding: 20upx;
border-radius: 10upx;
font-size: 26upx;
display: flex;
justify-content: space-between;
box-sizing: border-box;
color: #666666;
margin-bottom: 20upx;
.video_list_main_wrap_info {
display: flex;
image {
width: 28upx;
height: 28upx;
}
}
}
}
.footer {
display: flex;
position: fixed;
bottom: 0;
justify-content: space-between;
width: 100%;
left: 0;
padding: 20upx;
box-sizing: border-box;
background: #fff;
button {
width: 100%;
border-radius: 10upx;
}
}
.video_bg, #video {
width: 100%;
height: 450upx;
}
.ml5 {
margin-left: 10upx;
margin-right: 10upx;
}
</style>