Commit 36601a7b authored by Morson's avatar Morson
parents 923baff0 ae0a94c0
<template>
<view class="learn-vedio">
<view class="uni-padding-wrap uni-common-mt">
<view><video object-fit="cover" class="course-video" id="courseVideo" :src="courseSrc"
@error="videoErrorCallback" controls></video></view>
<view class="title-content">
<view class="item-content">
<view class="item-st">
<text class="item-st-text">{{courseTitle.split(' ') ? courseTitle.split(' ')[0] : ''}}</text>
</view>
<view class="item-title">{{courseTitle.split(' ') ? courseTitle.split(' ')[1] : ''}}</view>
</view>
<view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</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 class="learn-vedio">
<view class="uni-padding-wrap uni-common-mt">
<view
><video
object-fit="cover"
class="course-video"
id="courseVideo"
:src="courseSrc"
@error="videoErrorCallback"
controls
></video
></view>
<view class="title-content">
<view class="item-content">
<view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<text class="item-st-text">{{
courseTitle.split(" ") ? courseTitle.split(" ")[0] : ""
}}</text>
</view>
<view class="item-title">{{
courseTitle.split(" ") ? courseTitle.split(" ")[1] : ""
}}</view>
</view>
<view
>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</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>
</template>
<script>
let app = getApp();
export default {
data() {
return {
courseId: '',
courseStatus: 0,
courseSrc: '',
courseTitle: '',
courseDesc: '',
currentIndex: -1 // 第几个视频
};
},
computed: {
courseOutlines() { // 视频内容介绍
return {1:[
'1、考核规则:接单及时率',
'2、考核规则:上门及时率',
'3、考核规则:安装完工率',
'4、考核规则:资料提交及时率',
'5、考核规则:安装完工率',
'6、考核规则:客户满意度'
],
2:[
'1、必备材料4大类',
'2、施工工具准备'
],
3:[
'1、接线安装工艺标准',
'2、PVC、镀锌管电缆管明敷',
'3、电缆敷设的防火要求',
'4、电源点标识',
'5、配电箱接线及安装',
'6、管线敷设接头处理',
'7、充电桩内部接线',
'8、配电箱安装'
],
4:[
'1、勘测环节录单要求',
'2、安装环节录单要求'
]}
}
},
onLoad(e) {
if (e) {
if (e.courseId) {
this.courseId = e.courseId;
}
if (e.id) {
this.courseId = e.courseId;
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;
this.changeCourseStatus();
}
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
});
},
getRandomColor: function() {
const rgb = [];
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16);
color = color.length == 1 ? '0' + color : color;
rgb.push(color);
}
return '#' + rgb.join('');
},
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为空,请重新选择课程"
})
}
},
}
};
let app = getApp();
export default {
data() {
return {
courseId: "",
courseStatus: 0,
courseSrc: "",
courseTitle: "",
courseDesc: "",
currentIndex: -1, // 第几个视频
};
},
computed: {
courseOutlines() {
// 视频内容介绍
return {
1: [
"1、考核规则:接单及时率",
"2、考核规则:上门及时率",
"3、考核规则:安装完工率",
"4、考核规则:资料提交及时率",
"5、考核规则:安装完工率",
"6、考核规则:客户满意度",
],
2: ["1、必备材料4大类", "2、施工工具准备"],
3: [
"1、接线安装工艺标准",
"2、PVC、镀锌管电缆管明敷",
"3、电缆敷设的防火要求",
"4、电源点标识",
"5、配电箱接线及安装",
"6、管线敷设接头处理",
"7、充电桩内部接线",
"8、配电箱安装",
],
4: ["1、勘测环节录单要求", "2、安装环节录单要求"],
};
},
kcImage() {
return qn_base_url + "kc.png";
},
},
onLoad(e) {
if (e) {
if (e.courseId) {
this.courseId = e.courseId;
}
if (e.id) {
this.courseId = e.courseId;
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;
this.changeCourseStatus();
}
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,
});
},
getRandomColor: function () {
const rgb = [];
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16);
color = color.length == 1 ? "0" + color : color;
rgb.push(color);
}
return "#" + rgb.join("");
},
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>
<style lang="scss" scoped>
.learn-vedio {
background-color: #F4F5F7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.course-video {
width: 100%;
}
.course-title {
font-size: 36rpx;
font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.course-desc {
margin-left: 60rpx;
}
.title-content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
background-color: #FFFFFF;
color: #999999;
font-size: 24rpx;
.item-content {
display: flex;
}
.item-st {
width: 80rpx;
height: 36rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
font-size: 16rpx;
border-radius: 6rpx 36rpx 36rpx 6rpx;
padding-top: 8rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
.item-st-text {
color: #FFFFFF;
}
}
.item-title {
color: #333333;
font-size: 28rpx;
}
}
.learn-vedio {
background-color: #f4f5f7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.item-content {
display: flex;
padding-bottom: 30rpx;
}
.course-video {
width: 100%;
}
.item-st {
width: 80rpx;
height: 36rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
font-size: 16rpx;
border-radius: 6rpx 36rpx 36rpx 6rpx;
padding-top: 8rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
}
.course-title {
font-size: 36rpx;
font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.item-title {
color: #333333;
font-size: 28rpx;
}
.course-desc {
margin-left: 60rpx;
}
.learn-view {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.title-content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
background-color: #ffffff;
color: #999999;
font-size: 24rpx;
.item-content {
display: flex;
align-items: center;
}
.item-st {
width: 80rpx;
height: 36rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
line-height: 24rpx;
position: relative;
.item-st-text {
color: #ffffff;
position: absolute;
font-size: 16rpx;
left: 20rpx;
top: 8rpx;
line-height: 28rpx;
}
}
.item-title {
color: #333333;
font-size: 44rpx;
font-weight: bold;
}
}
.learn-view-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 10rpx;
.item-content {
display: flex;
padding-bottom: 30rpx;
}
.learn-list {
.learn-list-item {
font: 24rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
}
.item-title {
color: #333333;
font-size: 28rpx;
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
}
}
}
</style>
.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: 24rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
}
.line-view {
background-color: #f4f5f7;
height: 2rpx;
width: 100%;
}
}
}
</style>
......@@ -9,9 +9,10 @@
<view class="learn-view-title">接单操作须知</view>
<view class="learn-list" v-for="(item, key) in tutorials" :key="key">
<view class="learn-list-item">
<view class="item-content">
<view class="item-st"><text
class="item-st-text">{{item.title.split(' ') ? item.title.split(' ')[0] : ''}}</text>
<view class="item-content">
<view class="item-st">
<image style="width: 80rpx;height: 36rpx;" :src="kcImage"></image>
<text class="item-st-text">{{item.title.split(' ') ? item.title.split(' ')[0] : ''}}</text>
</view>
<view class="item-title">{{item.title.split(' ') ? item.title.split(' ')[1] : ''}}</view>
</view>
......@@ -148,6 +149,9 @@
},
tips1Image() {
return qn_base_url + 'tips1.png'
},
kcImage() {
return qn_base_url + 'kc.png'
}
},
onLoad() {
......@@ -301,16 +305,18 @@
.item-st {
width: 80rpx;
height: 36rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
font-size: 16rpx;
border-radius: 6rpx 36rpx 36rpx 6rpx;
padding-top: 8rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
line-height: 24rpx;
line-height: 24rpx;
position: relative;
.item-st-text {
color: #FFFFFF;
color: #FFFFFF;
position: absolute;
font-size: 16rpx;
left: 20rpx;
top: 8rpx;
line-height: 28rpx;
}
}
......
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