|
@@ -99,16 +99,16 @@ Page({
|
|
|
})
|
|
|
if (netStatus != 'wifi' && !this.data.isAgree) {
|
|
|
this.data.videoContext.pause()
|
|
|
- this.setData({
|
|
|
- showChange: false
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ showChange: false
|
|
|
+ })
|
|
|
}
|
|
|
wx.onNetworkStatusChange((res) => {
|
|
|
if (this.data.networkType == "wifi" && res.networkType != "wifi" && !this.data.isAgree) {
|
|
|
this.data.videoContext.pause()
|
|
|
- this.setData({
|
|
|
- showChange: false
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ showChange: false
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -192,7 +192,6 @@ Page({
|
|
|
timeUpdate: function (e) {
|
|
|
let _this = this;
|
|
|
let currentTime = parseInt(e.detail.currentTime) //当前播放秒数
|
|
|
- console.log(currentTime)
|
|
|
if (currentTime != 0 && currentTime % 300 == 0) {
|
|
|
if (currentTime != this.data.spanTime) {
|
|
|
this.setData({
|
|
@@ -205,20 +204,22 @@ Page({
|
|
|
let studyTime = 'studyLog.studyTime'
|
|
|
//实时给页面的学习记录赋值
|
|
|
let jump_time = parseInt(_this.data.video_real_time); //定义跳转的时间
|
|
|
- if (this.data.studyLog.isStudyDone != 1) {
|
|
|
+ if (_this.data.studyLog.isDone != 1) {
|
|
|
if (currentTime > jump_time && currentTime - jump_time > 3 && currentTime > _this.data.playVideoDuration) {
|
|
|
_this.data.videoContext.seek(_this.data.playVideoDuration)
|
|
|
- this.setData({
|
|
|
+ if (_this.data.video_real_time > 0) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '该视频不可以快进哦!',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ _this.setData({
|
|
|
video_real_time: _this.data.playVideoDuration, //实时播放进度
|
|
|
})
|
|
|
- wx.showToast({
|
|
|
- title: '该视频不可以快进哦!',
|
|
|
- icon: 'none',
|
|
|
- duration: 2000,
|
|
|
- })
|
|
|
}
|
|
|
if (currentTime > jump_time && currentTime - jump_time < 3 && currentTime > _this.data.playVideoDuration) {
|
|
|
- this.setData({
|
|
|
+ _this.setData({
|
|
|
playVideoDuration: currentTime,
|
|
|
[studyTime]: currentTime
|
|
|
})
|
|
@@ -264,9 +265,6 @@ Page({
|
|
|
},
|
|
|
onUnload() {
|
|
|
let _this = this;
|
|
|
- console.log(_this.data.studyLog.isDone, typeof (_this.data.studyLog.isDone))
|
|
|
- console.log(_this.data.studyLog.studyTime)
|
|
|
- console.log(_this.data.playVideoDuration)
|
|
|
if (_this.data.studyLog.isDone != '1') {
|
|
|
if (this.data.video_real_time > this.data.courseTime / 1000 - 10) {
|
|
|
let isDone = 'studyLog.isDone'
|
|
@@ -275,31 +273,21 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- // clearInterval(_this.data.intervalCtx)
|
|
|
if (_this.data.classInfo.id != -1) {
|
|
|
- let stydyrecord = _this.data.playVideoDuration;
|
|
|
- if (stydyrecord == null) {
|
|
|
- stydyrecord == 0
|
|
|
- }
|
|
|
- if (_this.data.studyLog.studyTime > stydyrecord) {
|
|
|
- wx.request({
|
|
|
- method: "post",
|
|
|
- url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
|
|
|
- data: {
|
|
|
- studyLog: _this.data.studyLog
|
|
|
- },
|
|
|
- success: (e) => {
|
|
|
- console.log(e, "我修改进度成功了")
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ wx.request({
|
|
|
+ method: "post",
|
|
|
+ url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
|
|
|
+ data: {
|
|
|
+ studyLog: _this.data.studyLog
|
|
|
+ },
|
|
|
+ success: (e) => {
|
|
|
+ console.log(e, "我修改进度成功了")
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
onHide() {
|
|
|
let _this = this;
|
|
|
- console.log(_this.data.studyLog.isDone)
|
|
|
- console.log(_this.data.studyLog.studyTime)
|
|
|
- console.log(_this.data.playVideoDuration)
|
|
|
if (_this.data.studyLog.isDone != '1') {
|
|
|
if (this.data.video_real_time > this.data.courseTime / 1000 - 10) {
|
|
|
let isDone = 'studyLog.isDone'
|
|
@@ -308,24 +296,17 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- // clearInterval(_this.data.intervalCtx)
|
|
|
if (_this.data.classInfo.id != -1) {
|
|
|
- let stydyrecord = _this.data.playVideoDuration;
|
|
|
- if (stydyrecord == null) {
|
|
|
- stydyrecord == 0
|
|
|
- }
|
|
|
- if (_this.data.studyLog.studyTime > stydyrecord) {
|
|
|
- wx.request({
|
|
|
- method: "post",
|
|
|
- url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
|
|
|
- data: {
|
|
|
- studyLog: _this.data.studyLog
|
|
|
- },
|
|
|
- success: (e) => {
|
|
|
- console.log(e, "我修改进度成功了")
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ wx.request({
|
|
|
+ method: "post",
|
|
|
+ url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
|
|
|
+ data: {
|
|
|
+ studyLog: _this.data.studyLog
|
|
|
+ },
|
|
|
+ success: (e) => {
|
|
|
+ console.log(e, "我修改进度成功了")
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 获取当前网络状态
|