Commit e3268191 authored by 王炽's avatar 王炽

66666

parent 4621e78b
...@@ -134,7 +134,13 @@ ...@@ -134,7 +134,13 @@
:class="getGoodsListClass()"> :class="getGoodsListClass()">
<view v-for="(good, goodIndex) in creditsSaleData.sessions[currentSessionIndex]?.goods || []" <view v-for="(good, goodIndex) in creditsSaleData.sessions[currentSessionIndex]?.goods || []"
:key="goodIndex" class="credits_sale_good_item" :key="goodIndex" class="credits_sale_good_item"
@click="handleCreditsSaleClickThrottled(good)"> @click="handleCreditsSaleClickThrottled(good, $event)" :data-comlog="{
xcxComponentClick: 'true',
xcxComponentExposure: 'true',
pageName: '积分服务页',
componentName: '积分限时购',
componentContent: good.name
}">
<!-- 商品图片 --> <!-- 商品图片 -->
<view class="good_image_placeholder"> <view class="good_image_placeholder">
<image v-if="good.image" :src="good.image" mode="aspectFill" class="good_image" /> <image v-if="good.image" :src="good.image" mode="aspectFill" class="good_image" />
...@@ -665,15 +671,20 @@ const mapSeckillDataToCreditsSale = (seckillData) => { ...@@ -665,15 +671,20 @@ const mapSeckillDataToCreditsSale = (seckillData) => {
}; };
// 处理积分抢购点击事件 // 处理积分抢购点击事件
const handleCreditsSaleClick = (good) => { const handleCreditsSaleClick = (good, event) => {
console.log('点击抢购商品:', good); console.log('点击抢购商品:', good);
md.sensorComponentLogTake({ if (event) {
xcxComponentClick: "true", if (event.currentTarget.dataset.comlog) {
pageName: "积分服务页", md.sensorComponentLog(event);
componentName: "积分限时购", }
componentContent: good.name }
}); // md.sensorComponentLogTake({
// xcxComponentClick: "true",
// pageName: "积分服务页",
// componentName: "积分限时购",
// componentContent: good.name
// });
// 获取当前活动ID和场次Key // 获取当前活动ID和场次Key
const activityId = creditsSaleData.value.activityId; const activityId = creditsSaleData.value.activityId;
const sessionKey = creditsSaleData.value.sessions[currentSessionIndex.value]?.sessionKey; const sessionKey = creditsSaleData.value.sessions[currentSessionIndex.value]?.sessionKey;
...@@ -681,7 +692,9 @@ const handleCreditsSaleClick = (good) => { ...@@ -681,7 +692,9 @@ const handleCreditsSaleClick = (good) => {
}; };
// 创建防连点的点击处理函数 // 创建防连点的点击处理函数
const handleCreditsSaleClickThrottled = throttleTap(handleCreditsSaleClick, 1000); const handleCreditsSaleClickThrottled = throttleTap((good, event) => {
handleCreditsSaleClick(good, event);
}, 1000);
// 生成测试数据 // 生成测试数据
const generateTestSeckillData = () => { const generateTestSeckillData = () => {
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<script setup> <script setup>
import { defineProps, defineEmits, onMounted } from 'vue'; import { defineProps, defineEmits, onMounted } from 'vue';
import { throttleTap } from '../../utils';
// Props 定义 // Props 定义
const props = defineProps({ const props = defineProps({
...@@ -76,11 +77,11 @@ onMounted(() => { ...@@ -76,11 +77,11 @@ onMounted(() => {
}); });
// 去邀请按钮点击事件 // 去邀请按钮点击事件
const handleInviteClick = () => { const handleInviteClick = throttleTap(() => {
console.log('去邀请按钮点击'); console.log('去邀请按钮点击');
emit('invite'); emit('invite');
}; }, 1000);
......
...@@ -311,7 +311,17 @@ ...@@ -311,7 +311,17 @@
<scroll-view class="benefits_list" scroll-x="true" show-scrollbar="false"> <scroll-view class="benefits_list" scroll-x="true" show-scrollbar="false">
<view class="benefits_container" <view class="benefits_container"
:class="{ 'few-items': benefitList.length <= 2, 'single-item': benefitList.length === 1 }"> :class="{ 'few-items': benefitList.length <= 2, 'single-item': benefitList.length === 1 }">
<view class="benefit_item" @click="handleExchangeClick(benefit, index)" v-for="(benefit, index) in benefitList" :key="index"> <view class="benefit_item"
v-for="(benefit, index) in benefitList"
:key="index"
:data-comlog="{
xcxComponentClick: 'true',
xcxComponentExposure: 'true',
pageName: '积分服务页',
componentName: '异业券权益',
componentContent: `${benefit?.goodsName}`
}"
@click="handleExchangeClick(benefit, index, $event)">
<!-- 权益图片 --> <!-- 权益图片 -->
<view class="benefit_image"> <view class="benefit_image">
<image class="benefit_img" :src="benefit.goodsLogo" mode="aspectFill" /> <image class="benefit_img" :src="benefit.goodsLogo" mode="aspectFill" />
...@@ -383,7 +393,13 @@ ...@@ -383,7 +393,13 @@
background: `url(${$baseUrl}integral/1022/listItemImgBg${itemIndex}.png) no-repeat center/contain` background: `url(${$baseUrl}integral/1022/listItemImgBg${itemIndex}.png) no-repeat center/contain`
}"> --> }"> -->
<view class="goods-item" v-for="(goodItem, i) in goodItemList?.resourcePositionGoods" :key="i"> <view class="goods-item" v-for="(goodItem, i) in goodItemList?.resourcePositionGoods" :key="i">
<view class="goods-item-container" @click="handleGoodsItemClick(goodItem, i)"> <view class="goods-item-container" :data-comlog="{
xcxComponentClick: 'true',
xcxComponentExposure: 'true',
pageName: '积分服务页',
componentName: '积分商品',
componentContent: `${goodItemList?.resourcePositionName}-${goodItem?.goodsName}`
}" @click="handleGoodsItemClick(goodItem, i, $event)">
<image class="goods-img" <image class="goods-img"
:src="goodItem?.goodsIcon.indexOf('http') !== -1 ? goodItem?.goodsIcon : $baseUrl + `${goodItem?.goodsIcon}`" :src="goodItem?.goodsIcon.indexOf('http') !== -1 ? goodItem?.goodsIcon : $baseUrl + `${goodItem?.goodsIcon}`"
mode="scaleToFill" /> mode="scaleToFill" />
...@@ -537,7 +553,7 @@ import { onShareAppMessage } from '@dcloudio/uni-app'; ...@@ -537,7 +553,7 @@ import { onShareAppMessage } from '@dcloudio/uni-app';
import { fetchIntegralJSON, fetchBatchReceiveJSON, taskCompleteJSON } from '../api/integral'; import { fetchIntegralJSON, fetchBatchReceiveJSON, taskCompleteJSON } from '../api/integral';
import RegisterLayer from "../components/RegisterLayer.vue"; import RegisterLayer from "../components/RegisterLayer.vue";
import { showLoading, hideLoading } from '../utils' import { showLoading, hideLoading, throttleTap } from '../utils'
import xinrenli from '../components/quanyi/xinrenli.vue' import xinrenli from '../components/quanyi/xinrenli.vue'
import md from '../md'; import md from '../md';
import mianfeiwenzhen from '../components/quanyi/mianfeiwenzhen.vue'; import mianfeiwenzhen from '../components/quanyi/mianfeiwenzhen.vue';
...@@ -1760,22 +1776,22 @@ const getWeekdayLabel = (day) => { ...@@ -1760,22 +1776,22 @@ const getWeekdayLabel = (day) => {
// 监听 scrollTop 变化 // 监听 scrollTop 变化
watch(() => props.scrollTop, (newVal) => { watch(() => props.scrollTop, (newVal) => {
console.log('scrollTop 变化:', newVal) // console.log('scrollTop 变化:', newVal)
// 执行相关逻辑,如曝光检测 // 执行相关逻辑,如曝光检测
if (newVal > 650 && newVal < 1200) { if (newVal > 650 && newVal < 1200) {
if(mdMap.value.indexOf('异业券权益') == -1) { // if(mdMap.value.indexOf('异业券权益') == -1) {
mdMap.value.push('异业券权益'); // mdMap.value.push('异业券权益');
if(benefitList.value.length > 0) { // if(benefitList.value.length > 0) {
md.sensorComponentLogTake({ // md.sensorComponentLogTake({
xcxComponentExposure: "true", // xcxComponentExposure: "true",
pageName: "积分服务页", // pageName: "积分服务页",
componentName: "异业券权益", // componentName: "异业券权益",
componentContent: "异业券权益" // componentContent: "异业券权益"
}); // });
} // }
} // }
if(mdMap.value.indexOf('邀请记录曝光') == -1) { if(mdMap.value.indexOf('邀请记录曝光') == -1) {
mdMap.value.push('邀请记录曝光'); mdMap.value.push('邀请记录曝光');
...@@ -2411,18 +2427,24 @@ const convertType = (type, url, extra = {}) => { ...@@ -2411,18 +2427,24 @@ const convertType = (type, url, extra = {}) => {
//商品点击 //商品点击
const handleGoodsItemClick = (goodsItem, googidx) => { const handleGoodsItemClick = throttleTap((goodsItem, googidx, event) => {
console.log('handleGoodsItemClick:', goodsItem, googidx); console.log('handleGoodsItemClick:', goodsItem, googidx);
const tabname = goodsDataArr[activeIndex.value].resourcePositionName; if (event) {
const buttonName = goodsItem.goodsName; if (event.currentTarget.dataset.comlog) {
md.sensorComponentLog(event);
}
}
md.sensorComponentLogTake({ // const tabname = goodsDataArr[activeIndex.value].resourcePositionName;
xcxComponentClick: "true", // const buttonName = goodsItem.goodsName;
pageName: "积分服务页",
componentName: "积分商品", // md.sensorComponentLogTake({
componentContent: tabname + '-' + buttonName // xcxComponentClick: "true",
}); // pageName: "积分服务页",
// componentName: "积分商品",
// componentContent: tabname + '-' + buttonName
// });
// let buttonName0 = ''; // let buttonName0 = '';
// let buttonName1 = ''; // let buttonName1 = '';
...@@ -2470,7 +2492,7 @@ const convertType = (type, url, extra = {}) => { ...@@ -2470,7 +2492,7 @@ const convertType = (type, url, extra = {}) => {
url: url, url: url,
extra: extra, extra: extra,
}) })
} }, 1000);
const handleScroll = (e) => { const handleScroll = (e) => {
const currentIndex = e.detail.current; const currentIndex = e.detail.current;
...@@ -2835,7 +2857,7 @@ const handleHelpClick = () => { ...@@ -2835,7 +2857,7 @@ const handleHelpClick = () => {
} }
// 签到按钮点击事件 // 签到按钮点击事件
const handleSigninClick = async () => { const handleSigninClick = throttleTap(async () => {
console.log('签到按钮点击'); console.log('签到按钮点击');
md.sensorComponentLogTake({ md.sensorComponentLogTake({
...@@ -2868,7 +2890,7 @@ const handleSigninClick = async () => { ...@@ -2868,7 +2890,7 @@ const handleSigninClick = async () => {
icon: 'none' icon: 'none'
}); });
} }
} }, 1000);
// 关闭签到提示弹窗 // 关闭签到提示弹窗
const handleCloseSignedTips = () => { const handleCloseSignedTips = () => {
...@@ -2916,15 +2938,21 @@ const handleCloseGongzhonghaoPop = () => { ...@@ -2916,15 +2938,21 @@ const handleCloseGongzhonghaoPop = () => {
} }
// 处理异业券兑换点击 // 处理异业券兑换点击
const handleExchangeClick = (benefit, index) => { const handleExchangeClick = throttleTap((benefit, index, event) => {
console.log('兑换权益:', benefit); console.log('兑换权益:', benefit);
md.sensorComponentLogTake({ if (event) {
xcxComponentClick: "true", if (event.currentTarget.dataset.comlog) {
pageName: "积分服务页", md.sensorComponentLog(event);
componentName: "异业券权益", }
componentContent: benefit.goodsName }
});
// md.sensorComponentLogTake({
// xcxComponentClick: "true",
// pageName: "积分服务页",
// componentName: "异业券权益",
// componentContent: benefit.goodsName
// });
if (!islogin.value) { if (!islogin.value) {
needReinit.value = true; needReinit.value = true;
...@@ -2935,13 +2963,6 @@ const handleExchangeClick = (benefit, index) => { ...@@ -2935,13 +2963,6 @@ const handleExchangeClick = (benefit, index) => {
return; return;
} }
// 埋点统计
md.sensorLogTake({
xcxClick: "积分服务页-异业券权益页面点击",
pageName: "积分服务页-异业券权益",
buttonName: `兑换权益-${benefit.name}`,
});
jump({ jump({
type: JumpType.INNER, type: JumpType.INNER,
...@@ -2966,7 +2987,7 @@ const handleExchangeClick = (benefit, index) => { ...@@ -2966,7 +2987,7 @@ const handleExchangeClick = (benefit, index) => {
// icon: 'success' // icon: 'success'
// }); // });
// } // }
} }, 1000);
// 处理邀请按钮点击 // 处理邀请按钮点击
const handleInviteClick = () => { const handleInviteClick = () => {
......
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