|
|
@ -62,7 +62,7 @@ |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
if (this.id && uni.getStorageSync('token')) { |
|
|
|
this.initData() |
|
|
|
this.detail.id ? this.refreshLockStatus() : this.initData() |
|
|
|
} |
|
|
|
}, |
|
|
|
async onLoad(option) { |
|
|
@ -110,8 +110,6 @@ |
|
|
|
} |
|
|
|
this.$fetch('addLogShareInfo', params) |
|
|
|
|
|
|
|
this.refreshLockStatus() |
|
|
|
|
|
|
|
return o |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -123,11 +121,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
async initData() { |
|
|
|
this.fetchCheckShare().then(result => { |
|
|
|
const { open } = result |
|
|
|
|
|
|
|
this.isLocked = !open |
|
|
|
}) |
|
|
|
this.isLocked = true |
|
|
|
await this.fetchDetails(this.id) |
|
|
|
|
|
|
|
this.videoContext = uni.createVideoContext('video'); |
|
|
@ -139,51 +133,22 @@ |
|
|
|
return {} |
|
|
|
} |
|
|
|
}, |
|
|
|
async refreshLockStatus() { |
|
|
|
|
|
|
|
const result = await this.fetchCheckShare() |
|
|
|
const { title, open } = result |
|
|
|
|
|
|
|
console.log('--open', open) |
|
|
|
|
|
|
|
this.$refs.popupUnlock.close(); |
|
|
|
|
|
|
|
if (open) { |
|
|
|
this.isLocked = false |
|
|
|
this.timeIsUp = false |
|
|
|
refreshLockStatus() { |
|
|
|
this.isLocked = false |
|
|
|
this.timeIsUp = false |
|
|
|
setTimeout(() => { |
|
|
|
this.videoContext.play() |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
title && uni.showToast({ |
|
|
|
title, |
|
|
|
icon: 'none' |
|
|
|
console.log('--play') |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
async onPlay() { |
|
|
|
if (!this.isLocked) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const result = await this.fetchCheckShare() |
|
|
|
const { open, need_num, num } = result |
|
|
|
|
|
|
|
console.log('--open', open) |
|
|
|
|
|
|
|
if (open) { // 转发已达标 |
|
|
|
this.isLocked = false |
|
|
|
this.timeIsUp = false |
|
|
|
this.videoContext.play() |
|
|
|
} else { |
|
|
|
this.videoContext.pause() |
|
|
|
this.timeIsUp = true |
|
|
|
uni.showToast({ |
|
|
|
title: `还需转发${need_num - num}次`, |
|
|
|
icon: 'none', |
|
|
|
}) |
|
|
|
this.$refs.popupUnlock.open(); |
|
|
|
} |
|
|
|
|
|
|
|
this.videoContext.pause() |
|
|
|
this.timeIsUp = true |
|
|
|
this.$refs.popupUnlock.open(); |
|
|
|
}, |
|
|
|
async onTimeupdate(e) { |
|
|
|
const { currentTime } = e.target |
|
|
|