Commit c2bb1726 authored by 高铭波's avatar 高铭波

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

parents fb31a673 fcfc79b6
...@@ -374,6 +374,9 @@ export default { ...@@ -374,6 +374,9 @@ export default {
{ {
name: "消息通知", name: "消息通知",
}, },
{
name: "在线学习",
},
{ {
name: "考核认证", name: "考核认证",
}, },
...@@ -385,9 +388,6 @@ export default { ...@@ -385,9 +388,6 @@ export default {
{ {
name: "消息通知", name: "消息通知",
}, },
{
name: "在线学习",
},
{ {
name: "考核认证", name: "考核认证",
}, },
......
<template> <template>
<view class="learn-vedio"> <view class="learn-vedio">
<view v-if="version && loaded">
<u-navbar title="培训视频"></u-navbar> <u-navbar title="培训视频"></u-navbar>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view <view><video object-fit="fill" class="course-video" id="courseVideo" :src="courseSrc" @play="playCourse"
><video @error="videoErrorCallback" controls></video></view>
object-fit="fill"
class="course-video"
id="courseVideo"
:src="courseSrc"
@play="playCourse"
@error="videoErrorCallback"
controls
></video
></view>
<view class="title-content"> <view class="title-content">
<view class="item-content"> <view class="item-content">
<view class="item-st"> <view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image> <image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<text class="item-st-text">{{ <text class="item-st-text">{{ courseTitle.split(" ") ? courseTitle.split(" ")[0] : "" }}</text>
courseTitle.split(" ") ? courseTitle.split(" ")[0] : ""
}}</text>
</view> </view>
<view class="item-title">{{ <view class="item-title">{{ courseTitle.split(" ") ? courseTitle.split(" ")[1] : "" }}</view>
courseTitle.split(" ") ? courseTitle.split(" ")[1] : ""
}}</view>
</view> </view>
<view <view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view>
>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view
>
</view> </view>
<view class="learn-view" v-if="courseId >= 0"> <view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title">视频内容介绍</view> <view class="learn-view-title">视频内容介绍</view>
<view <view class="learn-list" v-for="(item, key) in courseOutlines[courseId]" :key="key">
class="learn-list"
v-for="(item, key) in courseOutlines[courseId]"
:key="key"
>
<view class="learn-list-item">{{ item }}</view> <view class="learn-list-item">{{ item }}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-else-if="loaded">
<u-navbar title=" "></u-navbar>
<view style="text-align: center;">暂无数据</view>
</view>
</view>
</template> </template>
<script> <script>
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
return { return {
courseId: "", courseId: "",
...@@ -54,6 +41,8 @@ export default { ...@@ -54,6 +41,8 @@ export default {
courseTitle: "", courseTitle: "",
courseDesc: "", courseDesc: "",
currentIndex: -1, // 第几个视频 currentIndex: -1, // 第几个视频
version: true,
loaded: false
}; };
}, },
computed: { computed: {
...@@ -103,21 +92,38 @@ export default { ...@@ -103,21 +92,38 @@ export default {
this.courseStatus = e.status; this.courseStatus = e.status;
} }
} }
this.getVersion();
}, },
onReady: function (res) { onReady: function(res) {
// #ifndef MP-ALIPAY // #ifndef MP-ALIPAY
this.videoContext = uni.createVideoContext("courseVideo"); this.videoContext = uni.createVideoContext("courseVideo");
// #endif // #endif
}, },
methods: { methods: {
videoErrorCallback: function (e) { getVersion() {
let version = process.uniEnv.version_number;
let that = this;
this.$u.api
.getVersionInfo(version)
.then((res) => {
that.loaded = true
let data = res.data;
if (data.hasOwnProperty('is_audit') && data.is_audit == 0) {
that.version = false
}
})
.catch((err) => {
});
},
videoErrorCallback: function(e) {
uni.showModal({ uni.showModal({
content: e.target.errMsg, content: e.target.errMsg,
showCancel: false, showCancel: false,
}); });
}, },
playCourse: function (e) { playCourse: function(e) {
if(this.courseStatus && (this.courseStatus == "1"||this.courseStatus == 1)) { if (this.courseStatus && (this.courseStatus == "1" || this.courseStatus == 1)) {
return return
} }
this.changeCourseStatus(); this.changeCourseStatus();
...@@ -144,11 +150,11 @@ export default { ...@@ -144,11 +150,11 @@ export default {
} }
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.learn-vedio { .learn-vedio {
background-color: #f4f5f7; background-color: #f4f5f7;
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -157,24 +163,24 @@ export default { ...@@ -157,24 +163,24 @@ export default {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto; overflow-y: auto;
} }
.course-video { .course-video {
width: 750rpx; width: 750rpx;
} }
.course-title { .course-title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 700; font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx; padding: 80rpx 60rpx 40rpx 60rpx;
} }
.course-desc { .course-desc {
margin-left: 60rpx; margin-left: 60rpx;
} }
.title-content { .title-content {
padding: 40rpx 30rpx; padding: 40rpx 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
background-color: #ffffff; background-color: #ffffff;
...@@ -194,6 +200,7 @@ export default { ...@@ -194,6 +200,7 @@ export default {
margin-right: 20rpx; margin-right: 20rpx;
line-height: 24rpx; line-height: 24rpx;
position: relative; position: relative;
.item-st-text { .item-st-text {
color: #ffffff; color: #ffffff;
position: absolute; position: absolute;
...@@ -209,19 +216,19 @@ export default { ...@@ -209,19 +216,19 @@ export default {
font-size: 44rpx; font-size: 44rpx;
font-weight: bold; font-weight: bold;
} }
} }
.item-content { .item-content {
display: flex; display: flex;
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
.item-title { .item-title {
color: #333333; color: #333333;
font-size: 28rpx; font-size: 28rpx;
} }
.learn-view { .learn-view {
background-color: #ffffff; background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx; padding: 38rpx 30rpx 30rpx 30rpx;
...@@ -234,6 +241,7 @@ export default { ...@@ -234,6 +241,7 @@ export default {
font-weight: bold; font-weight: bold;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.learn-list { .learn-list {
.learn-list-item { .learn-list-item {
font-size: 28rpx; font-size: 28rpx;
...@@ -248,5 +256,5 @@ export default { ...@@ -248,5 +256,5 @@ export default {
width: 100%; width: 100%;
} }
} }
} }
</style> </style>
<template> <template v-cloak>
<view class=""> <view class="">
<view class="learn-vedio"> <view class="learn-vedio" v-if="version && loaded">
<u-navbar back-icon-color="#000000" :background="background" title-color="#000000" :border-bottom="false"> <u-navbar back-icon-color="#000000" :background="background" title-color="#000000" :border-bottom="false">
</u-navbar> </u-navbar>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
...@@ -48,6 +48,11 @@ ...@@ -48,6 +48,11 @@
</view> </view>
</view> </view>
</view> </view>
<view v-else-if="loaded">
<u-navbar back-icon-color="#000000" :background="background" title-color="#000000" :border-bottom="false">
</u-navbar>
<view style="text-align: center;">暂无数据</view>
</view>
</view> </view>
</template> </template>
...@@ -100,7 +105,9 @@ ...@@ -100,7 +105,9 @@
scrollTop: null scrollTop: null
}, },
scrollValue: 0, scrollValue: 0,
nowTime: 0 nowTime: 0,
version: true,
loaded: false
}; };
}, },
computed: { computed: {
...@@ -109,18 +116,37 @@ ...@@ -109,18 +116,37 @@
}, },
}, },
onLoad(e) { onLoad(e) {
this.getVersion();
getApp().trackPage('学习视频详情页') getApp().trackPage('学习视频详情页')
if(e){
this.section_id = e.section_id this.section_id = e.section_id
this.params.course_id = e.course_id this.params.course_id = e.course_id
this.getCapterDetails() this.getCapterDetails()
this.getSectionInfo({ this.getSectionInfo({
section_id: e.section_id section_id: e.section_id
}) })
}
}, },
onReady: function(res) { onReady: function(res) {
this.videoContext = uni.createVideoContext("courseVideo"); this.videoContext = uni.createVideoContext("courseVideo");
}, },
methods: { methods: {
getVersion() {
let version = process.uniEnv.version_number;
let that = this;
this.$u.api
.getVersionInfo(version)
.then((res) => {
that.loaded = true
let data = res.data;
if(data.hasOwnProperty('is_audit') && data.is_audit == 0){
that.version = false
}
})
.catch((err) => {
that.loaded = true
});
},
scroll: function(e) { scroll: function(e) {
this.old.scrollTop = e.detail.scrollTop this.old.scrollTop = e.detail.scrollTop
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment