...
|
...
|
@@ -117,7 +117,6 @@ export default { |
|
|
}
|
|
|
|
|
|
this.scrollEvent = throttle(this.onDounceScroll.bind(this), throttleTime);
|
|
|
this.reportShow = this.startReportShow();
|
|
|
this.colWidthForTwo = Math.floor(this.$el.offsetWidth / 2);
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
@@ -191,7 +190,7 @@ export default { |
|
|
this.scrollEvent(params);
|
|
|
}, throttleTime);
|
|
|
},
|
|
|
onDounceScroll({item, scrollTop, startIndex}) {
|
|
|
onDounceScroll({item, scrollTop, startIndex, items}) {
|
|
|
if (this.scrollTop === scrollTop) {
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -206,12 +205,7 @@ export default { |
|
|
this.headerAnimateStep = Math.max(Math.min(step, 100), 0);
|
|
|
}
|
|
|
|
|
|
if (+get(item, 'data.dataType') === 1) {
|
|
|
if (this._currentId !== item.data.articleId) {
|
|
|
this._currentId = item.data.articleId;
|
|
|
this.reportShow(--startIndex, item);
|
|
|
}
|
|
|
}
|
|
|
this.reportArticleShow(items);
|
|
|
},
|
|
|
init() {
|
|
|
this.page = 1;
|
...
|
...
|
@@ -298,10 +292,8 @@ export default { |
|
|
this.reload = false;
|
|
|
});
|
|
|
},
|
|
|
onInited(item) {
|
|
|
if (item) {
|
|
|
this.reportShow(0, item);
|
|
|
}
|
|
|
onInited(items) {
|
|
|
this.reportArticleShow(items);
|
|
|
},
|
|
|
onFollow(data, follow) {
|
|
|
this.CHANGE_AUTHOR_FOLLOW({authorUid: data.authorUid, authorType: data.authorType, follow, type: this.type});
|
...
|
...
|
@@ -347,40 +339,50 @@ export default { |
|
|
}
|
|
|
});
|
|
|
},
|
|
|
startReportShow() {
|
|
|
let preview = null;
|
|
|
let name = this.$yoho.isiOS ? 'iFP_TopicList' : 'aFP_TopicList';
|
|
|
reportArticleShow(items) {
|
|
|
if (!items || !items.length) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
return (index, item) => {
|
|
|
if (preview === item.data.articleId) {
|
|
|
return;
|
|
|
this._preReportArticles = this._preReportArticles|| {};
|
|
|
|
|
|
let reportArticles = {};
|
|
|
let articles = [];
|
|
|
|
|
|
items.forEach(val => {
|
|
|
let item = val.data || {};
|
|
|
|
|
|
reportArticles[item.articleId] = 1;
|
|
|
|
|
|
if (item.articleId && !this._preReportArticles[item.articleId]) {
|
|
|
articles.push(val);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this._preReportArticles = reportArticles;
|
|
|
|
|
|
preview = item.data.articleId;
|
|
|
if (articles.length) {
|
|
|
let name = this.$yoho.isiOS ? 'iFP_TopicList' : 'aFP_TopicList';
|
|
|
|
|
|
this.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
appop: YAS.eventName.show,
|
|
|
param: {
|
|
|
DATA: [{
|
|
|
P_NAME: name,
|
|
|
P_PARAM: preview,
|
|
|
I_INDEX: index,
|
|
|
ARTICLE_ID: preview,
|
|
|
POS_ID: this.posId
|
|
|
}, ...(item.data.productList || []).map(p => {
|
|
|
return {
|
|
|
P_NAME: name,
|
|
|
P_PARAM: preview,
|
|
|
I_INDEX: index,
|
|
|
PRD_SKN: p.productSkn,
|
|
|
POS_ID: this.posId
|
|
|
};
|
|
|
})],
|
|
|
DATA: [
|
|
|
...articles.map(a => {
|
|
|
return {
|
|
|
P_NAME: name,
|
|
|
P_PARAM: this.id,
|
|
|
I_INDEX: a.index,
|
|
|
ARTICLE_ID: a.data.articleId,
|
|
|
POS_ID: this.posId
|
|
|
};
|
|
|
})
|
|
|
],
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
components: {
|
...
|
...
|
|