hookehuyr

feat(product): 添加预览前的登录验证和埋点统计

在商品详情页的预览功能中增加登录验证,未登录用户会收到提示
并引导至登录页面。同时添加预览操作的埋点统计,用于追踪用户行为
......@@ -366,7 +366,16 @@ export default {
});
}
},
preview (item) {
async preview (item) {
const canPreview = await this.ensureLogin({
title: '登录后可预览资料',
message: '当前预览操作需要先登录,是否现在前往登录页面?',
});
if (!canPreview) {
return;
}
// TAG: 统计埋点
this.maEvent({ p: 'h5_product/detail', event: 'document_preview' });
window.open(item.value, '_blank');
},
splitArrayIntoChunks(list) {
......
......@@ -366,7 +366,16 @@ export default {
});
}
},
preview (item) {
async preview (item) {
const canPreview = await this.ensureLogin({
title: '登录后可预览资料',
message: '当前预览操作需要先登录,是否现在前往登录页面?',
});
if (!canPreview) {
return;
}
// TAG: 统计埋点
this.maEvent({ p: 'h5_product/detail_lite', event: 'document_preview' });
window.open(item.value, '_blank');
},
splitArrayIntoChunks(list) {
......