diff --git a/components-diy/diy-channel-list.vue b/components-diy/diy-channel-list.vue index 13b97c9..beb41b5 100644 --- a/components-diy/diy-channel-list.vue +++ b/components-diy/diy-channel-list.vue @@ -225,6 +225,10 @@ export default { promiseCallback: async (event, handler, awaitedResult) => { if (!awaitedResult) return; try { + // 发送视频被点击播放事件 + this.$emit('channel-video-click-play', item); + console.log('播放视频:', item); + // #ifdef MP-WEIXIN // 在微信小程序环境中调用视频播放接口 await wechatChannelUtil.playVideo(item); @@ -233,7 +237,7 @@ export default { // #ifndef MP-WEIXIN // 在非微信小程序环境中,直接触发事件 this.$emit('video-play', item); - // #endif + // #endif } catch (err) { console.error('打开视频号失败', err); } diff --git a/components-diy/diy-channel-video.vue b/components-diy/diy-channel-video.vue index 94a4d28..00183c6 100644 --- a/components-diy/diy-channel-video.vue +++ b/components-diy/diy-channel-video.vue @@ -25,7 +25,7 @@ - + @@ -180,8 +180,12 @@ export default { finderUserName: this.finderUserName } console.log('playload', playload); - this.$emit('video-play', playload); - // #endif + this.$emit('video-play', playload); + // #endif + + // #ifdef H5 + this.$emit('video-play', this.value); + // #endif } } }; diff --git a/pages_tool/contact/contact.vue b/pages_tool/contact/contact.vue index 06e5518..6a6a86a 100644 --- a/pages_tool/contact/contact.vue +++ b/pages_tool/contact/contact.vue @@ -101,8 +101,8 @@ + list: channelList, + }" @channel-video-click-play="onChannelVideoClickPlay"/> @@ -289,6 +289,20 @@ export default { shareUtil.shareFile(file); }, + onChannelVideoClickPlay(item) { + this.$api.sendRequest({ + url: '/api/member/incrementChannelViewCount', + data: { + channel_id: item.channelId + }, + success: res => { + + }, + fail: res => { + } + }); + }, + // 播放视频 playVideo(video) { // 实现视频播放逻辑