|
@@ -333,6 +333,7 @@
|
|
danmuboxHeight: 0,
|
|
danmuboxHeight: 0,
|
|
user: {},
|
|
user: {},
|
|
crtShow: true,
|
|
crtShow: true,
|
|
|
|
+ isCheckRealUrl: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
@@ -388,6 +389,11 @@
|
|
// #ifndef H5
|
|
// #ifndef H5
|
|
uni.onKeyboardHeightChange(this.keyboardHeightChange);
|
|
uni.onKeyboardHeightChange(this.keyboardHeightChange);
|
|
// #endif
|
|
// #endif
|
|
|
|
+ if(this.socket!=null){
|
|
|
|
+ this.socket.close()
|
|
|
|
+ clearInterval(this.pingpangTimes)
|
|
|
|
+ this.socket = null
|
|
|
|
+ }
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
this.tipsOpen = false
|
|
this.tipsOpen = false
|
|
@@ -730,7 +736,7 @@
|
|
this.$isLoginCourse().then(
|
|
this.$isLoginCourse().then(
|
|
res => {
|
|
res => {
|
|
if(res){
|
|
if(res){
|
|
- if (this.isAddKf == 1) {
|
|
|
|
|
|
+ if (this.isAddKf == 1&&this.isCheckRealUrl) {
|
|
// 答题
|
|
// 答题
|
|
// 您已提交过答案,请领取红包
|
|
// 您已提交过答案,请领取红包
|
|
this.courseAnswer()
|
|
this.courseAnswer()
|
|
@@ -784,6 +790,7 @@
|
|
} = obj;
|
|
} = obj;
|
|
return rest;
|
|
return rest;
|
|
});
|
|
});
|
|
|
|
+ if(!this.isCheckRealUrl) return;
|
|
const param = {
|
|
const param = {
|
|
...this.urlOption,
|
|
...this.urlOption,
|
|
questions: questions,
|
|
questions: questions,
|
|
@@ -834,6 +841,7 @@
|
|
},
|
|
},
|
|
closeAnswerPopup() {
|
|
closeAnswerPopup() {
|
|
this.$refs.answerPopup.close()
|
|
this.$refs.answerPopup.close()
|
|
|
|
+ if(!this.isCheckRealUrl) return;
|
|
if (this.errTitle == '恭喜你,回答正确') {
|
|
if (this.errTitle == '恭喜你,回答正确') {
|
|
const param = {
|
|
const param = {
|
|
...this.urlOption,
|
|
...this.urlOption,
|
|
@@ -905,16 +913,27 @@
|
|
getIsAddKf(this.urlOption).then(res => {
|
|
getIsAddKf(this.urlOption).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.isAddKf = 1
|
|
this.isAddKf = 1
|
|
|
|
+ this.isCheckRealUrl = true
|
|
this.getH5CourseVideoDetails()
|
|
this.getH5CourseVideoDetails()
|
|
} else if (res.code == 400) {
|
|
} else if (res.code == 400) {
|
|
this.isAddKf = 0
|
|
this.isAddKf = 0
|
|
|
|
+ this.isCheckRealUrl = false
|
|
this.qrcode = res.qrcode
|
|
this.qrcode = res.qrcode
|
|
this.qrcodeMsg = res.msg
|
|
this.qrcodeMsg = res.msg
|
|
this.$refs.kfPopup.open()
|
|
this.$refs.kfPopup.open()
|
|
} else if (res.code == 504) {
|
|
} else if (res.code == 504) {
|
|
// 登录
|
|
// 登录
|
|
|
|
+ this.isCheckRealUrl = false
|
|
this.goLogin()
|
|
this.goLogin()
|
|
|
|
+ } else if (res.code == 566) {
|
|
|
|
+ this.isAddKf = 1
|
|
|
|
+ this.isCheckRealUrl = true
|
|
|
|
+ // 官方群发通用链接
|
|
|
|
+ const url = res.courseLink.realLink.split('?course=')[1]
|
|
|
|
+ this.urlOption = JSON.parse(url)
|
|
|
|
+ this.getH5CourseVideoDetails()
|
|
} else {
|
|
} else {
|
|
|
|
+ this.isCheckRealUrl = false
|
|
this.isAddKf = 0
|
|
this.isAddKf = 0
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: res.msg,
|
|
title: res.msg,
|
|
@@ -929,7 +948,7 @@
|
|
this.$refs.kfPopup.close()
|
|
this.$refs.kfPopup.close()
|
|
},
|
|
},
|
|
getFinishCourseVideo() {
|
|
getFinishCourseVideo() {
|
|
- if (!this.playTime) return
|
|
|
|
|
|
+ if (!this.playTime || !this.isCheckRealUrl) return
|
|
// {videoId: this.videoId,duration:this.playTime}
|
|
// {videoId: this.videoId,duration:this.playTime}
|
|
const param = {
|
|
const param = {
|
|
duration: this.playTime,
|
|
duration: this.playTime,
|
|
@@ -939,6 +958,7 @@
|
|
},
|
|
},
|
|
// 每十分钟获得积分
|
|
// 每十分钟获得积分
|
|
getIntegralByH5Video() {
|
|
getIntegralByH5Video() {
|
|
|
|
+ if(!this.isCheckRealUrl) return
|
|
const param = {
|
|
const param = {
|
|
duration: this.playTime,
|
|
duration: this.playTime,
|
|
...this.urlOption
|
|
...this.urlOption
|
|
@@ -957,6 +977,7 @@
|
|
},
|
|
},
|
|
// 缓冲
|
|
// 缓冲
|
|
getInternetTraffic() {
|
|
getInternetTraffic() {
|
|
|
|
+ if(!this.isCheckRealUrl) return
|
|
const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
|
|
const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
|
|
if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
|
|
if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
|
|
this.bufferRate = playVideoTime
|
|
this.bufferRate = playVideoTime
|
|
@@ -1033,10 +1054,10 @@
|
|
this.isExpire = false
|
|
this.isExpire = false
|
|
// 如果响应中包含真实链接,则跳转到真实链接
|
|
// 如果响应中包含真实链接,则跳转到真实链接
|
|
// window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
|
|
// window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
|
|
- if (this.isLogin && this.isAddKf == 1) {
|
|
|
|
|
|
+ if (this.isLogin && this.isAddKf == 1&&this.isCheckRealUrl) {
|
|
this.getH5CourseVideoDetails()
|
|
this.getH5CourseVideoDetails()
|
|
}
|
|
}
|
|
- if (this.videoId && this.isAddKf != 1) {
|
|
|
|
|
|
+ if (this.videoId &&(this.isAddKf != 1 || !this.isCheckRealUrl)) {
|
|
this.$isLoginCourse().then(
|
|
this.$isLoginCourse().then(
|
|
isLogin => {
|
|
isLogin => {
|
|
this.isLogin = isLogin
|
|
this.isLogin = isLogin
|
|
@@ -1251,13 +1272,18 @@
|
|
if (!this.player) {
|
|
if (!this.player) {
|
|
this.player = uni.createVideoContext('video-content-box');
|
|
this.player = uni.createVideoContext('video-content-box');
|
|
}
|
|
}
|
|
- setTimeout(()=>{
|
|
|
|
- this.player.sendDanmu({
|
|
|
|
- text: content.content,
|
|
|
|
- color: "#FF0000",
|
|
|
|
- time: this.playTime
|
|
|
|
- })
|
|
|
|
- },100)
|
|
|
|
|
|
+ this.player.sendDanmu({
|
|
|
|
+ text: content.content,
|
|
|
|
+ color: "#FF0000",
|
|
|
|
+ time: this.playTime + 1
|
|
|
|
+ })
|
|
|
|
+ // setTimeout(()=>{
|
|
|
|
+ // this.player.sendDanmu({
|
|
|
|
+ // text: content.content,
|
|
|
|
+ // color: "#FF0000",
|
|
|
|
+ // time: this.playTime
|
|
|
|
+ // })
|
|
|
|
+ // },100)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|