Authored by shuaiguo

Merge remote-tracking branch 'refs/remotes/origin/feature/group-6.9.17' into release/6.9.17

... ... @@ -3,7 +3,7 @@
<div class="guess-scroll">
{{#each data}}
{{#ifcond @index '==' 0}}
<div id="tab-{{@index}}" data-template-name="{{../template_name}}" data-tab-name="{{tab_name}}" data-template-id="{{../template_id}}" data-index="{{@index}}" data-index-idx="{{@../index}}" data-item-idx="{{@index}}" class="guess-tab first" data-query="{{queryString}}" data-code="{{resources_code}}">
<div id="tab-{{@index}}" data-template-name="{{../template_name}}" data-tab-name="{{tab_name}}" data-template-id="{{../template_id}}" data-index="{{@index}}" data-index-idx="{{@index}}" data-item-idx="{{@index}}" class="guess-tab first" data-query="{{queryString}}" data-code="{{resources_code}}">
{{#if src}}
<img class="guess-img" src="{{image2 src w=200 h=160 q=60 mode=3}}" />
<div class=""></div>
... ...
... ... @@ -3,7 +3,7 @@
<img src="{{image2 src w=../image_width h=../image_height q=60 mode=3}}"></img>
<div class='url-content'>
{{#each urls}}
<div class="split-item" data-item-idx="{{@index}}" data-template-name="{{../../template_name}}" data-template-id="{{../../template_id}}" data-index-idx="{{@../../index}}" data-href="{{this}}" >
<div class="split-item" data-item-idx="{{@index}}" data-template-name="{{../../template_name}}" data-template-id="{{../../template_id}}" data-index-idx="{{@../index}}" data-href="{{this}}" >
{{!-- <a id="{{../../template_id}}" name="{{../../template_intro}}"> --}}
<div class='placeholder'></div>
{{!-- </a> --}}
... ...
... ... @@ -5,8 +5,8 @@
<span class="new-group-product-left-icon-number"></span>
</div>
{{/ifcond}} --}}
{{#if cover_info}}
<img src="{{cover_info.list_bg_img}}" class="list-bg-icon" alt="list_icon">
{{#if icon}}
<img src="{{icon}}" class="list-bg-icon" alt="list_icon">
{{/if}}
{{#if @root.lazyLoad}}
<img class="lazy new-group-product-image" data-original="{{image2 default_images w=400 h=390 q=60 mode=3}}" />
... ...
... ... @@ -67,15 +67,22 @@ class ResourceShowYasRpter {
report() {
let cacheTheShowSkns = []; // 暂存此次上报的楼层,上报后复制给 lastReportSkns
let tabParams = {};
tabParams.TAB_NAME = $('.guess-like-tab-active').parent().data('tab-name');
tabParams.TAB_ID = $('.guess-like-tab-active').parent().data('item-idx') + 1;
tabParams.P_PARAM = $('.guess-like-tab-active').parent().data('code');
$('.templates').each((floorIndex, theFloor) => {
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');
let F_ID = $theFloor.data('f-id') || $theFloor.data('template-id');
let F_NAME = $theFloor.data('f-name') || $theFloor.data('template-name');
if (F_NAME === 'guessLike') {
return;
}
if ($.inviewport($theFloor, { threshold: 0 })) {
// 楼层可见
$theFloor.find('ul > li').each((aIndex, theA) => {
... ... @@ -144,7 +151,8 @@ class ResourceShowYasRpter {
F_INDEX: goodsRawObj.F_INDEX,
I_INDEX: goodsRawObj.I_INDEX,
F_ID: goodsRawObj.F_ID,
F_NAME: goodsRawObj.F_NAME
F_NAME: goodsRawObj.F_NAME,
...tabParams
};
if (goodsRawObj.PRD_SKN) {
... ... @@ -201,7 +209,8 @@ class ResourceShowYasRpter {
F_NAME: goodsRawObj.F_NAME,
TAB_NAME: goodsRawObj.TAB_NAME,
PRD_SKN: goodsRawObj.PRD_SKN,
ACTION_URL: ''
ACTION_URL: '',
...tabParams
};
this.reportParams.DATA.push(newParams);
... ...
... ... @@ -209,16 +209,11 @@ class Group extends Page {
}
}
}
checkDetail(e) {
let $this = $(e.currentTarget);
let productSkn = $this.data('product-skn');
let activityId = $this.data('activity-id');
let templateId = $this.data('template-id');
let isApp = $('.group').data('is-App');
getPname() {
let isiOS = yoho.isiOS;
let isAndroid = yoho.isAndroid;
let P_NAME = 'hFP_CollageHome';
let P_NAME = 'h5FP_CollageHome';
if (isAndroid) {
P_NAME = 'aFP_CollageHome';
... ... @@ -226,20 +221,30 @@ class Group extends Page {
if (isiOS) {
P_NAME = 'iFP_CollageHome';
}
return P_NAME;
}
checkDetail(e) {
this.setDefaultTabParams();
let $this = $(e.currentTarget);
let productSkn = $this.data('product-skn');
let activityId = $this.data('activity-id');
let templateId = $this.data('template-id');
let isApp = $('.group').data('is-App');
let P_NAME = this.getPname();
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_ID: this.tabId,
TAB_NAME: this.tabName,
F_INDEX: this.indexIdx
});
}
console.log(this.indexIdx);
if (isApp) {
let param = {
action: 'go.productDetail',
... ... @@ -277,7 +282,8 @@ class Group extends Page {
this.tabName = tabName;
this.templateId = templateId;
this.templateName = templateName;
this.indexIdx = indexIdx;
this.tabId = indexIdx;
this.contentCode = code;
let stateObj = {
tab_name: this.tabName,
index_idx: this.indexIdx,
... ... @@ -289,7 +295,9 @@ class Group extends Page {
window.history.replaceState(stateObj, 'page', valiable);
this.sendCustomInfo($this, {});
this.sendTabInfo($this, {});
// this.sendCustomInfo($this, {});
query.forEach(item => {
queryObject = Object.assign(queryObject, item);
});
... ... @@ -299,7 +307,8 @@ class Group extends Page {
let lastDom = document.getElementById(`tab-${index - 2}`);
$('.wapper').animate({scrollLeft: lastDom && lastDom.offsetLeft || 0});
this.scrollSmoothTo(document.getElementById('resources').offsetTop);
// this.scrollSmoothTo(document.getElementById('resources').offsetTop);
// if (document.getElementById('fixedTab').offsetTop) {
// this.scrollSmoothTo(document.getElementById('fixedTab').offsetTop);
... ... @@ -316,9 +325,11 @@ class Group extends Page {
code: code
}).then(res => {
that.renderFloor(res);
this.scrollSmoothTo(document.getElementById('resources').offsetTop); // 保证新资源位渲染再滚动,防止上报数据错误
});
} else {
$('.floors').html('');
this.scrollSmoothTo(document.getElementById('resources').offsetTop);
}
this.fetchGoodsList(queryObject).then(data => {
... ... @@ -349,29 +360,56 @@ class Group extends Page {
}
step();
}
setDefaultTabParams() {
// 默认tab
if (typeof this.tabId === 'undefined' || typeof this.tabName === 'undefined') {
this.tabName = this.selector.guessLike.first().data('tab-name');
this.tabId = this.selector.guessLike.first().data('item-idx');
this.contentCode = this.selector.guessLike.first().data('code');
}
}
jumpToUrl(e) {
let $this = $(e.currentTarget);
this.setDefaultTabParams();
this.sendCustomInfo($this, {ACTION_URL: $this.data('href')});
window.location.href = $this.data('href');
}
sendTabInfo($this, custom_params) {
let itemIdx = $this.data('item-idx');
let tabName = $this.data('tab-name');
let params = {
TAB_ID: itemIdx + 1,
TAB_NAME: tabName || '',
...custom_params
};
window._yas && window._yas.sendCustomInfo && window._yas.sendCustomInfo({
op: 'YB_GROUP_TAB_C',
appop: 'YB_GROUP_TAB_C',
param: JSON.stringify(params)
}, true);
}
sendCustomInfo($this, custom_params) {
let templateName = $this.data('template-name');
let templateId = $this.data('template-id');
let itemIdx = $this.data('item-idx');
let indexIdx = $this.data('index-idx');
let tabName = $this.data('tab-name');
// let tabName = $this.data('tab-name');
let params = {
P_NAME: this.getPname(),
F_ID: templateId,
F_NAME: templateName,
F_INDEX: indexIdx + 1,
I_INDEX: itemIdx + 1,
ACTION_URL: '', // 拼团不传
TAB_ID: '',
TAB_NAME: tabName || '',
TAB_ID: this.tabId + 1,
TAB_NAME: this.tabName,
P_PARAM: this.contentCode,
...custom_params
};
... ...
... ... @@ -189,8 +189,9 @@
.list-bg-icon {
position: absolute;
top: 40px;
top: 20px;
left: 30px;
height: 26px;
height: 60px;
width: 60px;
}
}
... ...