mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 18:06:47 +08:00
提交课程播放页的修改及首页加上判断
This commit is contained in:
@@ -155,15 +155,20 @@
|
||||
let key = 'mobileIndex1';
|
||||
apiPlace.detail(key).then(res => {
|
||||
this.resonimg = [];
|
||||
if(res.result.content && res.result.content.length>10){
|
||||
let lmj = JSON.parse(res.result.content)
|
||||
lmj.forEach(item=>{
|
||||
this.resonimg.push(this.fileUrl+item.image);
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
let keyImg = 'mobileIndex2';
|
||||
apiPlace.detail(keyImg).then(res => {
|
||||
if(res.result.content && res.result.content.length>10){
|
||||
let lmj = JSON.parse(res.result.content)
|
||||
this.placeholderImg = lmj[0];
|
||||
}
|
||||
});
|
||||
},
|
||||
//文章跳转详情
|
||||
|
||||
@@ -41,11 +41,32 @@
|
||||
<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;">全部></view>
|
||||
<view v-if="totalContent>2" @click="showAllCatalog" style="font-size: 28upx;color: #666666;">全部></view>
|
||||
</view>
|
||||
<view>
|
||||
<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;"> -->
|
||||
@@ -78,6 +99,7 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--交互-->
|
||||
<view class="cinfo-btns">
|
||||
<view class="cinfo-btn" @click="openScore()">
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user