mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-10 03:16:45 +08:00
提交
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
<view style="min-height: 500upx;" >
|
||||
<view v-if="curContent.contentType==10" style="background-color: #000000;">
|
||||
<!--视频-->
|
||||
<view style="position: relative;">
|
||||
<video id="myVideo"
|
||||
<view style="position: relative;">
|
||||
<video id="myVideo"
|
||||
@touchend="doubleClickVideo"
|
||||
:src="fileBaseUrl+curriculumData.url"
|
||||
:src="blobUrl"
|
||||
controls
|
||||
:enable-play-gesture="true"
|
||||
:initial-time="curContent.lastStudyTime"
|
||||
@@ -74,7 +74,7 @@
|
||||
<!--音频播放-->
|
||||
<view style="text-align: center;padding-top: 40px;background-color: #FFFFFF;">
|
||||
<audio-player
|
||||
:src="fileBaseUrl+curriculumData.url"
|
||||
:src="blobUrl"
|
||||
:name="curContent.contentName"
|
||||
:drag="curriculumData.isDrag"
|
||||
@onPlay="audioPlay"
|
||||
@@ -285,7 +285,7 @@
|
||||
<view v-else >
|
||||
<view class="tabrow" style="justify-content: space-between;">
|
||||
<view class="tabrow-item"><text class="tabrow-active">目录</text></view>
|
||||
<view @click="closeAllCatalog"><text style="font-size: 32upx;">×</text></view>
|
||||
<view @click="closeAllCatalog"> <image src="/static/images/close.png" style="width: 50upx;height: 50upx;"></image> </view>
|
||||
</view>
|
||||
<view class="catalogbox">
|
||||
<view v-if="courseInfo.type>10" class="catalog">
|
||||
@@ -304,7 +304,7 @@
|
||||
<view >
|
||||
<view v-for="(con,conIdx) in cata.children" :key="conIdx" class="catalog-con" @click="playContent(con,conIdx,catIdx)">
|
||||
<view class="catalog-con-name" :class="{'color-studying':curContent.id==con.id}">
|
||||
<!-- <text>{{catIdx+1}}.{{conIdx+1}}, </text> -->
|
||||
<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>
|
||||
@@ -319,9 +319,9 @@
|
||||
</view>
|
||||
<view v-else class="catalog">
|
||||
<view >
|
||||
<view v-for="(con,conIdx) in contentList" :key="conIdx" class="catalog-con" @click="playContent(con,conIdx,catIdx)">
|
||||
<view v-for="(con,conIdx) in contentList" :key="conIdx" class="catalog-con" @click="playContent(con,conIdx)">
|
||||
<view class="catalog-con-name" :class="{'color-studying':curContent.id==con.id}">
|
||||
<!-- <text>{{catIdx+1}}.{{conIdx+1}}, </text> -->
|
||||
<text>{{conIdx+1}}. </text>
|
||||
<!-- <text class="square-border">{{getConType(con.contentType)}}</text> -->
|
||||
<text class="text-ellipsis" style="font-size: 14px;">{{con.contentName}}</text>
|
||||
</view>
|
||||
@@ -389,6 +389,7 @@
|
||||
import apiCourseFile from "@/api/modules/courseFile.js";
|
||||
import apiUser from '@/api/system/user.js';
|
||||
import apiUserFollow from '@/api/phase2/userfollow.js'
|
||||
import apiStat from '@/api/phase2/stat.js'
|
||||
import apiResOwner from '@/api/modules/resowner.js'
|
||||
import apiPraises from "@/api/modules/praises.js";
|
||||
import apiTrample from "@/api/modules/trample.js";
|
||||
@@ -460,7 +461,11 @@
|
||||
appendHandle:null,
|
||||
appentId:'',//当前追加的学习时长的id
|
||||
appentInterval:30000,//追加学习时间的间隔 30秒加一次
|
||||
preTime:-1
|
||||
preTime:-1,
|
||||
blobUrl:'',//音视频的播放地址
|
||||
localTimeKey:'boeu-study-time' ,//本地存储的学习时长的key json格式
|
||||
localTimeValue:0,//计算的时间
|
||||
appendStudyOtherHandle:null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -709,11 +714,14 @@
|
||||
this.conLink.openType=1;
|
||||
}
|
||||
} else if(con.contentType==10 || con.contentType==20) {
|
||||
console.log(con.content);
|
||||
if(con.content.startsWith('\{')){
|
||||
this.curriculumData=JSON.parse(con.content);
|
||||
}else{
|
||||
this.curriculumData.url=con.content;
|
||||
}
|
||||
this.blobUrl=this.fileBaseUrl+this.curriculumData.url;
|
||||
console.log(this.blobUrl,'this.blobUrl');
|
||||
}
|
||||
this.curContent=con;
|
||||
this.catalogShow=false;
|
||||
@@ -1015,6 +1023,40 @@
|
||||
this.scrollInfo = e.detail;
|
||||
},
|
||||
//以下是插入相关的处理
|
||||
appendStudyOtherTime() { //非音视频课学习时长的增加,每一分钟保存一次
|
||||
//console.log('开始追加学习时长',this.isAppendTime);
|
||||
if (this.studyId == '') {
|
||||
return;
|
||||
}
|
||||
if (!this.contentData.id) {
|
||||
return;
|
||||
}
|
||||
let postData={
|
||||
"key": "StudyCourseOther",//课程学习的key
|
||||
"title": "非音视频课内容",//事件的标题
|
||||
"parameters":"second:60",//second:value 本次的学习时长
|
||||
"content": "学习课程",//事件的内容
|
||||
"objId": this.courseInfo.id,//课程的id
|
||||
"objType": "1",//类型
|
||||
"source":"page",
|
||||
"objInfo": ""+this.courseInfo.name,
|
||||
"aid":this.userInfo.aid, //当前登录人的id
|
||||
"aname":this.userInfo.name,//当前人的姓名
|
||||
"status": 1 //状态
|
||||
}
|
||||
//静默处理
|
||||
apiStat.sendEvent(postData).then(rs=>{
|
||||
if(rs.status != 200) {
|
||||
console.log(rs.message);
|
||||
}
|
||||
});
|
||||
//每一分钟保存一次
|
||||
let $this=this;
|
||||
this.appendStudyOtherHandle = setTimeout(function() {
|
||||
$this.appendStudyOtherTime();
|
||||
}, 1000*60);
|
||||
|
||||
},
|
||||
doubleClickVideo(e){
|
||||
// this.onPlayerPause()
|
||||
this.touchNum ++
|
||||
@@ -1607,10 +1649,10 @@
|
||||
.catalog-con{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding:10upx;
|
||||
padding:30upx 0upx 30upx 30upx;
|
||||
padding-right: 0;
|
||||
padding-left: 30rpx;
|
||||
line-height: 40upx;
|
||||
|
||||
border-bottom: 1px solid rgba(153,153,153,0.08);
|
||||
.square-border{
|
||||
display: inline-block;
|
||||
border:1px solid;
|
||||
|
||||
Reference in New Issue
Block a user