Authored by QC-L

上报效果修改, 添加点击商详上报事件

... ... @@ -21,7 +21,7 @@
{{/ifcond}}
{{#ifcond layout_float '==' 'C'}}
{{#if data.prdList}}
<div class="resource-collage-buy-prd-list-c templates" data-id="{{@index}}" data-prd-list-length="{{data.prdList.length}}" data-prd-speed="{{speed}}">
<div class="resource-collage-buy-prd-list-c templates" data-f-name="{{../template_name}}" data-f-id="{{../template_id}}" data-id="{{@index}}" data-prd-list-length="{{data.prdList.length}}" data-prd-speed="{{speed}}">
{{!-- <div class="collage-buy-title">{{../template_intro}}</div> --}}
<div class="collage-buy-title">今日必拼</div>
<div class="swiper-container1 swiper-container">
... ...
<div class="banner-top templates" data-id="{{@index}}">
<div class="banner-top templates" data-f-name="{{template_name}}" data-f-id="{{template_id}}" data-id="{{@index}}">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper">
{{#each data}}
... ...
<div id='fixedTab' class="guess-like templates" data-id="{{@index}}">
<div id='fixedTab' class="guess-like templates" data-template-name="{{template_name}}" data-template-id="{{template_id}}" data-id="{{@index}}">
<div class="wapper">
<div class="guess-scroll">
{{#each data}}
... ...
<div class="new-index-filter-list-item" data-activity-id="{{activity_id}}" data-product-skn="{{product_skn}}">
<div class="new-index-filter-list-item" data-item-idx="{{@index}}" data-f-name="guessLike" data-f-id="595109" data-activity-id="{{activity_id}}" data-product-skn="{{product_skn}}">
<div class="group-product-header">
{{#ifcond joinLimitStr "==" "邀新团"}}
<div class="new-group-product-left-icon">
... ...
{{#data}}
<div class="resource-single templates" data-id="{{@index}}">
<div class="resource-single templates" data-f-name="{{../template_name}}" data-f-id="{{../template_id}}" data-id="{{@index}}">
{{#if title}}
<div class="title">
<div class='line'></div>
... ...
{{#data}}
<div class="split-image templates" data-id="{{@index}}" {{#ifcond ../is_extend '!==' '1'}}style="margin: 0 15px"{{/ifcond}}>
<div class="split-image templates" data-id="{{@index}}" data-f-name="{{../template_name}}" data-f-id="{{../template_id}}" {{#ifcond ../is_extend '!==' '1'}}style="margin: 0 15px"{{/ifcond}}>
<img src="{{image2 src w=../image_width h=../image_height q=60 mode=3}}"></img>
<div class='url-content'>
{{#each urls}}
... ...
<div class="new-index-filter-list-item" data-activity-id="{{activity_id}}" data-product-skn="{{product_skn}}">
<div class="new-index-filter-list-item" data-item-idx="{{@index}}" data-f-name="guessLike" data-f-id="595109" data-activity-id="{{activity_id}}" data-product-skn="{{product_skn}}">
<div class="group-product-header">
{{#ifcond joinLimitStr "==" "邀新团"}}
<div class="new-group-product-left-icon">
... ...
import qs from 'yoho-qs';
const yoho = require('js/yoho-app');
const _ = require('lodash');
class ResourceShowYasRpter {
constructor() {
... ... @@ -11,11 +12,9 @@ class ResourceShowYasRpter {
};
this.lastShowSkns = [];
window.onscroll = () => {
window.requestAnimationFrame(() => {
this.reportCtl();
});
};
window.onscroll = _.throttle(() => {
this.reportCtl();
}, 100);
this.report();
}
... ... @@ -44,7 +43,7 @@ class ResourceShowYasRpter {
this.timer = setTimeout(() => {
this.reportParams.DATA = [];
this.report();
}, 1000);
}, 300);
}
/**
... ... @@ -73,6 +72,8 @@ class ResourceShowYasRpter {
let $theFloor = $(theFloor);
let F_INDEX = $theFloor.data('id') + 1;
let floorsRawArr = []; // 当前展示楼层
let F_ID = $theFloor.data('f-id');
let F_NAME = $theFloor.data('f-name');
if ($.inviewport($theFloor, { threshold: 0 })) {
... ... @@ -87,7 +88,9 @@ class ResourceShowYasRpter {
floorsRawArr.push({
href: href,
I_INDEX: aIndex + 1,
F_INDEX
F_INDEX,
F_ID,
F_NAME
});
}
});
... ... @@ -102,7 +105,9 @@ class ResourceShowYasRpter {
floorsRawArr.push({
href: href,
I_INDEX: aIndex + 1,
F_INDEX
F_INDEX,
F_ID,
F_NAME
});
}
});
... ... @@ -123,7 +128,9 @@ class ResourceShowYasRpter {
href: '',
PRD_SKN: productSkn,
I_INDEX: itemIndex + 1,
F_INDEX
F_INDEX,
F_ID,
F_NAME
});
}
});
... ... @@ -136,6 +143,8 @@ class ResourceShowYasRpter {
P_PARAM: goodsRawObj.href && goodsRawObj.href.split('?')[0] || '',
F_INDEX: goodsRawObj.F_INDEX,
I_INDEX: goodsRawObj.I_INDEX,
F_ID: goodsRawObj.F_ID,
F_NAME: goodsRawObj.F_NAME
};
if (goodsRawObj.PRD_SKN) {
... ...
... ... @@ -214,8 +214,8 @@ class Group extends Page {
checkDetail(e) {
let $this = $(e.currentTarget);
let productSkn = $this.data('product-skn');
let isFloor = $this.data('is-floor');
let activityId = $this.data('activity-id');
let templateId = $this.data('template-id');
let isApp = $('.group').data('is-App');
let isiOS = yoho.isiOS;
let isAndroid = yoho.isAndroid;
... ... @@ -227,11 +227,20 @@ class Group extends Page {
if (isiOS) {
P_NAME = 'iFP_CollageHome';
}
if (isFloor) {
if (templateId) {
this.sendCustomInfo($this, {PRD_SKN: productSkn});
} else {
this.sendCustomInfo($this, {
F_ID: this.templateId,
F_NAME: this.templateName,
TAB_ID: this.tabName,
TAB_NAME: this.tabName,
F_INDEX: this.indexIdx
});
}
console.log(this.indexIdx);
if (isApp) {
let param = {
action: 'go.productDetail',
... ... @@ -248,7 +257,7 @@ class Group extends Page {
paramStr = `?activityId=${activityId}&productSkn=${productSkn}&openby:yohobuy=${paramStr}`;
window.location.href = `/activity/group/detail?${paramStr}`;
} else {
window.location.href = `/activity/group/detail?activityId=${activityId}&productSkn=${productSkn}`;
// window.location.href = `/activity/group/detail?activityId=${activityId}&productSkn=${productSkn}`;
}
}
... ... @@ -256,10 +265,18 @@ class Group extends Page {
let $this = $(e.currentTarget);
let query = $this.data('query');
let index = $this.data('index');
let tabName = $this.data('tab-name');
let templateName = $this.data('template-name');
let templateId = $this.data('template-id');
let indexIdx = $this.data('index-idx');
let queryObject = {};
let newNavType = this.judgeNavType(this.newFilterTab);
let newNav = this.newNavInfo[newNavType];
this.tabName = tabName;
this.templateId = templateId;
this.templateName = templateName;
this.indexIdx = indexIdx;
this.sendCustomInfo($this, {});
query.forEach(item => {
queryObject = Object.assign(queryObject, item);
... ... @@ -681,6 +698,14 @@ class Group extends Page {
// 筛选初始化
filterInit() {
$('.guess-scroll').find('div:first-child').children('div').addClass('guess-tab-active');
let first = $('.guess-scroll').find('div:first-child');
this.tabName = first.data('tab-name');
this.templateName = first.data('template-name');
this.templateId = first.data('template-id');
this.indexIdx = first.data('index-idx');
// let selectedChannel = this.selectedChannel;
// let requestParams = {
... ...