...
|
...
|
@@ -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
|
|
|
};
|
|
|
|
...
|
...
|
|