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">
<u-navbar title="培训视频"></u-navbar> <view v-if="version && loaded">
<view class="uni-padding-wrap uni-common-mt"> <u-navbar title="培训视频"></u-navbar>
<view <view class="uni-padding-wrap uni-common-mt">
><video <view><video object-fit="fill" class="course-video" id="courseVideo" :src="courseSrc" @play="playCourse"
object-fit="fill" @error="videoErrorCallback" controls></video></view>
class="course-video" <view class="title-content">
id="courseVideo" <view class="item-content">
:src="courseSrc" <view class="item-st">
@play="playCourse" <image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
@error="videoErrorCallback" <text class="item-st-text">{{ courseTitle.split(" ") ? courseTitle.split(" ")[0] : "" }}</text>
controls </view>
></video <view class="item-title">{{ courseTitle.split(" ") ? courseTitle.split(" ")[1] : "" }}</view>
></view> </view>
<view class="title-content"> <view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view>
<view class="item-content"> </view>
<view class="item-st"> <view class="learn-view" v-if="courseId >= 0">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image> <view class="learn-view-title">视频内容介绍</view>
<text class="item-st-text">{{ <view class="learn-list" v-for="(item, key) in courseOutlines[courseId]" :key="key">
courseTitle.split(" ") ? courseTitle.split(" ")[0] : "" <view class="learn-list-item">{{ item }}</view>
}}</text> </view>
</view> </view>
<view class="item-title">{{ </view>
courseTitle.split(" ") ? courseTitle.split(" ")[1] : ""
}}</view>
</view> </view>
<view <view v-else-if="loaded">
>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view <u-navbar title=" "></u-navbar>
> <view style="text-align: center;">暂无数据</view>
</view>
<view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title">视频内容介绍</view>
<view
class="learn-list"
v-for="(item, key) in courseOutlines[courseId]"
:key="key"
>
<view class="learn-list-item">{{ item }}</view>
</view> </view>
</view>
</view> </view>
</view>
</template> </template>
<script> <script>
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
return { return {
courseId: "", courseId: "",
courseStatus: 0, courseStatus: 0,
courseSrc: "", courseSrc: "",
courseTitle: "", courseTitle: "",
courseDesc: "", courseDesc: "",
currentIndex: -1, // 第几个视频 currentIndex: -1, // 第几个视频
}; version: true,
}, loaded: false
computed: { };
courseOutlines() { },
// 视频内容介绍 computed: {
return { courseOutlines() {
1: [ // 视频内容介绍
"1、考核规则:接单及时率", return {
"2、考核规则:上门及时率", 1: [
"3、考核规则:安装完工率", "1、考核规则:接单及时率",
"4、考核规则:资料提交及时率", "2、考核规则:上门及时率",
"5、考核规则:安装完工率", "3、考核规则:安装完工率",
"6、考核规则:客户满意度", "4、考核规则:资料提交及时率",
], "5、考核规则:安装完工率",
2: ["1、必备材料4大类", "2、施工工具准备"], "6、考核规则:客户满意度",
3: [ ],
"1、接线安装工艺标准", 2: ["1、必备材料4大类", "2、施工工具准备"],
"2、PVC、镀锌管电缆管明敷", 3: [
"3、电缆敷设的防火要求", "1、接线安装工艺标准",
"4、电源点标识", "2、PVC、镀锌管电缆管明敷",
"5、配电箱接线及安装", "3、电缆敷设的防火要求",
"6、管线敷设接头处理", "4、电源点标识",
"7、充电桩内部接线", "5、配电箱接线及安装",
"8、配电箱安装", "6、管线敷设接头处理",
], "7、充电桩内部接线",
4: ["1、勘测环节录单要求", "2、安装环节录单要求"], "8、配电箱安装",
}; ],
}, 4: ["1、勘测环节录单要求", "2、安装环节录单要求"],
kcImage() { };
return process.uniEnv.qn_base_url + "kc.png"; },
}, kcImage() {
}, return process.uniEnv.qn_base_url + "kc.png";
onLoad(e) { },
app.trackPage('入驻培训视频页') },
if (e) { onLoad(e) {
if (e.courseId) { app.trackPage('入驻培训视频页')
this.courseId = e.courseId; if (e) {
} if (e.courseId) {
if (e.id) { this.courseId = e.courseId;
this.courseId = e.courseId; }
this.courseSrc = app.globalData.service_standard[e.id].url; if (e.id) {
this.courseTitle = app.globalData.service_standard[e.id].title; this.courseId = e.courseId;
this.courseDesc = app.globalData.service_standard[e.id].desc; this.courseSrc = app.globalData.service_standard[e.id].url;
} this.courseTitle = app.globalData.service_standard[e.id].title;
this.courseDesc = app.globalData.service_standard[e.id].desc;
if (e.status) { }
this.courseStatus = e.status;
} if (e.status) {
} this.courseStatus = e.status;
}, }
onReady: function (res) {
// #ifndef MP-ALIPAY
this.videoContext = uni.createVideoContext("courseVideo");
// #endif
},
methods: {
videoErrorCallback: function (e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false,
});
},
playCourse: function (e) {
if(this.courseStatus && (this.courseStatus == "1"||this.courseStatus == 1)) {
return
}
this.changeCourseStatus();
},
changeCourseStatus() {
let that = this;
if (that.courseId) {
that.$u.api
.saveCourseRate({
courseId: that.courseId,
})
.then((res) => {
if (res.code !== 200) {
uni.showToast({
icon: "none",
title: "更新课程状态失败",
});
} }
}); this.getVersion();
} else { },
uni.showToast({ onReady: function(res) {
title: "课程ID为空,请重新选择课程", // #ifndef MP-ALIPAY
}); this.videoContext = uni.createVideoContext("courseVideo");
} // #endif
}, },
}, 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) => {
});
},
videoErrorCallback: function(e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false,
});
},
playCourse: function(e) {
if (this.courseStatus && (this.courseStatus == "1" || this.courseStatus == 1)) {
return
}
this.changeCourseStatus();
},
changeCourseStatus() {
let that = this;
if (that.courseId) {
that.$u.api
.saveCourseRate({
courseId: that.courseId,
})
.then((res) => {
if (res.code !== 200) {
uni.showToast({
icon: "none",
title: "更新课程状态失败",
});
}
});
} else {
uni.showToast({
title: "课程ID为空,请重新选择课程",
});
}
},
},
};
</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;
left: 0; left: 0;
width: 100%; width: 100%;
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;
color: #999999; color: #999999;
font-size: 24rpx; font-size: 24rpx;
.item-content { .item-content {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.item-st { .item-st {
width: 80rpx; width: 80rpx;
height: 36rpx; height: 36rpx;
padding-right: 2rpx; padding-right: 2rpx;
text-align: center; text-align: center;
margin-right: 20rpx; margin-right: 20rpx;
line-height: 24rpx; line-height: 24rpx;
position: relative; position: relative;
.item-st-text {
color: #ffffff; .item-st-text {
position: absolute; color: #ffffff;
font-size: 16rpx; position: absolute;
left: 20rpx; font-size: 16rpx;
top: 8rpx; left: 20rpx;
line-height: 28rpx; top: 8rpx;
line-height: 28rpx;
}
}
.item-title {
color: #333333;
font-size: 44rpx;
font-weight: bold;
}
} }
}
.item-content {
.item-title { display: flex;
color: #333333; padding-bottom: 30rpx;
font-size: 44rpx;
font-weight: bold;
}
}
.item-content {
display: flex;
padding-bottom: 30rpx;
}
.item-title {
color: #333333;
font-size: 28rpx;
}
.learn-view {
background-color: #ffffff;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-view-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.learn-list {
.learn-list-item {
font-size: 28rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
color: #333333;
} }
.line-view { .item-title {
background-color: #f4f5f7; color: #333333;
height: 2rpx; font-size: 28rpx;
width: 100%; }
.learn-view {
background-color: #ffffff;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-view-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.learn-list {
.learn-list-item {
font-size: 28rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
color: #333333;
}
.line-view {
background-color: #f4f5f7;
height: 2rpx;
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) {
getApp().trackPage('学习视频详情页') this.getVersion();
this.section_id = e.section_id getApp().trackPage('学习视频详情页')
this.params.course_id = e.course_id if(e){
this.getCapterDetails() this.section_id = e.section_id
this.getSectionInfo({ this.params.course_id = e.course_id
section_id: e.section_id this.getCapterDetails()
}) this.getSectionInfo({
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