Authored by yyq

report

... ... @@ -92,7 +92,7 @@ export default {
return;
}
let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList';
let name = this.$yoho.isiOS ? 'iFP_ArticleDetail' : 'aFP_ArticleDetail';
if (this.product.productType === 1) {
this.$yoho.goProductDetail({skn, name, articleId: this.articleId});
... ...
... ... @@ -8,7 +8,7 @@ import {Style, Toast, Dialog, ActionSheet} from 'cube-ui'; //eslint-disable-line
import Prompt from 'plugins/grass-prompt';
import bus from 'plugins/bus';
import {get} from 'lodash';
import {get, find} from 'lodash';
import Lazy from 'vue-lazyload';
import yoho from 'common/yoho';
import sdk from 'common/sdk';
... ... @@ -53,6 +53,25 @@ Vue.use(Lazy, {error: ''});
initClient(store);
const getReportParamsKey = (name) => {
let key;
switch (name) {
case 'article.comment':
key = 'articleId';
break;
case 'topic':
case 'topic.share':
key = 'topicId';
break;
default:
key = 'id';
break;
}
return key;
};
const trackPage = (path) => {
if (window._hmt) {
try {
... ... @@ -77,12 +96,59 @@ router.onReady(() => {
params: {
appop: 'YB_H5_PAGE_OPEN_L',
param: {
PAGE_URL: `${location.origin}${to.fullPath}`,
PAGE_NAME: to.name
}
}
});
store.dispatch('reportYas', {
params: {
appop: 'YB_H5_PAGE_FLR_C',
param: {
F_URL: `${location.origin}${from.fullPath}`,
PAGE_URL: `${location.origin}${to.fullPath}`,
PAGE_NAME: to.name
}
}
});
store.dispatch('reportYas', {
params: {
appop: 'YB_PAGE_ENTER',
param: {
PAGE_ID: to.name,
TYPE_ID: to.params[getReportParamsKey(to.name)],
SOURCE_ID: from.name,
PAGE_NEW_CREATE: !!find(get(store, 'state.yoho.historys'), history => {
return history.path === to.path;
})
}
}
});
store.dispatch('reportYas', {
params: {
appop: 'YB_PAGE_EXIT',
param: {
PAGE_ID: from.name,
TYPE_ID: from.params[getReportParamsKey(from.name)]
}
}
});
if (get(store, 'state.yoho.direction') === 'back') {
store.dispatch('reportYas', {
params: {
appop: 'YB_PAGE_FINISH',
param: {
PAGE_ID: from.name,
TYPE_ID: from.params[getReportParamsKey(from.name)]
}
}
});
}
return next();
} catch (e) {
store.dispatch('reportError', {error: e});
... ...
... ... @@ -334,6 +334,10 @@ export default {
},
onFollowTopic(follow) {
this.topicInfo.hasAttention = follow;
if (follow) {
this.reportTopicFollow();
}
},
onResize(index) {
this.$nextTick(() => {
... ... @@ -359,9 +363,19 @@ export default {
}
}
},
reportTopicFollow() {
this.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.topicFollow,
param: {
TOPIC_ID: this.topicId
}
}
});
},
startReportShow() {
let preview = null;
let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList';
let name = this.$yoho.isiOS ? 'iFP_TopicList' : 'aFP_TopicList';
return (index, item) => {
if (preview === item.data.articleId) {
... ...
... ... @@ -289,7 +289,11 @@ export default {
article = {...emptyData, emptyTip: result.message};
}
state.articleSingleDetail = article;
if (!thumb) {
Object.assign(state.articleSingleDetail, {thumb: false});
} else {
state.articleSingleDetail = article;
}
},
[Types.FETCH_ARTICLE_SINGLE_DETAIL_FAILD](state) {
state.fetchArticleSingleDetail = false;
... ...
... ... @@ -5,8 +5,9 @@ export default {
list: 102,
author: 103,
authorList: 104,
topicList: 105,
newsDetail: 106
labelList: 105,
newsDetail: 106,
topicList: 107
},
eventName: {
show: 'YB_SHOW_EVENT',
... ... @@ -18,6 +19,8 @@ export default {
comment: 'YB_STROLL_ATC_COM_C',
productClick: 'YB_STROLL_ARC_RLT_PRD_C',
productFav: 'YB_STROLL_ARC_RLT_PRD_COL_C',
labelClick: 'YB_STROLL_ACT_LBL_C'
labelClick: 'YB_STROLL_ACT_LBL_C',
topicFollow: 'YB_STROLL_TOPIC_ATT_C',
detailShow: 'YB_STROLL_CONT'
}
};
... ...