Commit 71d1e388 authored by spc's avatar spc

brand md

parent af49fdfd
......@@ -62,11 +62,13 @@ const sensorLog = (evt) => {
trackObj[key] = logObj[key];
}
if (xcxPage && xcxPage.length > 0) {
console.warn("xcxPage", trackObj);
sensors.track("xcxPage", {
...trackObj,
});
}
if (xcxClick && xcxClick.length > 0) {
console.warn("xcxClick", trackObj);
sensors.track("xcxClick", {
...trackObj,
});
......
......@@ -237,8 +237,8 @@
</view>
<view v-if="showVideo" class="video-popup">
<video :src="currentVideoUrl" controls autoplay
:style="{ width: videoWidth + 'px', height: videoHeight + 'px' }"
@loadedmetadata="onVideoLoadedMeta" @play="onVideoPlay"></video>
:style="{ width: videoWidth + 'px', height: videoHeight + 'px' }" @loadedmetadata="onVideoLoadedMeta"
@play="onVideoPlay"></video>
<view class="close-btn-bottom" @tap="closeVideo">×</view>
</view>
</view>
......@@ -1116,7 +1116,7 @@ export default {
initVideoContexts() {
this.$nextTick(() => {
const videoIds = ['brandVideo1', 'brandVideo2'];
videoIds.forEach(id => {
try {
// 使用id创建视频上下文
......@@ -1135,15 +1135,40 @@ export default {
},
// 视频1播放事件
onVideo1Play() {
const evt = {
currentTarget: {
dataset: {
log: {
xcxClick: '品牌故事-次屏页面点击',
pageName: '品牌故事-首屏页面',
buttonName: '腰部品牌Video'
}
}
}
}
md.sensorLog(evt);
console.log('视频1开始播放');
this.handleVideoPlay('brandVideo1');
},
// 视频2播放事件
onVideo2Play() {
const evt = {
currentTarget: {
dataset: {
log: {
xcxClick: '小程序页面点击事件',
pageName: '品牌故事-次屏页面',
buttonName: '视频'
}
}
}
}
md.sensorLog(evt);
console.log('视频2开始播放');
this.handleVideoPlay('brandVideo2');
},
// 处理视频播放(互斥逻辑)
handleVideoPlay(videoId) {
console.log('处理视频播放:', videoId, '当前播放视频:', this.currentPlayingVideo);
......@@ -1176,7 +1201,7 @@ export default {
return;
}
}
if (this.videoContexts[videoId]) {
try {
this.videoContexts[videoId].pause();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment