mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-11 03:46:47 +08:00
提交
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<view style="position: relative;">
|
<view style="position: relative;">
|
||||||
<video id="myVideo"
|
<video id="myVideo"
|
||||||
@touchend="doubleClickVideo"
|
@touchend="doubleClickVideo"
|
||||||
:src="fileBaseUrl+curriculumData.url"
|
:src="blobUrl"
|
||||||
controls
|
controls
|
||||||
:enable-play-gesture="true"
|
:enable-play-gesture="true"
|
||||||
:initial-time="curContent.lastStudyTime"
|
:initial-time="curContent.lastStudyTime"
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<!--音频播放-->
|
<!--音频播放-->
|
||||||
<view style="text-align: center;padding-top: 40px;background-color: #FFFFFF;">
|
<view style="text-align: center;padding-top: 40px;background-color: #FFFFFF;">
|
||||||
<audio-player
|
<audio-player
|
||||||
:src="fileBaseUrl+curriculumData.url"
|
:src="blobUrl"
|
||||||
:name="curContent.contentName"
|
:name="curContent.contentName"
|
||||||
:drag="curriculumData.isDrag"
|
:drag="curriculumData.isDrag"
|
||||||
@onPlay="audioPlay"
|
@onPlay="audioPlay"
|
||||||
@@ -285,7 +285,7 @@
|
|||||||
<view v-else >
|
<view v-else >
|
||||||
<view class="tabrow" style="justify-content: space-between;">
|
<view class="tabrow" style="justify-content: space-between;">
|
||||||
<view class="tabrow-item"><text class="tabrow-active">目录</text></view>
|
<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>
|
||||||
<view class="catalogbox">
|
<view class="catalogbox">
|
||||||
<view v-if="courseInfo.type>10" class="catalog">
|
<view v-if="courseInfo.type>10" class="catalog">
|
||||||
@@ -304,7 +304,7 @@
|
|||||||
<view >
|
<view >
|
||||||
<view v-for="(con,conIdx) in cata.children" :key="conIdx" class="catalog-con" @click="playContent(con,conIdx,catIdx)">
|
<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}">
|
<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="square-border">{{getConType(con.contentType)}}</text> -->
|
||||||
<text class="text-ellipsis" style="font-size: 14px;">{{con.contentName}}</text>
|
<text class="text-ellipsis" style="font-size: 14px;">{{con.contentName}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -319,9 +319,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else class="catalog">
|
<view v-else class="catalog">
|
||||||
<view >
|
<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}">
|
<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="square-border">{{getConType(con.contentType)}}</text> -->
|
||||||
<text class="text-ellipsis" style="font-size: 14px;">{{con.contentName}}</text>
|
<text class="text-ellipsis" style="font-size: 14px;">{{con.contentName}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -389,6 +389,7 @@
|
|||||||
import apiCourseFile from "@/api/modules/courseFile.js";
|
import apiCourseFile from "@/api/modules/courseFile.js";
|
||||||
import apiUser from '@/api/system/user.js';
|
import apiUser from '@/api/system/user.js';
|
||||||
import apiUserFollow from '@/api/phase2/userfollow.js'
|
import apiUserFollow from '@/api/phase2/userfollow.js'
|
||||||
|
import apiStat from '@/api/phase2/stat.js'
|
||||||
import apiResOwner from '@/api/modules/resowner.js'
|
import apiResOwner from '@/api/modules/resowner.js'
|
||||||
import apiPraises from "@/api/modules/praises.js";
|
import apiPraises from "@/api/modules/praises.js";
|
||||||
import apiTrample from "@/api/modules/trample.js";
|
import apiTrample from "@/api/modules/trample.js";
|
||||||
@@ -460,7 +461,11 @@
|
|||||||
appendHandle:null,
|
appendHandle:null,
|
||||||
appentId:'',//当前追加的学习时长的id
|
appentId:'',//当前追加的学习时长的id
|
||||||
appentInterval:30000,//追加学习时间的间隔 30秒加一次
|
appentInterval:30000,//追加学习时间的间隔 30秒加一次
|
||||||
preTime:-1
|
preTime:-1,
|
||||||
|
blobUrl:'',//音视频的播放地址
|
||||||
|
localTimeKey:'boeu-study-time' ,//本地存储的学习时长的key json格式
|
||||||
|
localTimeValue:0,//计算的时间
|
||||||
|
appendStudyOtherHandle:null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -709,11 +714,14 @@
|
|||||||
this.conLink.openType=1;
|
this.conLink.openType=1;
|
||||||
}
|
}
|
||||||
} else if(con.contentType==10 || con.contentType==20) {
|
} else if(con.contentType==10 || con.contentType==20) {
|
||||||
|
console.log(con.content);
|
||||||
if(con.content.startsWith('\{')){
|
if(con.content.startsWith('\{')){
|
||||||
this.curriculumData=JSON.parse(con.content);
|
this.curriculumData=JSON.parse(con.content);
|
||||||
}else{
|
}else{
|
||||||
this.curriculumData.url=con.content;
|
this.curriculumData.url=con.content;
|
||||||
}
|
}
|
||||||
|
this.blobUrl=this.fileBaseUrl+this.curriculumData.url;
|
||||||
|
console.log(this.blobUrl,'this.blobUrl');
|
||||||
}
|
}
|
||||||
this.curContent=con;
|
this.curContent=con;
|
||||||
this.catalogShow=false;
|
this.catalogShow=false;
|
||||||
@@ -1015,6 +1023,40 @@
|
|||||||
this.scrollInfo = e.detail;
|
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){
|
doubleClickVideo(e){
|
||||||
// this.onPlayerPause()
|
// this.onPlayerPause()
|
||||||
this.touchNum ++
|
this.touchNum ++
|
||||||
@@ -1607,10 +1649,10 @@
|
|||||||
.catalog-con{
|
.catalog-con{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding:10upx;
|
padding:30upx 0upx 30upx 30upx;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
padding-left: 30rpx;
|
|
||||||
line-height: 40upx;
|
border-bottom: 1px solid rgba(153,153,153,0.08);
|
||||||
.square-border{
|
.square-border{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
border:1px solid;
|
border:1px solid;
|
||||||
|
|||||||
Reference in New Issue
Block a user