|
@ -12,6 +12,7 @@ |
|
|
:show-fullscreen-btn="false" |
|
|
:show-fullscreen-btn="false" |
|
|
:show-center-play-btn="true" |
|
|
:show-center-play-btn="true" |
|
|
@timeupdate="onTimeupdate" |
|
|
@timeupdate="onTimeupdate" |
|
|
|
|
|
@ended="onTimeEnd" |
|
|
></video> |
|
|
></video> |
|
|
<view class="info"> |
|
|
<view class="info"> |
|
|
<view class="author">{{ detail.author || '' }}</view> |
|
|
<view class="author">{{ detail.author || '' }}</view> |
|
@ -22,8 +23,9 @@ |
|
|
|
|
|
|
|
|
<uv-overlay :show="timeIsUp" @click="onPlay" zIndex="998"> |
|
|
<uv-overlay :show="timeIsUp" @click="onPlay" zIndex="998"> |
|
|
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-video.png"></popupUnlock> |
|
|
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-video.png"></popupUnlock> |
|
|
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode> |
|
|
|
|
|
</uv-overlay> |
|
|
</uv-overlay> |
|
|
|
|
|
|
|
|
|
|
|
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -52,7 +54,7 @@ |
|
|
}, |
|
|
}, |
|
|
timeIsUp: false, |
|
|
timeIsUp: false, |
|
|
isLocked: true, |
|
|
isLocked: true, |
|
|
videoContext: null |
|
|
|
|
|
|
|
|
videoContext: null, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
@ -64,7 +66,6 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async onLoad(option) { |
|
|
async onLoad(option) { |
|
|
console.log('--onLoad', option) |
|
|
|
|
|
const { id, state, shareId } = option |
|
|
const { id, state, shareId } = option |
|
|
|
|
|
|
|
|
if (shareId) { |
|
|
if (shareId) { |
|
@ -122,6 +123,11 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async initData() { |
|
|
async initData() { |
|
|
|
|
|
this.fetchCheckShare().then(result => { |
|
|
|
|
|
const { open } = result |
|
|
|
|
|
|
|
|
|
|
|
this.isLocked = !open |
|
|
|
|
|
}) |
|
|
await this.fetchDetails(this.id) |
|
|
await this.fetchDetails(this.id) |
|
|
|
|
|
|
|
|
this.videoContext = uni.createVideoContext('video'); |
|
|
this.videoContext = uni.createVideoContext('video'); |
|
@ -144,7 +150,8 @@ |
|
|
|
|
|
|
|
|
if (open) { |
|
|
if (open) { |
|
|
this.isLocked = false |
|
|
this.isLocked = false |
|
|
this.$refs.popupQrCode.open() |
|
|
|
|
|
|
|
|
this.timeIsUp = false |
|
|
|
|
|
this.videoContext.play() |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -156,7 +163,6 @@ |
|
|
}, |
|
|
}, |
|
|
async onPlay() { |
|
|
async onPlay() { |
|
|
if (!this.isLocked) { |
|
|
if (!this.isLocked) { |
|
|
this.$refs.popupQrCode.open() |
|
|
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -167,8 +173,11 @@ |
|
|
|
|
|
|
|
|
if (open) { // 转发已达标 |
|
|
if (open) { // 转发已达标 |
|
|
this.isLocked = false |
|
|
this.isLocked = false |
|
|
this.$refs.popupQrCode.open() |
|
|
|
|
|
|
|
|
this.timeIsUp = false |
|
|
|
|
|
this.videoContext.play() |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
this.videoContext.pause() |
|
|
|
|
|
this.timeIsUp = true |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: `还需转发${need_num - num}次`, |
|
|
title: `还需转发${need_num - num}次`, |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
@ -179,13 +188,15 @@ |
|
|
async onTimeupdate(e) { |
|
|
async onTimeupdate(e) { |
|
|
const { currentTime } = e.target |
|
|
const { currentTime } = e.target |
|
|
|
|
|
|
|
|
// todo: check |
|
|
|
|
|
if (currentTime >= this.detail.timeNum) { |
|
|
|
|
|
|
|
|
if (currentTime >= this.detail.timeNum && this.isLocked) { |
|
|
this.videoContext.pause() |
|
|
this.videoContext.pause() |
|
|
this.timeIsUp = true |
|
|
this.timeIsUp = true |
|
|
this.onPlay() |
|
|
this.onPlay() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
onTimeEnd() { |
|
|
|
|
|
this.$refs.popupQrCode.open() |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|