| xqd
@@ -49,6 +49,7 @@
|
|
|
object-fit="contain"
|
|
|
@timeupdate="timeupdate"
|
|
|
@ended="ended"
|
|
|
+ @play="play($event,item)"
|
|
|
/>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
| xqd
@@ -197,6 +198,12 @@ export default {
|
|
|
this.progress = 100
|
|
|
// #endif
|
|
|
},
|
|
|
+ play(e, item) {
|
|
|
+ console.log('-->data', e, item)
|
|
|
+ // #ifdef MP-KUAISHOU
|
|
|
+ this.handlePlay(item)
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
// 播放
|
|
|
handlePlay(item) {
|
|
|
this.currentEpisode = item
|
| xqd
@@ -204,6 +211,10 @@ export default {
|
|
|
if (!this.checkBeforePlay(item)) {
|
|
|
// 余额是否购买
|
|
|
if (!this.checkOverage(item)) {
|
|
|
+ // #ifdef MP-KUAISHOU
|
|
|
+ // 如果没有购买,那把视频链接设置为空 停止播放,使用 pause 和 stop 在真机上不生效 只能采用这种方式
|
|
|
+ item.url = ''
|
|
|
+ // #endif
|
|
|
this.rechargeShow = true
|
|
|
return
|
|
|
}
|
| xqd
@@ -214,6 +225,8 @@ export default {
|
|
|
this.isPlaying = true
|
|
|
item.isPlaying = true
|
|
|
// #ifdef MP-KUAISHOU
|
|
|
+ item.url = item.src
|
|
|
+ this.$forceUpdate()
|
|
|
setTimeout(() => {
|
|
|
this.videoContext.play()
|
|
|
}, 1000)
|
| xqd
@@ -225,7 +238,7 @@ export default {
|
|
|
this.watched(this.id, this.currentEpisode.id)
|
|
|
},
|
|
|
// 暂停
|
|
|
- handlePause(item, isAll) {
|
|
|
+ handlePause(item, isAll = false) {
|
|
|
if (!this.isPlaying) return
|
|
|
item.isPlaying = false
|
|
|
this.isPlaying = false
|
| xqd
@@ -260,7 +273,7 @@ export default {
|
|
|
async handleBuy() {
|
|
|
await this.$api.user.episode.buyHandle(this.id, this.currentEpisode.id).then(async res => {
|
|
|
this.$hideLoading()
|
|
|
- if (typeof res.overage !== 'undefined') {
|
|
|
+ if (typeof res.data.overage !== 'undefined') {
|
|
|
this.rechargeShow = true
|
|
|
} else {
|
|
|
this.$u.toast('购买成功')
|
| xqd
@@ -362,6 +375,7 @@ export default {
|
|
|
obj.isPlaying = false
|
|
|
obj.index = index
|
|
|
obj.progress = 0
|
|
|
+ obj.src = obj.url
|
|
|
})
|
|
|
this.lists = this.episode.lists
|
|
|
// 初始化 Swiper 剧集
|