合并主分支的视频播放

This commit is contained in:
@fawn-nine
2024-08-19 14:39:29 +08:00
17 changed files with 8670 additions and 2729 deletions

View File

@@ -7,7 +7,7 @@
<view
class="contentBox curriculum_box"
:style="`height:calc(100% - ${60 + statusBarHeight}px !important;${
:style="`height:calc(100% - ${60 + statusBarHeight}px !important; overflow-x: hidden; ${
isFullScreen ? 'background:#000' : ''
}`"
>
@@ -16,8 +16,12 @@
<common-video
@changeScreen="changeScreen"
@changeScreenLoading="changeScreenLoading"
@hideNextVideo="hideNextVideo"
@startNextVideoCountDown = "startNextVideoCountDown"
@unlockChangeVideo="unlockChangeVideo"
v-if="isfresh"
ref="commonVideo"
:secondCountDown="secondCountDown"
 :videoTitle="curriculumData.title"
:currentVideo="currentVideo"
:noRecored = "noRecored"
@@ -25,8 +29,7 @@
>
</common-video>
<view style="height: 200px" v-else></view>
</view>
</view>
<scroll-view
:style="`height:calc(100% - 200px - 40rpx) ;`"
scroll-y="true"
@@ -53,6 +56,7 @@
:currentVideo="currentVideo"
:dataList="videoArray"
@open="changeVideo"
:changeVideoLock="changeVideoLock"
>
</common-curriculum-video>
</view>
@@ -115,11 +119,14 @@ export default {
},
data() {
return {
changeVideoLock:false, // 切换键锁
isFullScreen: false,
screenLoading: false,
isfresh: false,
currentCateIndex: 0,
currentVideo: {},
secondCountDown:10,
countDownTimer:undefined,
videoList: {},
isOpenMp3: false,
praise: "",
@@ -207,22 +214,13 @@ export default {
},
beforeDestroy(){
console.log('页面卸载')
// this.$nextTick(()=>{
// this.$refs.commonVideo.handleEnd();
// })
this.hideNextVideo()
},
onUnload(){
// console.log('页面卸载')
// // this.$nextTick(()=>{
// this.$refs.commonVideo.handleEnd();
// // })
onUnload(){
},
onHide() {
// this.hideNextVideo()
// this.showSearchList = false
// this.searchList = []
},
@@ -233,7 +231,36 @@ export default {
...mapState(["userInfo"]),
},
methods: {
// 放大图片
unlockChangeVideo(){
this.changeVideoLock = false
},
startNextVideoCountDown(){
this.secondCountDown = 10
let that = this
if(this.countDownTimer){
clearInterval(this.countDownTimer)
}
this.countDownTimer = setInterval(()=>{
this.secondCountDown -= 1
if(this.secondCountDown == 0){
// clearInterval(this.countDownTimer)
// console.log('倒计时结束');
that.hideNextVideo()
console.log('切换之前的播放index是',this.currentCateIndex);
// console.log('当前的播放列表',this.videoArray.length);
// if(this.currentCateIndex < this.videoArray.length-1){
this.currentCateIndex++
console.log('切换之后的播放index是',this.currentCateIndex);
that.changeVideo(this.videoArray[this.currentCateIndex])
// }
}
},1000)
},
hideNextVideo(){
console.log('父组件收到了取消加载-------------------');
clearInterval(this.countDownTimer)
this.countDownTimer = undefined
},
//课程详情
async gotoDetail(v, index) {
@@ -267,6 +294,7 @@ export default {
this.$forceUpdate();
},
initVideo() {
this.changeVideoLock = true
this.screenLoading = false;
this.isfresh = false;
this.$nextTick(() => {
@@ -280,23 +308,34 @@ export default {
});
},
changeVideo(data) {
console.log("data at line 370:", data);
this.changeVideoLock = true
if(this.countDownTimer){
this.hideNextVideo()
}
console.log("点击了点击了切换视频-----:", this.countDownTimer,data, );
if (data.id != this.currentVideo.id) {
this.currentCateIndex = this.videoArray.findIndex(item => {
return item.id == data.id
})
// handleEnd
this.$refs.commonVideo.handleEnd();
// this.$refs.commonVideo.handleEnd();
setTimeout(() => {
this.currentVideo = data;
// this.$refs.commonVideo.changeVideo(data);
this.currentVideo = data;
this.initVideo();
this.isOpenMp3 = false;
}, 500);
} else {
this.currentVideo = data;
this.initVideo();
this.isOpenMp3 = false;
}
}
// else {
// this.currentVideo = data;
// this.initVideo();
// this.isOpenMp3 = false;
// }
console.log("data at line 380111111111111111111:", data.type);
// console.log("data at line 380111111111111111111:", data.type);
},
hancleModalCancel() {
this.show = false;
@@ -374,6 +413,7 @@ export default {
isHaveHistorySeekVideo != -1 ? isHaveHistorySeekVideo : 0;
if (that.videoArray.length > 0) {
this.currentVideo = that.videoArray[that.currentCateIndex];
console.log('默认播放的index',that.currentCateIndex, this.currentVideo.id,that.videoArray);
this.initVideo();
}
var videoArray = [];

View File

@@ -51,7 +51,7 @@
align-items: center;
" @click="isHideCourseInfo = !isHideCourseInfo">
<view :class="`${isHideCourseInfo ? 'hidden2' : ''}`"
style="width: calc(100% - 50rpx)" v-html="course.content">
style="width: calc(100% - 50rpx); font-size: 30rpx;" v-html="course.content">
</view>
<text
style="
@@ -462,7 +462,47 @@
fatherIndex: null,
supportFlag: false,
selectGoodsData: {},
<<<<<<< .mine
buyOptions: [],
=======
buyOptions: [
// {
// icon: 'chat',
// text: '客服'
// },
// {
// icon: 'shop',
// text: '店铺',
// // info: 2,
// infoBackgroundColor: '#007aff',
// infoColor: "#f5f5f5"
// },
// {
// icon: 'cart',
// text: '购物车',
// info: 2
// }
],
>>>>>>> .theirs
customButtonGroup1: [{
with: 200,
text: "立即购买",
@@ -687,12 +727,8 @@
this.$forceUpdate();
},
onHandleClickBuy(e) {
console.log("this.selectGoodsData at line 589:", this.selectGoodsData);
// if (e.index == 0) {
// this.handleClickClose();
// }
// if (e.index == 0) {
console.log("this.selectGoodsData at line 589:", this.selectGoodsData);
var mynavData = JSON.stringify({
goods: [this.selectGoodsData],
typeId: 0,
@@ -712,7 +748,7 @@
//获取相关关联课程商品
handleClickGetGoodsList(v) {
// console.log("data at line 313:", data);
if (v.type == 0) {
//免费
@@ -729,12 +765,17 @@
},
})
.then(async (res) => {
console.log("res at line 493:", res);
console.log("res at line 493:", res);
if (res.code == 0) {
this.getCourseDescriptionData();
// this.$commonJS.showToast("");
<<<<<<< .mine
}
=======
}
>>>>>>> .theirs
this.$forceUpdate();
});
} else {
@@ -750,7 +791,7 @@
"Content-Type": "application/json",
},
})
.then(async (res) => {
.then(async (res) => {
if (res.productList.length > 0) {
this.goodsList = res.productList;
this.selectGoodsData = this.goodsList[0];
@@ -761,7 +802,7 @@
}
this.$forceUpdate();
});
})
}
},
getUserInfo() {
@@ -1946,6 +1987,7 @@
}
.price {
// text-align: center;
font-size: 26rpx;
font-weight: bold;
@@ -2235,7 +2277,7 @@
/deep/.u-icon__icon--warning {
color: #fff !important;
}
/deep/.uni-tag{border-width: 2rpx !important;}
/deep/.uni-section {
background: transparent !important;
}