Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-community-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
yyq
6 years ago
Commit
af1e0b1487c8404281e0fb42abde74c95b7d8e59
2 parents
3bea4afd
7223866e
Merge branch 'feature/0530' into release/6.9.5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
173 additions
and
41 deletions
apps/app.vue
apps/components/layouts/recycle-scroll-reveal.vue
apps/entry-client.js
apps/pages/article/article-detail.vue
apps/pages/article/components/detail/article-header.vue
apps/pages/article/components/detail/article-long.vue
apps/pages/article/topic.vue
apps/pages/userpage/components/author.vue
apps/app.vue
View file @
af1e0b1
...
...
@@ -75,6 +75,8 @@ export default {
this.$sdk.goLogin();
});
}
this.reportEnter();
},
methods: {
...mapMutations(['SET_STATUS_BAR_COLOR', 'SET_STATUS_BAR_STATUS']),
...
...
@@ -93,6 +95,21 @@ export default {
this.fpsTick++;
this.frameCallback();
});
},
reportEnter() {
const route = this.$route;
this.$store.dispatch('reportYas', {
params: {
appop: 'YB_PAGE_ENTER',
param: {
PAGE_ID: route.name,
TYPE_ID: route.params.id || route.params.topicId,
SOURCE_ID: '',
PAGE_NEW_CREATE: 'Y'
}
}
});
}
},
watch: {
...
...
apps/components/layouts/recycle-scroll-reveal.vue
View file @
af1e0b1
...
...
@@ -32,7 +32,7 @@
</template>
<script>
import {throttle} from 'lodash';
import {throttle
, slice
} from 'lodash';
import {Loading} from 'cube-ui';
const EVENT_SCROLL = 'scroll';
...
...
@@ -324,7 +324,21 @@ export default {
this.updateList();
this.$emit('scroll', {scrollTop});
let currents = [];
if (scrollTop > (this.$refs.eternal.offsetHeight - document.body.clientHeight / 2)) {
for (let i = 0; i < this.cols; i++) {
let col = this[this.colPrefix + i];
if (col && col.length) {
let start = this.startIndexs[i] || 0;
currents = currents.concat(slice(col, start, start + Math.round(this.size / 2)));
}
}
}
this.$emit('scroll', {scrollTop, items: currents});
},
},
components: {
...
...
apps/entry-client.js
View file @
af1e0b1
...
...
@@ -123,7 +123,7 @@ router.onReady(() => {
SOURCE_ID
:
from
.
name
,
PAGE_NEW_CREATE
:
!!
find
(
get
(
store
,
'state.yoho.historys'
),
history
=>
{
return
history
.
path
===
to
.
path
;
})
})
?
'Y'
:
'N'
}
}
});
...
...
apps/pages/article/article-detail.vue
View file @
af1e0b1
...
...
@@ -118,6 +118,7 @@ export default {
this.fetching = true;
this.syncServiceArticleDetail();
},
<<<<<<< HEAD
pageVisibileEvent() {
if (this.articleOnEdit) {
this.articleOnEdit = false;
...
...
@@ -135,13 +136,16 @@ export default {
}
},
onScroll({scrollTop}) {
=======
onScroll({scrollTop, items}) {
>>>>>>> feature/0530
this.scrollTop = scrollTop;
this.scrolling = true;
this._scTimer && clearTimeout(this._scTimer);
this._scTimer = setTimeout(() => {
this.scrolling = false;
},
4
00);
},
2
00);
},
syncServiceArticleDetail() {
const articleId = parseInt(this.id, 10);
...
...
@@ -226,6 +230,51 @@ export default {
onEdit() {
this.articleOnEdit = true;
},
reportArticleShow(items) {
if (!items || !items.length) {
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;
if (articles.length) {
let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList';
this.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.show,
param: {
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
};
})
],
}
}
});
}
},
reportProductShow(article) {
const productList = article.productList || [];
...
...
apps/pages/article/components/detail/article-header.vue
View file @
af1e0b1
...
...
@@ -95,6 +95,7 @@ export default {
width: 100%;
z-index: 10;
transition: all 100ms;
box-sizing: border-box;
/deep/ .title {
overflow: visible!important;
...
...
apps/pages/article/components/detail/article-long.vue
View file @
af1e0b1
...
...
@@ -320,7 +320,7 @@ export default {
.context-title {
font-size: 34px;
color: #
444
;
color: #
222
;
line-height: 52px;
margin-bottom: 10px;
font-weight: 700;
...
...
apps/pages/article/topic.vue
View file @
af1e0b1
...
...
@@ -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: {
...
...
apps/pages/userpage/components/author.vue
View file @
af1e0b1
...
...
@@ -333,11 +333,14 @@ export default {
}
if (result && result.code === 200) {
info.list = info.list || [];
if (info.page === 1) {
info.list = [];
}
info.list = (info.list || []).concat(result.data.list || []);
this.reportArticleShow(result.data.list, info.list.length);
info.list = info.list.concat(result.data.list || []);
info.page++;
info.totalPage = result.data.totalPage || 1;
info.lastedTime = result.data.lastedTime;
...
...
@@ -399,6 +402,52 @@ export default {
params
});
}
},
reportArticleShow(items, baseIndex) {
if (!items || !items.length) {
return;
}
this._preReportArticles = this._preReportArticles|| {};
let reportArticles = {};
let articles = [];
items.forEach((item, index) => {
item = {...item, index: index + baseIndex};
reportArticles[item.articleId] = 1;
if (item.articleId && !this._preReportArticles[item.articleId]) {
articles.push(item);
}
});
this._preReportArticles = reportArticles;
if (articles.length) {
let name = this.$yoho.isiOS ? 'iFP_AuthorList' : 'aFP_AuthorList';
this.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.show,
param: {
DATA: [
...articles.map(a => {
return {
P_NAME: name,
P_PARAM: this.authorInfo.authorUid,
I_INDEX: a.index,
ARTICLE_ID: a.articleId,
TAB_ID: this.activeIndex + 1,
POS_ID: this.sceneId
};
})
],
}
}
});
}
}
},
components: {
...
...
Please
register
or
login
to post a comment