Authored by yyq

report

@@ -92,7 +92,7 @@ export default { @@ -92,7 +92,7 @@ export default {
92 return; 92 return;
93 } 93 }
94 94
95 - let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList'; 95 + let name = this.$yoho.isiOS ? 'iFP_ArticleDetail' : 'aFP_ArticleDetail';
96 96
97 if (this.product.productType === 1) { 97 if (this.product.productType === 1) {
98 this.$yoho.goProductDetail({skn, name, articleId: this.articleId}); 98 this.$yoho.goProductDetail({skn, name, articleId: this.articleId});
@@ -8,7 +8,7 @@ import {Style, Toast, Dialog, ActionSheet} from 'cube-ui'; //eslint-disable-line @@ -8,7 +8,7 @@ import {Style, Toast, Dialog, ActionSheet} from 'cube-ui'; //eslint-disable-line
8 import Prompt from 'plugins/grass-prompt'; 8 import Prompt from 'plugins/grass-prompt';
9 import bus from 'plugins/bus'; 9 import bus from 'plugins/bus';
10 10
11 -import {get} from 'lodash'; 11 +import {get, find} from 'lodash';
12 import Lazy from 'vue-lazyload'; 12 import Lazy from 'vue-lazyload';
13 import yoho from 'common/yoho'; 13 import yoho from 'common/yoho';
14 import sdk from 'common/sdk'; 14 import sdk from 'common/sdk';
@@ -53,6 +53,25 @@ Vue.use(Lazy, {error: ''}); @@ -53,6 +53,25 @@ Vue.use(Lazy, {error: ''});
53 53
54 initClient(store); 54 initClient(store);
55 55
  56 +const getReportParamsKey = (name) => {
  57 + let key;
  58 +
  59 + switch (name) {
  60 + case 'article.comment':
  61 + key = 'articleId';
  62 + break;
  63 + case 'topic':
  64 + case 'topic.share':
  65 + key = 'topicId';
  66 + break;
  67 + default:
  68 + key = 'id';
  69 + break;
  70 + }
  71 +
  72 + return key;
  73 +};
  74 +
56 const trackPage = (path) => { 75 const trackPage = (path) => {
57 if (window._hmt) { 76 if (window._hmt) {
58 try { 77 try {
@@ -77,12 +96,59 @@ router.onReady(() => { @@ -77,12 +96,59 @@ router.onReady(() => {
77 params: { 96 params: {
78 appop: 'YB_H5_PAGE_OPEN_L', 97 appop: 'YB_H5_PAGE_OPEN_L',
79 param: { 98 param: {
  99 + PAGE_URL: `${location.origin}${to.fullPath}`,
  100 + PAGE_NAME: to.name
  101 + }
  102 + }
  103 + });
  104 +
  105 + store.dispatch('reportYas', {
  106 + params: {
  107 + appop: 'YB_H5_PAGE_FLR_C',
  108 + param: {
80 F_URL: `${location.origin}${from.fullPath}`, 109 F_URL: `${location.origin}${from.fullPath}`,
81 PAGE_URL: `${location.origin}${to.fullPath}`, 110 PAGE_URL: `${location.origin}${to.fullPath}`,
82 PAGE_NAME: to.name 111 PAGE_NAME: to.name
83 } 112 }
84 } 113 }
85 }); 114 });
  115 +
  116 + store.dispatch('reportYas', {
  117 + params: {
  118 + appop: 'YB_PAGE_ENTER',
  119 + param: {
  120 + PAGE_ID: to.name,
  121 + TYPE_ID: to.params[getReportParamsKey(to.name)],
  122 + SOURCE_ID: from.name,
  123 + PAGE_NEW_CREATE: !!find(get(store, 'state.yoho.historys'), history => {
  124 + return history.path === to.path;
  125 + })
  126 + }
  127 + }
  128 + });
  129 +
  130 + store.dispatch('reportYas', {
  131 + params: {
  132 + appop: 'YB_PAGE_EXIT',
  133 + param: {
  134 + PAGE_ID: from.name,
  135 + TYPE_ID: from.params[getReportParamsKey(from.name)]
  136 + }
  137 + }
  138 + });
  139 +
  140 + if (get(store, 'state.yoho.direction') === 'back') {
  141 + store.dispatch('reportYas', {
  142 + params: {
  143 + appop: 'YB_PAGE_FINISH',
  144 + param: {
  145 + PAGE_ID: from.name,
  146 + TYPE_ID: from.params[getReportParamsKey(from.name)]
  147 + }
  148 + }
  149 + });
  150 + }
  151 +
86 return next(); 152 return next();
87 } catch (e) { 153 } catch (e) {
88 store.dispatch('reportError', {error: e}); 154 store.dispatch('reportError', {error: e});
@@ -334,6 +334,10 @@ export default { @@ -334,6 +334,10 @@ export default {
334 }, 334 },
335 onFollowTopic(follow) { 335 onFollowTopic(follow) {
336 this.topicInfo.hasAttention = follow; 336 this.topicInfo.hasAttention = follow;
  337 +
  338 + if (follow) {
  339 + this.reportTopicFollow();
  340 + }
337 }, 341 },
338 onResize(index) { 342 onResize(index) {
339 this.$nextTick(() => { 343 this.$nextTick(() => {
@@ -359,9 +363,19 @@ export default { @@ -359,9 +363,19 @@ export default {
359 } 363 }
360 } 364 }
361 }, 365 },
  366 + reportTopicFollow() {
  367 + this.$store.dispatch('reportYas', {
  368 + params: {
  369 + appop: YAS.eventName.topicFollow,
  370 + param: {
  371 + TOPIC_ID: this.topicId
  372 + }
  373 + }
  374 + });
  375 + },
362 startReportShow() { 376 startReportShow() {
363 let preview = null; 377 let preview = null;
364 - let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList'; 378 + let name = this.$yoho.isiOS ? 'iFP_TopicList' : 'aFP_TopicList';
365 379
366 return (index, item) => { 380 return (index, item) => {
367 if (preview === item.data.articleId) { 381 if (preview === item.data.articleId) {
@@ -289,7 +289,11 @@ export default { @@ -289,7 +289,11 @@ export default {
289 article = {...emptyData, emptyTip: result.message}; 289 article = {...emptyData, emptyTip: result.message};
290 } 290 }
291 291
292 - state.articleSingleDetail = article; 292 + if (!thumb) {
  293 + Object.assign(state.articleSingleDetail, {thumb: false});
  294 + } else {
  295 + state.articleSingleDetail = article;
  296 + }
293 }, 297 },
294 [Types.FETCH_ARTICLE_SINGLE_DETAIL_FAILD](state) { 298 [Types.FETCH_ARTICLE_SINGLE_DETAIL_FAILD](state) {
295 state.fetchArticleSingleDetail = false; 299 state.fetchArticleSingleDetail = false;
@@ -5,8 +5,9 @@ export default { @@ -5,8 +5,9 @@ export default {
5 list: 102, 5 list: 102,
6 author: 103, 6 author: 103,
7 authorList: 104, 7 authorList: 104,
8 - topicList: 105,  
9 - newsDetail: 106 8 + labelList: 105,
  9 + newsDetail: 106,
  10 + topicList: 107
10 }, 11 },
11 eventName: { 12 eventName: {
12 show: 'YB_SHOW_EVENT', 13 show: 'YB_SHOW_EVENT',
@@ -18,6 +19,8 @@ export default { @@ -18,6 +19,8 @@ export default {
18 comment: 'YB_STROLL_ATC_COM_C', 19 comment: 'YB_STROLL_ATC_COM_C',
19 productClick: 'YB_STROLL_ARC_RLT_PRD_C', 20 productClick: 'YB_STROLL_ARC_RLT_PRD_C',
20 productFav: 'YB_STROLL_ARC_RLT_PRD_COL_C', 21 productFav: 'YB_STROLL_ARC_RLT_PRD_COL_C',
21 - labelClick: 'YB_STROLL_ACT_LBL_C' 22 + labelClick: 'YB_STROLL_ACT_LBL_C',
  23 + topicFollow: 'YB_STROLL_TOPIC_ATT_C',
  24 + detailShow: 'YB_STROLL_CONT'
22 } 25 }
23 }; 26 };