chore(电子名片): 支持点击视频号视频,观看次数+1
This commit is contained in:
@@ -225,6 +225,10 @@ export default {
|
|||||||
promiseCallback: async (event, handler, awaitedResult) => {
|
promiseCallback: async (event, handler, awaitedResult) => {
|
||||||
if (!awaitedResult) return;
|
if (!awaitedResult) return;
|
||||||
try {
|
try {
|
||||||
|
// 发送视频被点击播放事件
|
||||||
|
this.$emit('channel-video-click-play', item);
|
||||||
|
console.log('播放视频:', item);
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 在微信小程序环境中调用视频播放接口
|
// 在微信小程序环境中调用视频播放接口
|
||||||
await wechatChannelUtil.playVideo(item);
|
await wechatChannelUtil.playVideo(item);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 跳转式视频播放 -->
|
<!-- 跳转式视频播放 -->
|
||||||
<view v-else @tap="playVideo" class="video-container">
|
<view v-else @tap.stop="playVideo" @click.stop="playVideo" class="video-container">
|
||||||
<view class="video-cover-wrap" :style="coverStyle">
|
<view class="video-cover-wrap" :style="coverStyle">
|
||||||
<image class="video-cover" :src="$util.img(value.coverUrl)" mode="aspectFill"></image>
|
<image class="video-cover" :src="$util.img(value.coverUrl)" mode="aspectFill"></image>
|
||||||
<view class="channel-play-btn" v-if="showPlayBtn" :style="playBtnStyle">
|
<view class="channel-play-btn" v-if="showPlayBtn" :style="playBtnStyle">
|
||||||
@@ -182,6 +182,10 @@ export default {
|
|||||||
console.log('playload', playload);
|
console.log('playload', playload);
|
||||||
this.$emit('video-play', playload);
|
this.$emit('video-play', playload);
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
this.$emit('video-play', this.value);
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -101,8 +101,8 @@
|
|||||||
<diy-channel-list :value="{
|
<diy-channel-list :value="{
|
||||||
showStyle: 'fixed',
|
showStyle: 'fixed',
|
||||||
rowCount: 1,
|
rowCount: 1,
|
||||||
list: channelList
|
list: channelList,
|
||||||
}" />
|
}" @channel-video-click-play="onChannelVideoClickPlay"/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 地图 -->
|
<!-- 地图 -->
|
||||||
@@ -289,6 +289,20 @@ export default {
|
|||||||
shareUtil.shareFile(file);
|
shareUtil.shareFile(file);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onChannelVideoClickPlay(item) {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/member/incrementChannelViewCount',
|
||||||
|
data: {
|
||||||
|
channel_id: item.channelId
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// 播放视频
|
// 播放视频
|
||||||
playVideo(video) {
|
playVideo(video) {
|
||||||
// 实现视频播放逻辑
|
// 实现视频播放逻辑
|
||||||
|
|||||||
Reference in New Issue
Block a user