diff --git a/mixins/pageListenMixins.js b/mixins/pageListenMixins.js index 3a2bee5..1f1ed59 100644 --- a/mixins/pageListenMixins.js +++ b/mixins/pageListenMixins.js @@ -13,6 +13,8 @@ export const pageListenMixins = { onShow() { this.pageViewDateTime = getCurrDateTime() this.pageToWatchShowCount(this.pageKeyId) + this.videoContext = uni.createVideoContext('indexVideo', this); + }, onUnload() { this.pageToHideHandle() diff --git a/pages/home/index.vue b/pages/home/index.vue index 9df4813..92c1bc7 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -166,16 +166,16 @@ --> - + - - - 点击进入 + + + 点击进入 @@ -383,7 +383,9 @@ export default { contentFestival: {}, pageKeyId: Object.freeze('appIndex'), scrollTop: 0, - lotteryCanDraw: false + lotteryCanDraw: false, + videoContext: null, + isPlay: true, } }, onLoad() { @@ -417,6 +419,17 @@ export default { this.scrollTop = e.scrollTop }, methods: { + played() { + this.isPlay = !this.isPlay + if(this.isPlay) { + this.videoContext.play() + } else { + this.videoContext.pause() + } + this.toKD() + }, + pause() { + }, toKD() { this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackList') },