提交课程播放页的修改及首页加上判断

This commit is contained in:
daihh
2022-11-13 17:15:11 +08:00
parent 4e5681ec25
commit df9605a584
2 changed files with 121 additions and 45 deletions

View File

@@ -41,41 +41,63 @@
<text class="score">4.9</text>
</view>
</view>
<view class="desrow">
<view v-if="totalContent>1" class="desrow">
<view style="font-size: 32upx;color: #333333;">目录</view>
<view @click="showAllCatalog" style="font-size: 28upx;color: #666666;">全部&gt;</view>
<view v-if="totalContent>2" @click="showAllCatalog" style="font-size: 28upx;color: #666666;">全部&gt;</view>
</view>
<view>
<view v-if="scrollItemWidth>0" class="main-cata-active">
<scroll-view scroll-x :scroll-y="false" style="height:115px;white-space: nowrap;overflow: hidden;" :scroll-left="scrollInfo.scrollLeft" @scrolltoupper="scrollLeft" @scrolltolower="scrollRight" @scroll="scrollHandler">
<!-- <view class="mycrollcontent" style="display: flex;justify-content:flex-start;"> -->
<view v-for="(con,conIdx) in scrollList" :key="conIdx" style="display: inline-block;" :id="con.id" @click="playContent(con.cataName,con,conIdx,0)">
<!---->
<view :style="{width:scrollItemWidth+'px'}" class="scroll-item" :class="{'studying':curContent.id==con.id}">
<view class="scroll-item-sec">{{con.cataName}}
<!-- <text v-if="con.cataStatus && con.cataStatus==1" class="status-tag" :class="statusClass(con.cataStatus)">未开始</text>
<text v-if="con.cataStatus && con.cataStatus==2" class="status-tag" :class="statusClass(con.cataStatus)">进行中</text>
<text v-if="con.cataStatus && con.cataStatus==9" class="status-tag" :class="statusClass(con.cataStatus)">已完成</text> -->
</view>
<view class="scroll-item-con">
<view class="scroll-item-name">
{{con.contentName}}
<view v-if="totalContent>1"><!--单个内容时不显示内容名称-->
<view v-if="totalContent==2">
<view v-if="courseInfo.type==10">
<view class="citembox1">
<view v-for="(con,conIdx) in contentList" :key="conIdx" class="citembox1-item">
<view class="citem">
<view class="citem-body">{{con.contentName}} </view>
</view>
</view>
</view>
</view>
<view v-else><!--有目录的但是只有两项内容-->
<view class="citembox1">
<view v-for="(con,conIdx) in scrollList" :key="conIdx" class="citembox1-item">
<view class="citem">
<view class="citem-body">{{con.contentName}} </view>
</view>
</view>
</view>
</view>
</view>
<view v-else >
<view v-if="scrollItemWidth>0" class="main-cata-active">
<scroll-view scroll-x :scroll-y="false" style="height:115px;white-space: nowrap;overflow: hidden;" :scroll-left="scrollInfo.scrollLeft" @scrolltoupper="scrollLeft" @scrolltolower="scrollRight" @scroll="scrollHandler">
<!-- <view class="mycrollcontent" style="display: flex;justify-content:flex-start;"> -->
<view v-for="(con,conIdx) in scrollList" :key="conIdx" style="display: inline-block;" :id="con.id" @click="playContent(con.cataName,con,conIdx,0)">
<!---->
<view :style="{width:scrollItemWidth+'px'}" class="scroll-item" :class="{'studying':curContent.id==con.id}">
<view class="scroll-item-sec">{{con.cataName}}
<!-- <text v-if="con.cataStatus && con.cataStatus==1" class="status-tag" :class="statusClass(con.cataStatus)">未开始</text>
<text v-if="con.cataStatus && con.cataStatus==2" class="status-tag" :class="statusClass(con.cataStatus)">进行中</text>
<text v-if="con.cataStatus && con.cataStatus==9" class="status-tag" :class="statusClass(con.cataStatus)">已完成</text> -->
</view>
<!-- <view class="scroll-item-type">
<view class="square-border">
<view :class="statusClass(con.status)">
{{getConType(con.contentType)}}
</view>
<view class="scroll-item-con">
<view class="scroll-item-name">
{{con.contentName}}
</view>
<text v-if="con.status==1" class="status-tag" :class="statusClass(con.status)">未开始</text>
<text v-if="con.status==2" class="status-tag" :class="statusClass(con.status)">进行中</text>
<text v-if="con.status==9" class="status-tag" :class="statusClass(con.status)">已完成</text>
</view> -->
<!-- <view class="scroll-item-type">
<view class="square-border">
<view :class="statusClass(con.status)">
{{getConType(con.contentType)}}
</view>
</view>
<text v-if="con.status==1" class="status-tag" :class="statusClass(con.status)">未开始</text>
<text v-if="con.status==2" class="status-tag" :class="statusClass(con.status)">进行中</text>
<text v-if="con.status==9" class="status-tag" :class="statusClass(con.status)">已完成</text>
</view> -->
</view>
</view>
</view>
</view>
<!-- </view> -->
</scroll-view>
<!-- </view> -->
</scroll-view>
</view>
</view>
</view>
<!--交互-->
@@ -112,7 +134,7 @@
<view @click="closeAllCatalog"><text style="font-size: 32upx;">×</text></view>
</view>
<view class="catalogbox">
<view class="catalog">
<view v-if="courseInfo.type>10" class="catalog">
<view v-for="(cata,catIdx) in catalogTree" :key="catIdx" style="border-bottom: 1px solid #ebebeb;margin-bottom: 50rpx;padding-bottom: 30upx;">
<view class="catalog-sec" style="margin-bottom: 20rpx;">
<view class="catalog-sec-name" >
@@ -141,6 +163,22 @@
</view>
</view>
</view>
<view v-else class="catalog">
<view >
<view v-for="(con,conIdx) in cata.contentList" :key="conIdx" class="catalog-con" @click="playContent(cata.section,con,conIdx,catIdx)">
<view class="catalog-con-name" :class="{'studying':curContent.id==con.id}">
<!-- <text>{{catIdx+1}}.{{conIdx+1}}, </text> -->
<!-- <text class="square-border">{{getConType(con.contentType)}}</text> -->
<text class="text-ellipsis" style="font-size: 14px;">{{con.contentName}}</text>
</view>
<view>
<text v-if="con.status==1" class="status-tag tag-nostart" style="font-size: 14px;">未开始</text>
<text v-if="con.status==2" class="status-tag tag-studying" style="font-size: 14px;">进行中</text>
<text v-if="con.status==9" class="status-tag tag-finish" style="font-size: 14px;">已完成</text>
</view>
</view>
</view>
</view>
<view style="height: 50px;"></view>
</view>
</view>
@@ -205,7 +243,8 @@
teachers:[],//课程老师列表
recommendCourses:[],//推荐课程列表
catalogShow:false,//是否显示目录
catalogNum:1,//一个目录时不显示两个时显示占满三个时类似UI一样的显示了
totalContent:0,//课程内容数量
hasSection:false,//是否有目录
tabIndex:1,//显示的tab内容
scoreInfo:{dlgShow:false, score:5, has:false},//评分控制项
isPraise:false,//是否已点赞
@@ -233,7 +272,7 @@
conLink:{openType:1,url:''},//外连接内容
curriculumData:{url:'',isDrag:true,completeSetup:1,setupTage:0,second:0},// 课件内容
totalContent:0,//课程内容数量
authorInfo:{aid:'',name:'',code:'',orgInfo:''},
sectionList:[],
@@ -356,7 +395,7 @@
userIds.push(item.teacherId);
ctoUsers.push({ aid: item.teacherId, name: item.teacherName });
});
//this.toUsers = ctoUsers;
this.toUsers = ctoUsers;//关注老师,关注多个考试
this.loadAuthorInfo(rs.result.teachers, userIds);
}
let showConId=this.initContentId;
@@ -400,8 +439,8 @@
})
}
}
this.contentList=rs.result.contents;
this.totalContent=rs.result.contents.length;
this.contentList=rs.result.contents;//内容列表
this.totalContent=rs.result.contents.length;//一共有向个可以播放的内容
this.sectionList=rs.result.sections;
//设置正在学习的章节
if(showConId==''){
@@ -425,26 +464,25 @@
if(rs.status==200){
// uni.setNavigationBarTitle({ title:rs.result.course.name })
this.courseInfo=rs.result.course;
//老师信息
this.teachers=rs.result.teachers;
if(rs.result.teachers && rs.result.teachers.length > 0) {
let userIds = [];
let ctoUsers = [];
rs.result.teachers.forEach(item => {
// item.aid='';
item.name= '';
item.orgInfo= '';
item.avatar= '';
item.code= '';
item.sex=null;
userIds.push(item.teacherId);
ctoUsers.push({ aid: item.teacherId, name: item.teacherName });
});
// this.toUsers = ctoUsers;
this.loadAuthorInfo(rs.result.teachers, userIds);
}
this.loadUserInfo(this.courseInfo.sysCreateAid);
//设置必须的字段
let showConId=this.initContentId;
rs.result.sections.forEach(sec=>{
sec.status=1;//加入状态表未开始
rs.result.contents.forEach(c=>{
@@ -800,6 +838,39 @@
}
}
}
.citembox1{
display: flex;
.citembox1-item{
width: 50%;
}
}
.citem{
margin: 20upx;
.citem-title{
color: #333333;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
overflow: hidden;
}
.citem-body{
background-color: #F7F8F9;
color: #333333;
padding: 40upx;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.citem-active{
color: #387DF7;
border: 1px dotted #387DF7;
}
}
.catalog{
background: #FFFFFF;
padding:20upx;