Commit 5e7d4989 authored by 林文清's avatar 林文清

学习在线

parent 3804cdbb
......@@ -3,30 +3,34 @@
<view class="title">
课程简介
</view>
<view class="u-content">
<u-parse :html="courseInfo.intro"></u-parse>
</view>
<view class="lecturer">
<view class="" style="font-size: 40rpx;font-weight: bold;margin: 30rpx 0;">
讲师
</view>
<view class="" style="display: flex;">
<image src="../../static/logo.png" mode=""></image>
<view style="font-size: 30rpx;font-weight:1000;margin: 19px 24px;">扳手卢老师</view>
<view class="" v-if="courseInfo.isTeachers">
<view class="" style="font-size: 40rpx;font-weight: bold;margin: 30rpx 0;">
讲师
</view>
<view class="" style="display: flex;">
<image src="../../static/logo.png" mode=""></image>
<view style="font-size: 30rpx;font-weight:1000;margin: 19px 24px;">{{ courseInfo.teacher.name }}</view>
</view>
</view>
<view class="" style="margin: 36rpx 0;">
<view class="" style="font-size: 40rpx;font-weight:1000">
目录
</view>
<view v-for="item in list">
<view v-for="(item,index) in list">
<view class="chapter">
{{item.name}}
</view>
<view class="video" v-for="key in item.section" @click=details(key.id)>
<view class="video" v-for="(section,key) in item.section" @click=details(key.id)>
<view class="video_1" >
<view class="text" v-text="wareType(key.ware)">
<view class="text" v-text="wareType(section.ware)">
</view>
<text>1-{{key.order}}</text>
<text class="text2">{{key.name}}</text>
<text class="text3" v-text="key.isLearned==false?'未开始':'完成'"></text>
<text class="texts">{{index+1}}-{{key+1}}</text>
<text class="text2">{{section.name}}</text>
<text class="text3" v-text="section.isLearned==false?'未开始':'完成'"></text>
</view>
</view>
</view>
......@@ -45,6 +49,11 @@
},
list:[],
examId:1,
courseInfo: {
intro: '',
isTeachers: false,
teacher: {}
}
}
},
onLoad(a){
......@@ -52,8 +61,31 @@
this.params.course_id=a.course_id
console.log(this.params.course_id)
this.getCapterDetails()
this.getCourseInfo()
},
methods: {
getCourseInfo() {
let param = {
course_id: this.params.course_id
};
this.$u.api
.CourseList(param)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.courseInfo.intro = res.data.course.intro;
this.courseInfo.isTeachers = res.data.course.teachers.length > 0;
this.courseInfo.teacher = this.courseInfo.isTeachers ? res.data.course.teachers[0] : {};
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
});
},
//获取章节详情
getCapterDetails() {
console.log('获取章节详情')
......@@ -133,7 +165,7 @@
<style lang="scss">
.title{
height: 164rpx;
height: 64rpx;
font-size: 40rpx;
font-weight: bold;
margin: 24rpx 34rpx;
......@@ -158,6 +190,12 @@
margin: 20rpx 0;
position: relative;
width: 100%;
.texts{
border:1px solid #8F8F94;
text-align: center;
line-height: 38rpx;
margin-right: 5rpx;
}
.text{
width: 100rpx;
height: 38rpx;
......@@ -179,4 +217,7 @@
right: 0;
}
}
.u-content {
padding: 0rpx 34rpx;
}
</style>
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