Commit 10cc678c authored by 林文清's avatar 林文清

update:学习模块

parent d22a0f28
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
"path": "pages/index/learn", "path": "pages/index/learn",
"style": { "style": {
"navigationBarTitleText": "学习", "navigationBarTitleText": "学习",
"navigationStyle":"custom"//隐藏系统导航栏 "navigationStyle":"custom",//隐藏系统导航栏
"disableScroll": true
} }
}, },
{ {
...@@ -89,13 +90,15 @@ ...@@ -89,13 +90,15 @@
{ {
"path": "news-details", "path": "news-details",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": "",
"navigationStyle":"default"
} }
}, },
{ {
"path":"section", "path":"section",
"style" :{ "style" :{
"navigationBarTitleText": "" "navigationBarTitleText": "",
"navigationStyle":"default"
} }
}, },
{ {
......
...@@ -4,15 +4,13 @@ ...@@ -4,15 +4,13 @@
<text class="title-view">学习</text> <text class="title-view">学习</text>
</u-navbar> </u-navbar>
<image :src="bannerImage" mode="" class="banner"></image> <image :src="bannerImage" mode="" class="banner"></image>
<view> <u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs"
<u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs"
:current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper> :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view> <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"
style="height: 100%;padding-top: 30rpx;">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<scroll-view scroll-y style="height:796rpx;width:100%;" @scrolltolower="onreachBottom"> <scroll-view scroll-y style="height:796rpx;width:100%;">
<view class="jf-currency-class"> <view class="jf-currency-class">
<image :src="jianBianImg" mode="" class="current-img"></image>
<view class="class1" style="position: relative;" @click="goToPrint"> <view class="class1" style="position: relative;" @click="goToPrint">
<image class="jf-img" :src="rule.pic" mode=""></image> <image class="jf-img" :src="rule.pic" mode=""></image>
<view class="right u-padding-top-10 u-padding-bottom-14 jf-right"> <view class="right u-padding-top-10 u-padding-bottom-14 jf-right">
...@@ -33,7 +31,7 @@ ...@@ -33,7 +31,7 @@
<view class="news" v-html="item.body"> <view class="news" v-html="item.body">
<u-parse :html="item.body"></u-parse> <u-parse :html="item.body"></u-parse>
</view> </view>
<u-line color="#F4F5F7" class="content-line" /> <u-line color="#F4F5F7" />
<view class="notice-bottom"> <view class="notice-bottom">
<view class="notice-bottom-left">{{ item.create_at }}</view> <view class="notice-bottom-left">{{ item.create_at }}</view>
<view class="notice-bottom-right">查看详情</view> <view class="notice-bottom-right">查看详情</view>
...@@ -44,13 +42,13 @@ ...@@ -44,13 +42,13 @@
</view> </view>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
<swiper-item class="swiper-item"> <swiper-item class="swiper-item" style="margin-top: 20rpx;">
<scroll-view scroll-y style="height:100%;width:100%;"> <scroll-view scroll-y style="height:100%;width:100%;">
<view class="lean"> <view class="lean">
<view class="top"> <view class="top">
<view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view> <view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view>
<view class="learn-currency-class"> <view class="learn-currency-class">
<view class="learn-class1" @click=goPlay(courselist[0])> <view class="learn-class1" @click="goPlay(courselist[0])">
<image class="learn-img" :src="courselist[0].pic" mode=""></image> <image class="learn-img" :src="courselist[0].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image> <image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc"> <view class="learn-desc">
...@@ -70,15 +68,15 @@ ...@@ -70,15 +68,15 @@
v-text="courselist[0].status"></text> v-text="courselist[0].status"></text>
</view> </view>
</view> </view>
<view class="learn-class1 u-margin-left-30" @click=goPlay(courselist[1])> <view class="learn-class1 u-margin-left-30" @click="goPlay(courselist[1])">
<image class="learn-img" :src="courselist[1].pic" mode=""></image> <image class="learn-img" :src="courselist[1].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image> <image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc"> <view class="learn-desc">
<view class="u-font-28 font-bold h68"> <view class="u-font-28 font-bold h68">
{{ courselist[1].title }} {{ courselist[1].title }}
</view> </view>
<view class="u-font-20 learn-intro h48"> <view class="u-font-20 learn-intro h48">
{{ courselist[1].desc }} {{ courselist[1].desc }}
</view> </view>
</view> </view>
<view class="line-percent u-margin-top-35"> <view class="line-percent u-margin-top-35">
...@@ -93,7 +91,7 @@ ...@@ -93,7 +91,7 @@
</view> </view>
<view class="title u-margin-top-50 u-margin-bottom-30">技能课程</view> <view class="title u-margin-top-50 u-margin-bottom-30">技能课程</view>
<view class="learn-currency-class u-margin-bottom-20"> <view class="learn-currency-class u-margin-bottom-20">
<view class="learn-class1" @click=goPlay(courselist[2])> <view class="learn-class1" @click="goPlay(courselist[2])">
<image class="learn-img" :src="courselist[2].pic" mode=""></image> <image class="learn-img" :src="courselist[2].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image> <image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc"> <view class="learn-desc">
...@@ -104,7 +102,8 @@ ...@@ -104,7 +102,8 @@
{{ courselist[2].desc }} {{ courselist[2].desc }}
</view> </view>
</view> </view>
<view class="line-percent u-margin-top-35" style="display:flex;justify-content: space-between;"> <view class="line-percent u-margin-top-35"
style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="courselist[2].percent" <u-line-progress active-color="#2979ff" :percent="courselist[2].percent"
:show-percent="false"> :show-percent="false">
</u-line-progress> </u-line-progress>
...@@ -119,7 +118,7 @@ ...@@ -119,7 +118,7 @@
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
<swiper-item> <swiper-item>
<scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom"> <scroll-view scroll-y style="height:100%;width:100%;">
<view class="lean"> <view class="lean">
<view class="top"> <view class="top">
<view class="title u-margin-top-10 u-margin-bottom-30">通用认证</view> <view class="title u-margin-top-10 u-margin-bottom-30">通用认证</view>
...@@ -191,8 +190,7 @@ ...@@ -191,8 +190,7 @@
<script> <script>
import util from '@/utils/util.js' import util from '@/utils/util.js'
var json = { var json = {
"dev": [ "dev": [{
{
"title": "服务规范", "title": "服务规范",
"desc": "为用户提供更好服务,自己赚更多钱", "desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0, "percent": 0,
...@@ -217,8 +215,7 @@ ...@@ -217,8 +215,7 @@
"sectionId": "" "sectionId": ""
} }
], ],
"test": [ "test": [{
{
"title": "服务规范", "title": "服务规范",
"desc": "为用户提供更好服务,自己赚更多钱", "desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0, "percent": 0,
...@@ -243,8 +240,7 @@ ...@@ -243,8 +240,7 @@
"sectionId": "" "sectionId": ""
} }
], ],
"prod": [ "prod": [{
{
"title": "服务规范", "title": "服务规范",
"desc": "为用户提供更好服务,自己赚更多钱", "desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0, "percent": 0,
...@@ -267,10 +263,9 @@ ...@@ -267,10 +263,9 @@
} }
] ]
} }
var examJson = { var examJson = {
"dev": [ "dev": [{
{
title: '服务规范', title: '服务规范',
desc: '通过本认证,是接单的必要条件', desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题', condition: '随机20题,及格20题',
...@@ -293,8 +288,7 @@ ...@@ -293,8 +288,7 @@
isComplete: false isComplete: false
} }
], ],
"test": [ "test": [{
{
title: '服务规范', title: '服务规范',
desc: '通过本认证,是接单的必要条件', desc: '通过本认证,是接单的必要条件',
condition: '随机10题,及格10题', condition: '随机10题,及格10题',
...@@ -317,8 +311,7 @@ ...@@ -317,8 +311,7 @@
isComplete: false isComplete: false
} }
], ],
"prod": [ "prod": [{
{
title: '服务规范', title: '服务规范',
desc: '通过本认证,是接单的必要条件', desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题', condition: '随机20题,及格20题',
...@@ -344,7 +337,7 @@ ...@@ -344,7 +337,7 @@
} }
// import aJson from "@/static/json/learn.json"; // import aJson from "@/static/json/learn.json";
let env = process.uniEnv.node_env; let env = process.uniEnv.node_env;
let courseListJson = json.[env]; let courseListJson = json. [env];
let examListJson = examJson[env]; let examListJson = examJson[env];
export default { export default {
...@@ -440,17 +433,19 @@ ...@@ -440,17 +433,19 @@
loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式 loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore: false, //是否加载中 isLoadMore: false, //是否加载中
exam: null, exam: null,
jianBianImg: process.uniEnv.qn_base_url + "jianbian@3x_bak1.png"
}; };
}, },
onLoad(param) { onLoad(param) {
// debugger
console.log('--node_env--'); console.log('--node_env--');
console.log(process.uniEnv.node_env); console.log(process.uniEnv.node_env);
try{ try {
if(param.tabs){ if (param.tabs) {
this.current = param.tabs; this.current = param.tabs;
this.swiperCurrent = param.tabs; this.swiperCurrent = param.tabs;
} }
}catch(e){} } catch (e) {}
// this.getList(); // this.getList();
// this.getCourseList(); // this.getCourseList();
// this.getUserExamInfo(); // this.getUserExamInfo();
...@@ -461,6 +456,7 @@ ...@@ -461,6 +456,7 @@
}, },
}, },
onShow: function() { onShow: function() {
// debugger
// this.onLoad(); // this.onLoad();
console.log('--返回也可以执行--'); console.log('--返回也可以执行--');
}, },
...@@ -473,8 +469,9 @@ ...@@ -473,8 +469,9 @@
if (res.code == 200) { if (res.code == 200) {
if (res.data) { if (res.data) {
let length = res.data.length; let length = res.data.length;
for(let i = 0;i<length;i++){ for (let i = 0; i < length; i++) {
res.data[i].create_at = this.timeFormat(res.data[i].create_at, 'yyyy.MM.dd hh:mm'); res.data[i].create_at = this.timeFormat(res.data[i].create_at,
'yyyy.MM.dd hh:mm');
} }
this.list = this.list.concat(res.data); this.list = this.list.concat(res.data);
...@@ -514,25 +511,25 @@ ...@@ -514,25 +511,25 @@
}, },
timeFormat(time, format, fromMysql = true) { timeFormat(time, format, fromMysql = true) {
let rate = fromMysql ? 1000 : 1; let rate = fromMysql ? 1000 : 1;
let dataFmt = format || 'yyyy-MM-dd hh:mm:ss' // 需要格式化的规则 let dataFmt = format || 'yyyy-MM-dd hh:mm:ss' // 需要格式化的规则
time = typeof(time) == 'number' ? time : new Date(time * rate) // 处理传入的time time = typeof(time) == 'number' ? time : new Date(time * rate) // 处理传入的time
let fmt = { let fmt = {
'y+': time.getFullYear(), // 年份 'y+': time.getFullYear(), // 年份
'M+': time.getMonth() + 1, // 月份 'M+': time.getMonth() + 1, // 月份
'd+': time.getDate(), // 日 'd+': time.getDate(), // 日
'h+': time.getHours(), // 小时 'h+': time.getHours(), // 小时
'm+': time.getMinutes(), // 分钟 'm+': time.getMinutes(), // 分钟
's+': time.getSeconds() // 秒 's+': time.getSeconds() // 秒
} }
for(let i in fmt){ for (let i in fmt) {
if (new RegExp('(' + i + ')').test(dataFmt)){ if (new RegExp('(' + i + ')').test(dataFmt)) {
dataFmt = dataFmt .replace(RegExp.$1, fmt[i].toString().length <= 1 ? '0' + fmt[i] : fmt[i] ) dataFmt = dataFmt.replace(RegExp.$1, fmt[i].toString().length <= 1 ? '0' + fmt[i] : fmt[i])
} }
} }
return dataFmt; return dataFmt;
}, },
getTypeName(percent) { getTypeName(percent) {
if (percent == 0) { if (percent == 0) {
...@@ -641,7 +638,7 @@ ...@@ -641,7 +638,7 @@
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.examList[i].examId = res.data.id; this.examList[i].examId = res.data.id;
this.examList[i].examStatus = res.data.examStatus;//i;// this.examList[i].examStatus = res.data.examStatus; //i;//
let examResult = res.data.examLevelResult; let examResult = res.data.examLevelResult;
this.examList[i].status = examResult != '' ? examResult : '未通过'; this.examList[i].status = examResult != '' ? examResult : '未通过';
// examStatus 用户考试状态 0考试中 1考试完成 2未参与 // examStatus 用户考试状态 0考试中 1考试完成 2未参与
...@@ -687,21 +684,21 @@ ...@@ -687,21 +684,21 @@
var examInfo = this.examList[index]; var examInfo = this.examList[index];
if (examInfo.examStatus == 0) { if (examInfo.examStatus == 0) {
console.log("这是试卷id", examInfo.id); console.log("这是试卷id", examInfo.id);
wx.navigateTo({ wx.navigateTo({
url: "/pages/learn/answer?examId=" + examInfo.id, url: "/pages/learn/answer?examId=" + examInfo.id,
}); });
} else if (examInfo.examStatus == 1) { } else if (examInfo.examStatus == 1) {
// debugger;return; // debugger;return;
// examInfo.status = '通过'; // examInfo.status = '通过';
if(examInfo.status == '通过'){ if (examInfo.status == '通过') {
wx.navigateTo({ wx.navigateTo({
url: "/pages/learn/exam-pass?userExamId=" + examInfo.examId, url: "/pages/learn/exam-pass?userExamId=" + examInfo.examId,
}); });
}else{ } else {
wx.navigateTo({ wx.navigateTo({
url: "/pages/learn/result?userExamId=" + examInfo.examId + "&examId=" + examInfo.id, url: "/pages/learn/result?userExamId=" + examInfo.examId + "&examId=" + examInfo.id,
}); });
} }
} else if (examInfo.examStatus == 2) { } else if (examInfo.examStatus == 2) {
wx.navigateTo({ wx.navigateTo({
...@@ -719,19 +716,16 @@ ...@@ -719,19 +716,16 @@
bbb(e) { bbb(e) {
var news = { var news = {
body: e.body, body: e.body,
id: e.id, title: e.title
level: e.level,
title: e.title,
}; };
// console.log(news) wx.navigateTo({
setTimeout(() => { url: '/pages/learn/news-details',
uni.$emit("news", news); success: function(res) {
console.log("发送数据"); // 通过eventChannel向被打开页面传送数据
}, 1000); res.eventChannel.emit('acceptDataFromLearn', news)
uni.navigateTo({ }
url: "/pages/learn/news-details",
}); });
console.log("跳转结束11111111"); console.log("跳转结束11111111");
}, },
}, },
...@@ -798,6 +792,7 @@ ...@@ -798,6 +792,7 @@
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
line-height: 34rpx; line-height: 34rpx;
margin-bottom: 20rpx;
} }
/* //在线学习 */ /* //在线学习 */
...@@ -809,7 +804,7 @@ ...@@ -809,7 +804,7 @@
/* margin-bottom: 11px; */ /* margin-bottom: 11px; */
border-radius: 12rpx; border-radius: 12rpx;
} }
.learn-currency-class { .learn-currency-class {
width: 100%; width: 100%;
border-radius: 12rpx; border-radius: 12rpx;
...@@ -819,10 +814,9 @@ ...@@ -819,10 +814,9 @@
.jf-currency-class { .jf-currency-class {
width: 100%; width: 100%;
height: 180rpx; height: 180rpx;
background: #ffffff; position: absolute;
border-radius: 12rpx; border-radius: 12rpx;
margin-top: 60rpx; margin-top: 60rpx;
background: #f4f5f7 url(/static/photo/jianbian@3x.png) no-repeat;
} }
.title { .title {
...@@ -839,7 +833,7 @@ ...@@ -839,7 +833,7 @@
-webkit-justify-content: space-between; -webkit-justify-content: space-between;
justify-content: space-between; justify-content: space-between;
} }
.learn-class1 { .learn-class1 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
...@@ -858,12 +852,12 @@ ...@@ -858,12 +852,12 @@
width: 160rpx; width: 160rpx;
height: 120rpx; height: 120rpx;
} }
.learn-img { .learn-img {
width: 330rpx; width: 330rpx;
height: 194rpx; height: 194rpx;
} }
.jf-img { .jf-img {
width: 160rpx; width: 160rpx;
height: 200rpx; height: 200rpx;
...@@ -914,7 +908,7 @@ ...@@ -914,7 +908,7 @@
margin: 20rpx; margin: 20rpx;
margin-top: 25rpx; margin-top: 25rpx;
} }
.jf-line { .jf-line {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -955,10 +949,6 @@ ...@@ -955,10 +949,6 @@
color: #999999; color: #999999;
} }
.content-line {
margin-top: 30rpx;
}
.standard {} .standard {}
.standard-img { .standard-img {
...@@ -976,30 +966,30 @@ ...@@ -976,30 +966,30 @@
font-weight: bold; font-weight: bold;
} }
.jf-right { .jf-right {
padding-left: 190rpx; padding-left: 190rpx;
width: 460rpx; width: 460rpx;
color: #ffffff; color: #ffffff;
} }
.notice-bottom { .notice-bottom {
margin-top: 30rpx; margin-top: 20rpx;
display: flex; display: flex;
} }
.notice-bottom-left { .notice-bottom-left {
/* margin-left: 30rpx; */ /* margin-left: 30rpx; */
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
.notice-bottom-right { .notice-bottom-right {
margin-left: 330rpx; margin-left: 330rpx;
font-size: 24rpx; font-size: 24rpx;
color: #2272FF; color: #2272FF;
} }
.bofang { .bofang {
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
...@@ -1007,7 +997,7 @@ ...@@ -1007,7 +997,7 @@
left: 130rpx; left: 130rpx;
top: 70rpx; top: 70rpx;
} }
.learn-desc { .learn-desc {
height: 138rpx; height: 138rpx;
margin-top: -10rpx; margin-top: -10rpx;
...@@ -1015,16 +1005,24 @@ ...@@ -1015,16 +1005,24 @@
padding-left: 20rpx; padding-left: 20rpx;
padding-right: 20rpx; padding-right: 20rpx;
} }
.learn-intro { .learn-intro {
color: #999999; color: #999999;
margin-top: 20rpx; margin-top: 20rpx;
font-size: 20rpx; font-size: 20rpx;
} }
.h68 { .h68 {
// height: 68rpx; // height: 68rpx;
} }
.h48 {
height: 48rpx;
}
.h48 {height: 48rpx;} .current-img {
width: 100%;
height: 100%;
position: absolute;
}
</style> </style>
<template> <template>
<view> <view>
<view class="title"> <view class="title">
{{newsInfo.title}} {{ title }}
</view> </view>
<view class="u-content"> <view class="u-content">
<u-parse :html="newsInfo.body" :tag-style="style"></u-parse> <u-parse :html="body" :tag-style="style"></u-parse>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
banner:{}, title: '',
obj:{ body: ''
}
}, },
newsInfo: { onLoad() {
title: '', var that = this;
body: '' const eventChannel = this.getOpenerEventChannel()
} eventChannel.on('acceptDataFromLearn', function(data) {
} that.title = data.title;
}, that.body = data.body;
methods: { })
this.$u.mpShare.path = ''
}, },
onLoad() { }
},
onShow(){
uni.$on('news',(news)=>{
this.newsInfo = news;
console.log(news,'news')
})
},
onLoad() {
this.$u.mpShare.path = ''
},
}
</script> </script>
<style> <style>
.title{ .title{
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
margin-left: 30rpx; margin-left: 30rpx;
margin-top: 30rpx; margin-top: 30rpx;
} }
.content{ .u-content{
font-size: 24rpx; font-size: 24rpx;
line-height: 36rpx; line-height: 36rpx;
color: #666666; color: #666666;
margin-left: 30rpx; margin-left: 30rpx;
margin-top: 30rpx; margin-top: 30rpx;
} }
</style> </style>
...@@ -18,23 +18,28 @@ ...@@ -18,23 +18,28 @@
<view class="learn-view" v-if="courseId >= 0"> <view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title color-teacher">课程讲师</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="teacherImage" 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;color: #999999;">课程讲师</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;">{{ teacherIntro }}</view> <view class="" style="font-size: 24rpx;margin-top: 30rpx;">{{ teacherIntro }}</view>
</view> </view>
</view> </view>
<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="catalogue">
<view v-for="(item, index) in list" :key="index"> <view v-for="(item, index) in list" :key="index">
<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 @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 }}
</view> </view>
</view> </view>
</view> </view>
...@@ -70,14 +75,41 @@ ...@@ -70,14 +75,41 @@
section_id: 0, section_id: 0,
active_section_id: 0, active_section_id: 0,
isShowVideo: false, isShowVideo: false,
CourseSectionlist: {name: '', content: ''}, //节信息 CourseSectionlist: {
list: [ name: '',
{'title': '第1节', 'intro': '考核规则1:接单及 时率', 'isActive': true, "id": null}, content: ''
{'title': '第2节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null}, }, //节信息
{'title': '第3节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null}, list: [{
{'title': '第4节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null}, 'title': '第1节',
{'title': '第5节', 'intro': '考核规则1:接单及 时率', 'isActive':false, "id": null}, 'intro': '考核规则1:接单及 时率',
], 'isActive': true,
"id": null
},
{
'title': '第2节',
'intro': '考核规则1:接单及 时率',
'isActive': false,
"id": null
},
{
'title': '第3节',
'intro': '考核规则1:接单及 时率',
'isActive': false,
"id": null
},
{
'title': '第4节',
'intro': '考核规则1:接单及 时率',
'isActive': false,
"id": null
},
{
'title': '第5节',
'intro': '考核规则1:接单及 时率',
'isActive': false,
"id": null
},
],
teacher: { teacher: {
name: "", name: "",
avatar: "" avatar: ""
...@@ -100,8 +132,8 @@ ...@@ -100,8 +132,8 @@
fullscreenToggle: true //全屏按钮 fullscreenToggle: true //全屏按钮
} }
}, },
params:{ params: {
course_id:null, course_id: null,
}, },
gklog: '', gklog: '',
videoTotalTime: 0, videoTotalTime: 0,
...@@ -154,7 +186,7 @@ ...@@ -154,7 +186,7 @@
// #endif // #endif
}, },
methods: { methods: {
goNext(info){ goNext(info) {
uni.navigateTo({ uni.navigateTo({
url: "./section?section_id=" + info.id + "&course_id=" + info.course_id url: "./section?section_id=" + info.id + "&course_id=" + info.course_id
}); });
...@@ -215,7 +247,7 @@ ...@@ -215,7 +247,7 @@
this.courseSrc = coureWareList[0].src; this.courseSrc = coureWareList[0].src;
this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time); this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time);
console.log('视频时长信息:' + this.videoTotalTime); console.log('视频时长信息:' + this.videoTotalTime);
}else{ } else {
this.updateLearnedStatusForText(); this.updateLearnedStatusForText();
} }
} }
...@@ -287,10 +319,11 @@ ...@@ -287,10 +319,11 @@
this.list = res.data[0].section; this.list = res.data[0].section;
this.courseTotal = this.list.length; this.courseTotal = this.list.length;
let length = this.list.length; let length = this.list.length;
for(let i = 0; i < length; i++){ for (let i = 0; i < length; i++) {
this.list[i].title = "第" + (i + 1) + "节"; this.list[i].title = "第" + (i + 1) + "节";
this.list[i].intro = this.list[i].name; this.list[i].intro = this.list[i].name;
this.list[i].isActive = this.active_section_id == this.list[i].id ? true : false; this.list[i].isActive = this.active_section_id == this.list[i].id ? true :
false;
} }
console.log('--select-list--') console.log('--select-list--')
console.log(this.list) console.log(this.list)
...@@ -443,13 +476,13 @@ ...@@ -443,13 +476,13 @@
padding: 40rpx 30rpx; padding: 40rpx 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.list-default { .list-default {
background-color: #F4F5F7; background-color: #F4F5F7;
border-radius: 12rpx; border-radius: 12rpx;
color: #333333; color: #333333;
} }
.list-default-active { .list-default-active {
background-color: #ffffff; background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
...@@ -457,8 +490,16 @@ ...@@ -457,8 +490,16 @@
border: 2rpx solid #2272FF; border: 2rpx solid #2272FF;
box-sizing: border-box; box-sizing: border-box;
} }
.color-teacher { .color-teacher {
color: #999999; color: #999999;
} }
.catalogue {
display: flex;
overflow: auto;
padding-top: 30rpx;
padding-bottom: 30rpx;
padding-right: 30rpx;
}
</style> </style>
src/static/photo/jianbian@3x.png

7.64 KB | W: | H:

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

21.9 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