Commit c8d016a0 authored by 林文清's avatar 林文清

update:在线学习

parent 5133b1f8
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'http://rest-u.yunya.com', //php端域名请求头 apiUrl: 'http://rest-u.yunya.com', //php端域名请求头
xueUrl: 'http://xue.yunya.com', //学院 xueUrl: 'http://rest-xue.yunya.com', //学院
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
......
...@@ -10,11 +10,12 @@ ...@@ -10,11 +10,12 @@
} }
} else if (process.env.NODE_ENV === "production") { } else if (process.env.NODE_ENV === "production") {
// ENV_VAR = require('./.env.prod.js'); // ENV_VAR = require('./.env.prod.js');
ENV_VAR = require('./.env.test.js'); ENV_VAR = require('./.env.test.js');
} }
if (ENV_VAR) { if (ENV_VAR) {
process.uniEnv = {}; process.uniEnv = {};
process.uniEnv['node_env'] = NODE_ENV;
for (let key in ENV_VAR) { for (let key in ENV_VAR) {
process.uniEnv[key] = ENV_VAR[key]; process.uniEnv[key] = ENV_VAR[key];
} }
......
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'https://rest-u.banshouhui.com', //php端域名请求头 apiUrl: 'https://rest-u.banshouhui.com', //php端域名请求头
xueUrl:'https://xue.banshouhui.com', //学院 xueUrl:'https://rest-xue.banshouhui.com', //学院
banshou:'https://m.banshou.com' ,//扳手app banshou:'https://m.banshou.com' ,//扳手app
}, },
systemUrl: { systemUrl: {
......
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'https://rest-u.test.ibanshou.cn', //php端域名请求头 apiUrl: 'https://rest-u.test.ibanshou.cn', //php端域名请求头
// xueUrl: 'https://xue.banshouhui.com', //学院 xueUrl: 'https://rest-xue.test.ibanshou.cn', //学院
banshou: 'https://m.test.ibanshou.cn', //扳手app banshou: 'https://m.test.ibanshou.cn', //扳手app
}, },
systemUrl: { systemUrl: {
......
<template>
<view class="settle-view">
<u-navbar style="position: absolute;" title="考核认证" background="{background: transparent}" :border-bottom="false"
back-icon-color="#333333" title-color="#333333"></u-navbar>
<view :class="['introduction', {'active': type}]">
<slot></slot>
</view>
<view class="settle-bottom">
<slot name="bottom"></slot>
</view>
</view>
</template>
<script>
export default {
props: {
index: {
type: Number,
default: 1
},
// 0: introduction距离底部168rpx 1: introduction距离底部0rpx
type: {
type: Number,
default: 0
}
},
data() {
return {}
},
computed: {
url() {
return process.uniEnv.qn_base_url + 'topl' + this.index + '.png'
}
}
}
</script>
<style lang="scss" scoped>
.settle-view {
::-webkit-scrollbar {
width: 0;
}
}
.introduction {
border-radius: 12rpx;
overflow: auto;
position: fixed;
top: 160rpx;
bottom: 168rpx;
left: 30rpx;
right: 30rpx;
&.active {
bottom: 0rpx;
}
}
.settle-bottom {
position: fixed;
bottom: 44rpx;
width: 100%;
}
</style>
...@@ -75,14 +75,15 @@ ...@@ -75,14 +75,15 @@
{ {
"path": "answer", "path": "answer",
"style": { "style": {
"navigationBarTitleText": "考试答题", "navigationBarTitleText": "考核认证",
"navigationStyle":"custom" "navigationStyle":"custom"
} }
}, },
{ {
"path":"result", "path":"result",
"style":{ "style":{
"navigationBarTitleText":"考试答题" "navigationBarTitleText":"",
"navigationStyle":"custom"
} }
}, },
{ {
...@@ -100,7 +101,8 @@ ...@@ -100,7 +101,8 @@
{ {
"path": "curriculum", "path": "curriculum",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": "",
"navigationStyle": "custom" // 隐藏系统导航栏
} }
}, },
{ {
...@@ -116,7 +118,16 @@ ...@@ -116,7 +118,16 @@
"path": "course-detail", "path": "course-detail",
"style": { "style": {
"navigationBarTitleText": "培训视频", "navigationBarTitleText": "培训视频",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"navigationStyle": "custom" // 隐藏系统导航栏
}
},
{
"path": "exam-pass",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom" // 隐藏系统导航栏
} }
} }
] ]
......
This diff is collapsed.
This diff is collapsed.
...@@ -8,21 +8,21 @@ ...@@ -8,21 +8,21 @@
></u-navbar> ></u-navbar>
<view class="title">考试规则</view> <view class="title">考试规则</view>
<view class="test"> <view class="test">
<view class="slogan" <view class="slogan">
>这是一场严肃的考试,请认真查看 规则,预祝您顺利通过考试!</view 这是一场严肃的考试,请认真查看 规则,预祝您顺利通过考试!
> </view>
<view class="text"> <view class="text">
<text class="left">考试科目:</text <text class="left">考试科目:</text
><text style="color: #007aff">服务规范</text> ><text style="color: #007aff">{{ desc.title }}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">合格条件:</text><text>60分</text> <text class="left">合格条件:</text><text>{{ desc.score }}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">考试时间:</text><text>30分钟</text> <text class="left">考试时间:</text><text>{{ desc.time }}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">题目来源:</text><text>系统随机20题</text> <text class="left">题目来源:</text><text>系统随机{{ desc.number }}题</text>
</view> </view>
<button @click="getUserExamId()">开始考试</button> <button @click="getUserExamId()">开始考试</button>
</view> </view>
...@@ -30,50 +30,122 @@ ...@@ -30,50 +30,122 @@
</template> </template>
<script> <script>
let condition = {
"dev": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
},
"test": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
},
"prod": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
}
};
let env = process.uniEnv.node_env;
let desc = condition[env];
export default { export default {
data() { data() {
return { return {
examId: 2, desc: null,
examId: null,
exam: null, exam: null,
userExamId: null, userExamId: null,
}; };
}, },
onLoad() { onLoad(param) {
this.examId = param.examId
this.desc = desc["id-" + this.examId]
// this.getUserExamInfo(); // this.getUserExamInfo();
}, },
methods: { methods: {
//申请考试获取userExamId //申请考试获取userExamId
getUserExamId: function () { getUserExamId: function () {
var that = this; let examId = this.examId;
console.log("这是一条消息"); wx.navigateTo({
url: "/pages/learn/answer?examId=" + examId,
});
},
getUserExamInfo() {
uni.request({ uni.request({
url: url:
"http://192.168.1.22" + process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam/serviceRule/" + "/wxh-worker-rest/rest/exam/serviceRule/" +
that.vuex_token + this.vuex_token +
"?examId=" + "?examId=" +
this.examId, this.examId,
method: "POST", method: "POST",
header: { header: {
"Content-Type": "application/x-www-from-urlencoded", "Content-Type": "application/x-www-from-urlencoded",
}, },
success: (res) => { success: (res) => {
console.log("标识符1", res.data); console.log("标识符1", res.data);
uni.hideLoading(); uni.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.userExamId) { if (res.data.data.userExamId) {
that.userExamId = res.data.data.userExamId; this.userExamId = res.data.data.userExamId;
console.log("这个是个标识符", that.userExamId); console.log("这个是个标识符", this.userExamId);
} }
} }
}, },
}); });
setTimeout(() => { setTimeout(() => {
wx.navigateTo({ wx.navigateTo({
url: "./answer?userExamId=" + that.userExamId, url: "/pages/learn/answer?userExamId=" + this.userExamId,
}); });
}, 1000); }, 1000);
}, },
}, },
}; };
......
<template>
<view class="content">
<u-navbar
back-icon-color="#FFFFFF"
:background="background"
title-color="#fff"
:border-bottom="false"
></u-navbar>
<view class="title">考试结果</view>
<view class="test">
<view class="result">
<view class="circle">{{ score }}</view>
</view>
<view class="test-explain">
<view class="text1">
您已成功通过本次考试
</view>
<view class="text2">
通过本科目后,可进行其他科目考试
</view>
</view>
<view class="btn">
<button class="btnStyle btn2" @click="toIndex()">我知道了</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
text: "",
examId: 2,
result: null,
is_pass: false,
score: 0,
userExamId: null,
};
},
onLoad(a) {
this.userExamId = a.userExamId;
console.log("userExamId是", this.userExamId);
this.nextClick();
},
// onUnload() {
// wx.reLaunch({
// url: "./index",
// });
// },
methods: {
//考试结果
nextClick: function () {
console.log("wwwwwwwwww");
uni.request({
url:
process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" +
this.vuex_token +
"?userExamId=" +
this.userExamId,
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
success: (res) => {
this.result = res.data.data;
this.text = res.data.data.examLevelResult;
this.score = this.result.examScore;
this.is_pass = this.result.result == '通过';
console.log("标识符55", this.result);
},
});
},
//再次考试
getAgain: function () {
wx.navigateTo({
url: "./assessment",
});
},
//下次再考跳转到学习主界面页面
toIndex: function () {
wx.reLaunch({
url: "/pages/index/learn?tabs=3",
});
// wx.navigateBack({ delta: 1 })//返回上一级页面
},
},
};
</script>
<style lang="scss">
.test {
margin: 0 30rpx;
overflow: hidden;
border-radius: 12rpx;
padding-bottom: 60rpx;
// background-image: url(../../static/photo/examination.png);
background-repeat: no-repeat;
background-size: 66%;
background-color: #fff;
background-position: right bottom;
min-height: 800rpx;
}
.content {
width: 750rpx;
height: 100vh;
overflow: auto;
background-color: #f4f5f7;
background-image: linear-gradient(to top, #f4f5f7 0%, #2272ff 50%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
.title {
padding: 30rpx 30rpx 46rpx;
line-height: 40rpx;
font-size: 40rpx;
color: #fff;
font-weight: bold;
}
.result {
width: 320rpx;
height: 320rpx;
margin-top: 80rpx;
margin-left: 186rpx;
// color: red;
// font-size: 66rpx;
// text-align: center;
// // border:
// border-bottom: 1px dashed #000000;
// margin: 74rpx 0;
// padding: 66rpx;
background-image: linear-gradient(#47ABFF, #2272FF) ;
border-radius:50%;
text-align:center;
padding:10rpx;
font-size:28rpx;
box-sizing:border-box;
}
.result .circle{
width:100%;
height:100%;
background:#fff;
border-radius:50%;
font-size: 120rpx;
color: #2272FF;
text-align: center;
padding-top: 20%;
}
.test-explain {
margin-top: 80rpx;
margin-left: 84rpx;
margin-right: 84rpx;
text-align: center;
.text1 {
font-size: 40rpx;
font-weight: bold;
color: #2272FF;
}
.text2 {
font-size: 24rpx;
color: #666666;
margin-top: 30rpx;
}
}
.btn {
margin-top: 100rpx;
display: flex;
font-size: 32rpx;
font-weight: bold;
.btnStyle {
width: 600rpx;
height: 104rpx;
background-color: #ffffff;
color: #2272FF;
line-height: 90rpx;
margin: 20rpx auto;
border: 2rpx solid #2272FF;
border-radius: 52rpx;
}
.btn2 {
background-color: #2272FF;
color: #ffffff;
}
}
}
</style>
This diff is collapsed.
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
<view> <view>
<view class="title"> <view class="title">
{{newsInfo.title}} {{newsInfo.title}}
</view> </view>
<view class="content" v-html="newsInfo.body"> <view class="u-content">
<button @click="add">aaa</button> <u-parse :html="newsInfo.body" :tag-style="style"></u-parse>
{{newsInfo.body}} </view>
</view>
</view> </view>
</template> </template>
...@@ -18,7 +17,10 @@ ...@@ -18,7 +17,10 @@
obj:{ obj:{
}, },
newsInfo:null newsInfo: {
title: '',
body: ''
}
} }
}, },
methods: { methods: {
...@@ -28,11 +30,10 @@ ...@@ -28,11 +30,10 @@
}, },
onShow(){ onShow(){
uni.$on('news',(news)=>{ uni.$on('news',(news)=>{
this.newsInfo = news; this.newsInfo = news;
console.log(news,'news') console.log(news,'news')
}) })
}, },
onLoad() { onLoad() {
this.$u.mpShare.path = '' this.$u.mpShare.path = ''
...@@ -41,11 +42,17 @@ ...@@ -41,11 +42,17 @@
</script> </script>
<style> <style>
.title{ .title{
text-align: center; font-size: 32rpx;
margin: 34rpx; font-weight: bold;
margin-left: 30rpx;
margin-top: 30rpx;
} }
.content{ .content{
padding: 38rpx; font-size: 24rpx;
line-height: 36rpx;
color: #666666;
margin-left: 30rpx;
margin-top: 30rpx;
} }
</style> </style>
<template> <template>
<view class="test-result"> <view class="content">
<text class="title">考试结果</text> <u-navbar
<view class="result"> {{ text }} </view> back-icon-color="#FFFFFF"
<view class="test-explain"> :background="background"
<view class="hang"> title-color="#fff"
<text class="text1">合格条件:</text :border-bottom="false"
><text class="text2">答对20题</text> ></u-navbar>
<!-- <u-navbar style="position: absolute;" background="{background: transparent}" :border-bottom="false"
back-icon-color="#ffffff" title-color="#ffffff"></u-navbar> -->
<view class="title">考试成绩</view>
<view class="test">
<view class="result">
<view class="circle">{{ score }}</view>
</view> </view>
<view class="hang"> <view class="test-explain">
<text class="text1">考试结果:</text <view class="text1">
><text class="text2">答对10题</text> 很遗憾,您未能通过本次考试
</view>
<view class="text2">
您可点击再考一次重新进行考试
</view>
</view> </view>
<view class="hang"> <view class="btn">
<text class="text1">考试用时:</text <button class="btnStyle" @click="getAgain()">再答一次</button>
><text class="text2">16分29秒</text> <button class="btnStyle btn2" @click="toIndex()">我知道了</button>
</view> </view>
</view> </view>
<view class="btn">
<button class="btn1" @click="getAgain()">再答一次</button>
<button class="btn2" @click="toIndex">下次再考</button>
</view>
</view> </view>
</template> </template>
...@@ -30,6 +38,7 @@ export default { ...@@ -30,6 +38,7 @@ export default {
text: "", text: "",
examId: 2, examId: 2,
result: null, result: null,
score: 0,
userExamId: null, userExamId: null,
}; };
}, },
...@@ -38,18 +47,18 @@ export default { ...@@ -38,18 +47,18 @@ export default {
console.log("userExamId是", this.userExamId); console.log("userExamId是", this.userExamId);
this.nextClick(); this.nextClick();
}, },
onUnload() { // onUnload() {
wx.reLaunch({ // wx.reLaunch({
url: "./index", // url: "./index",
}); // });
}, // },
methods: { methods: {
//考试结果 //考试结果
nextClick: function () { nextClick: function () {
console.log("wwwwwwwwww"); console.log("wwwwwwwwww");
uni.request({ uni.request({
url: url:
"http://192.168.1.22" + process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam" + "/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" + "/serviceRule/next/" +
this.vuex_token + this.vuex_token +
...@@ -63,73 +72,127 @@ export default { ...@@ -63,73 +72,127 @@ export default {
success: (res) => { success: (res) => {
this.result = res.data.data; this.result = res.data.data;
this.text = res.data.data.examLevelResult; this.text = res.data.data.examLevelResult;
this.score = this.result.examScore;
console.log("标识符55", this.result); console.log("标识符55", this.result);
}, },
}); });
}, },
//再次考试 //再次考试
getAgain: function () { getAgain: function () {
let examId = this.examId;
wx.navigateTo({ wx.navigateTo({
url: "./assessment", url: "/pages/learn/assessment?examId=" + examId,
}); });
}, },
//下次再考跳转到学习主界面页面 //下次再考跳转到学习主界面页面
toIndex: function () { toIndex: function () {
wx.reLaunch({ wx.reLaunch({
url: "./index", url: "/pages/index/learn?tabs=3",
}); });
// wx.navigateBack({ delta: 1 })//返回上一级页面
}, },
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.test-result { .test {
width: 610rpx; margin: 0 30rpx;
height: 965rpx; overflow: hidden;
margin: 70rpx auto 0; border-radius: 12rpx;
padding-bottom: 60rpx;
// background-image: url(../../static/photo/examination.png);
background-repeat: no-repeat;
background-size: 66%;
background-color: #fff;
background-position: right bottom;
min-height: 800rpx;
}
.content {
width: 750rpx;
height: 100vh;
overflow: auto;
background-color: #f4f5f7;
background-image: linear-gradient(to top, #f4f5f7 0%, #2272ff 50%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
.title { .title {
margin: 0 44rpx 0; padding: 30rpx 30rpx 46rpx;
line-height: 40rpx;
font-size: 40rpx;
color: #fff;
font-weight: bold;
} }
.result { .result {
color: red; width: 320rpx;
font-size: 66rpx; height: 320rpx;
text-align: center; margin-top: 80rpx;
border-bottom: 1px dashed #000000; margin-left: 186rpx;
margin: 74rpx 0; // color: red;
padding: 66rpx; // font-size: 66rpx;
// text-align: center;
// // border:
// border-bottom: 1px dashed #000000;
// margin: 74rpx 0;
// padding: 66rpx;
background-image: linear-gradient(#FF930D, #FA5A49) ;
border-radius:50%;
text-align:center;
padding:10rpx;
font-size:28rpx;
box-sizing:border-box;
}
.result .circle{
width:100%;
height:100%;
background:#fff;
border-radius:50%;
font-size: 120rpx;
color: #FA5A49;
text-align: center;
padding-top: 20%;
} }
.test-explain { .test-explain {
.hang { margin-top: 80rpx;
margin: 26rpx 26rpx; margin-left: 84rpx;
.text1 { margin-right: 84rpx;
color: #a69999; text-align: center;
margin-right: 22rpx; .text1 {
} font-size: 40rpx;
.text2 { font-weight: bold;
color: #333333; color: #FA5A49;
} }
.text2 {
font-size: 24rpx;
color: #666666;
margin-top: 30rpx;
} }
} }
.btn { .btn {
margin-top: 236rpx; margin-top: 100rpx;
.btn1 { display: flex;
width: 478rpx; font-size: 32rpx;
height: 60rpx; font-weight: bold;
background: #0079fe; .btnStyle {
color: #fff; width: 300rpx;
font-size: 26rpx; height: 104rpx;
line-height: 60rpx; background-color: #ffffff;
color: #2272FF;
line-height: 90rpx;
margin: 20rpx auto; margin: 20rpx auto;
border: 2rpx solid #2272FF;
border-radius: 52rpx;
} }
.btn2 { .btn2 {
width: 478rpx; background-color: #2272FF;
height: 60rpx; color: #ffffff;
background: #f2f2f2;
color: #333333;
font-size: 26rpx;
line-height: 60rpx;
margin: 0 auto;
} }
} }
} }
......
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
<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">5课时</text> <text class="item-st-text">{{ courseTotal }}课时</text>
</view> </view>
<view class="item-title">服务规范</view> <view class="item-title">{{ courseTitle }}</view>
</view> </view>
<view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view> <view>{{ courseDesc }}</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 color-teacher">课程讲师</view>
<view class="" style="padding-top: 30rpx;display: flex;padding-left: 30rpx;"> <view class="" style="padding-top: 30rpx;display: flex;padding-left: 30rpx;">
<u-avatar :style="{'width':'100rpx', 'height':'100rpx'}" :src="teacher.avatar" mode="circle"></u-avatar> <u-avatar :style="{'width':'100rpx', 'height':'100rpx'}" :src="teacherImage" mode="circle"></u-avatar>
<view style="height:120rpx;font-size: 30rpx;padding-left:30rpx;"> <view style="height:120rpx;font-size: 30rpx;padding-left:30rpx;">
<view class="" style="display: flex;font-size: 32rpx;"> <view class="" style="display: flex;font-size: 32rpx;">
<view class="" style="font-size: 32rpx;font-weight: bold;">{{ teacher.name }}</view> <view class="" style="font-size: 32rpx;font-weight: bold;">{{ teacher.name }}</view>
<view class="" style="font-size: 24rpx;margin-left: 30rpx;margin-top: 6rpx;">课程讲师</view> <view class="" style="font-size: 24rpx;margin-left: 30rpx;margin-top: 6rpx;color: #999999;">课程讲师</view>
</view> </view>
<view class="" style="font-size: 24rpx;margin-top: 30rpx;">反正这里就是放老师的简介,只是写啥我也不知道,反正就是写很厉害的简介啦</view> <view class="" style="font-size: 24rpx;margin-top: 30rpx;">反正这里就是放老师的简介,只是写啥我也不知道,反正就是写很厉害的简介啦</view>
</view> </view>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view class="learn-view-title">目录</view> <view class="learn-view-title">目录</view>
<view class="" style="display: flex;overflow: auto;padding-top: 30rpx;padding-bottom: 30rpx;"> <view class="" style="display: flex;overflow: auto;padding-top: 30rpx;padding-bottom: 30rpx;">
<view v-for="(item, index) in list" :key="index"> <view v-for="(item, index) in list" :key="index">
<view @click="goNext(item.id)" class="list-cell list-default" :class="{'list-default-active': item.isActive}" style="width:280rpx;height:150rpx;margin-left: 20rpx;padding: 20rpx;border-radius: 12rpx;"> <view @click="goNext(item)" class="list-cell list-default" :class="{'list-default-active': item.isActive}" style="width:280rpx;height:150rpx;margin-left: 20rpx;padding: 20rpx;border-radius: 12rpx;">
<view class="" style="font-size: 24rpx;">{{ item.title }}</view> <view class="" style="font-size: 24rpx;">{{ item.title }}</view>
<view class="" style="font-size: 26rpx;margin-top: 16rpx;"> <view class="" style="font-size: 26rpx;margin-top: 16rpx;">
{{ item.intro }} {{ item.intro }}
...@@ -59,21 +59,24 @@ ...@@ -59,21 +59,24 @@
export default { export default {
data() { data() {
return { return {
teacherImage: process.uniEnv.qn_base_url + "avatar.gif",
courseId: "", courseId: "",
courseStatus: 0, courseStatus: 0,
courseSrc: "", courseSrc: "",
courseTitle: "", courseTitle: "",
courseDesc: "", courseDesc: "",
courseTotal: null,
currentIndex: -1, // 第几个视频 currentIndex: -1, // 第几个视频
section_id: 0, section_id: 0,
active_section_id: 0,
isShowVideo: false, isShowVideo: false,
CourseSectionlist: {name: '', content: ''}, //节信息 CourseSectionlist: {name: '', content: ''}, //节信息
list: [ list: [
{'title': '第一节', 'intro': '考核规则1:接单及 时率', 'isActive': true, "id": 288}, {'title': '第1节', 'intro': '考核规则1:接单及 时率', 'isActive': true, "id": null},
{'title': '第二节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288}, {'title': '第2节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第三节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288}, {'title': '第3节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第四节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288}, {'title': '第4节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第五节', 'intro': '考核规则1:接单及 时率', 'isActive':false, "id": 288}, {'title': '第5节', 'intro': '考核规则1:接单及 时率', 'isActive':false, "id": null},
], ],
teacher: { teacher: {
name: "", name: "",
...@@ -97,7 +100,7 @@ ...@@ -97,7 +100,7 @@
} }
}, },
params:{ params:{
course_id:173, course_id:null,
}, },
gklog: '', gklog: '',
videoTotalTime: 0, videoTotalTime: 0,
...@@ -137,6 +140,8 @@ ...@@ -137,6 +140,8 @@
}, },
}, },
onLoad(e) { onLoad(e) {
this.active_section_id = e.section_id;
this.params.course_id = e.course_id;
this.getCourseSection({ this.getCourseSection({
section_id: e.section_id section_id: e.section_id
}) })
...@@ -148,9 +153,9 @@ ...@@ -148,9 +153,9 @@
// #endif // #endif
}, },
methods: { methods: {
goNext(id){ goNext(info){
uni.navigateTo({ uni.navigateTo({
url: "./section?section_id=" + id, url: "./section?section_id=" + info.id + "&course_id=" + info.course_id
}); });
}, },
onPlayerTimeupdate(player) { onPlayerTimeupdate(player) {
...@@ -197,7 +202,7 @@ ...@@ -197,7 +202,7 @@
let wareVal = this.CourseSectionlist.ware; let wareVal = this.CourseSectionlist.ware;
this.isShowVideo = wareVal == "0"; this.isShowVideo = wareVal == "0";
this.courseTitle = res.data.name; this.courseTitle = res.data.name;
this.courseDesc = res.data.content; this.courseDesc = res.data.content.replace(/<p.*?>|<\/p>/ig, "");
this.section_id = res.data.id; this.section_id = res.data.id;
this.section_content = res.data.content; this.section_content = res.data.content;
this.teacher.name = res.data.teachers[0].name; this.teacher.name = res.data.teachers[0].name;
...@@ -277,9 +282,16 @@ ...@@ -277,9 +282,16 @@
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data) { if (res.data) {
// debugger this.list = res.data[0].section;
// this.list = this.list.concat(res.data); this.courseTotal = this.list.length;
// console.log(this.list) let length = this.list.length;
for(let i = 0; i < length; i++){
this.list[i].title = "第" + (i + 1) + "节";
this.list[i].intro = this.list[i].name;
this.list[i].isActive = this.active_section_id == this.list[i].id ? true : false;
}
console.log('--select-list--')
console.log(this.list)
} }
} else { } else {
//接口请求失败的处理 //接口请求失败的处理
...@@ -443,4 +455,8 @@ ...@@ -443,4 +455,8 @@
border: 2rpx solid #2272FF; border: 2rpx solid #2272FF;
box-sizing: border-box; box-sizing: border-box;
} }
.color-teacher {
color: #999999;
}
</style> </style>
src/static/photo/jianbian@3x.png

21.9 KB | W: | H:

src/static/photo/jianbian@3x.png

7.64 KB | W: | H:

src/static/photo/jianbian@3x.png
src/static/photo/jianbian@3x.png
src/static/photo/jianbian@3x.png
src/static/photo/jianbian@3x.png
  • 2-up
  • Swipe
  • Onion skin
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