代码合并

This commit is contained in:
2024-12-06 11:30:48 +08:00
14 changed files with 159 additions and 234 deletions

View File

@@ -426,6 +426,7 @@
zongPrice: 0, //整部价格
countPrice: 0, //单集价格
isWxIosPay: true,
playFlag: false,
};
},
onShareAppMessage(res) {
@@ -581,7 +582,6 @@
if (e.tt_episode_id) {
this.tt_episode_id = e.tt_episode_id
}
console.log(1)
// this.$u.get('/app/common/type/817').then(res => { //是否开启购买整部视频 817
// if (res.code == 0 && res.data) {
// this.zhengbu = res.data.value;
@@ -675,7 +675,6 @@
}
// #endif
this.isVips = uni.getStorageSync('isVips') ? uni.getStorageSync('isVips') : '否'
console.log(2)
if(this.courseId){
this.getDataList(this.courseId, this.courseDetailsId);
}
@@ -1016,6 +1015,21 @@
// #ifdef H5
uni.hideLoading()
// #endif
// console.log(e.detail.currentTime)
// console.log(e.detail.duration)
if (e.detail.currentTime > e.detail.duration*0.9) {
if ( this.playFlag) {
this.playFlag = false
this.$Request.getT('app/course/viewCourse', {
courseId: this.courseId,
courseDetailsId: this.courseDetailsId,
type: 'end'
}).then(res => {
console.log('播放结束')
})
}
}
},
//缓冲中
waiting(e) {
@@ -1657,8 +1671,8 @@
}
}
}
// this.courseId = this.videoList[current].courseId
// this.courseDetailsId = this.videoList[current].courseDetailsId
this.courseId = this.videoList[current].courseId
this.courseDetailsId = this.videoList[current].courseDetailsId
//获取当前播放的视频在菜单数组中的位置
let scrollIndex = this.meunList.findIndex(ite => ite.courseDetailsId == this.videoList[current]
.courseDetailsId)
@@ -1689,10 +1703,12 @@
})
},
startPlay(current) {
console.log(222222)
if (this.videoContext) { //判断之前是否有视频的上下文
this.videoContext.stop()
this.videoContext = null
}
console.log(this.videoList[current])
let numIdCurr = this.videoList[current].courseDetailsId
if (this.videoList[current].videoUrl) { //已经购买可直接播放
// 播放时记录当前播放的id
@@ -1717,7 +1733,14 @@
//播放时的回掉
videoPlay(videoId) {
this.$Request.getT('app/course/viewCourse', {
courseId: this.courseId,
courseDetailsId: this.courseDetailsId,
type: 'start'
}).then(res => {
this.playFlag = true
console.log('播放开始')
})
},
//监听视频播放完成
ended() {