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

学习在线

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