|
|
@ -12,6 +12,7 @@ |
|
|
|
:show-fullscreen-btn="false" |
|
|
|
:show-center-play-btn="true" |
|
|
|
@timeupdate="onTimeupdate" |
|
|
|
@ended="onTimeEnd" |
|
|
|
></video> |
|
|
|
<view class="info"> |
|
|
|
<view class="author">{{ detail.author || '' }}</view> |
|
|
@ -64,7 +65,6 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
async onLoad(option) { |
|
|
|
console.log('--onLoad', option) |
|
|
|
const { id, state, shareId } = option |
|
|
|
|
|
|
|
if (shareId) { |
|
|
@ -137,7 +137,8 @@ |
|
|
|
|
|
|
|
if (open) { |
|
|
|
this.isLocked = false |
|
|
|
this.$refs.popupQrCode.open() |
|
|
|
this.timeIsUp = false |
|
|
|
this.videoContext.play() |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
@ -149,7 +150,6 @@ |
|
|
|
}, |
|
|
|
async onPlay() { |
|
|
|
if (!this.isLocked) { |
|
|
|
this.$refs.popupQrCode.open() |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
@ -160,8 +160,11 @@ |
|
|
|
|
|
|
|
if (open) { // 转发已达标 |
|
|
|
this.isLocked = false |
|
|
|
this.$refs.popupQrCode.open() |
|
|
|
this.timeIsUp = false |
|
|
|
this.videoContext.play() |
|
|
|
} else { |
|
|
|
this.videoContext.pause() |
|
|
|
this.timeIsUp = true |
|
|
|
uni.showToast({ |
|
|
|
title: `还需转发${need_num - num}次`, |
|
|
|
icon: 'none', |
|
|
@ -172,13 +175,15 @@ |
|
|
|
async onTimeupdate(e) { |
|
|
|
const { currentTime } = e.target |
|
|
|
|
|
|
|
// todo: check |
|
|
|
if (currentTime >= this.detail.timeNum) { |
|
|
|
if (currentTime >= this.detail.timeNum && this.isLocked) { |
|
|
|
this.videoContext.pause() |
|
|
|
this.timeIsUp = true |
|
|
|
this.onPlay() |
|
|
|
} |
|
|
|
}, |
|
|
|
onTimeEnd() { |
|
|
|
this.$refs.popupQrCode.open() |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|