Authored by TaoHuang

fix yas request

... ... @@ -573,13 +573,16 @@ const yoho = {
},
// 跳商品详情页
goProductDetail(skn) {
goProductDetail({skn, name}) {
var url = window.location.protocol + '//m.yohobuy.com/';
if (this.isYohoBuy && window.yohoInterface) {
url = url + '?openby:yohobuy=' + JSON.stringify({
action: 'go.productDetail',
params: {product_skn: skn}
params: {
product_skn: skn,
from_page_name: name
}
});
if ($appLink) {
... ...
... ... @@ -163,7 +163,9 @@ export default {
this.noMore = true;
this.loadings.pop();
} else {
this.loadItems(res);
this.loadItems(res).then(() => {
this.$emit('on-inited', this.items[0]);
});
}
});
},
... ...
... ... @@ -82,7 +82,6 @@ export default {
if (result.code === 200) {
if (favorite) {
this.reportFavProduct(this.product.productSkn, this.product.productType);
this.prompt = this.$grassPrompt({
img: this.product.productImage,
title: '收藏成功',
... ... @@ -124,41 +123,31 @@ export default {
return;
}
let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList';
if (this.product.productType === 1) {
this.$yoho.goProductDetail(skn);
this.$yoho.goProductDetail({skn, name});
} else if (this.product.productType === 2) {
this.$yoho.goUfoProductDetail(skn);
this.$yoho.goUfoProductDetail({skn, name});
}
this.reportProduct(skn, this.product.productType);
this.reportProduct(skn);
},
reportProduct(skn, type) {
reportProduct(skn) {
let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList';
this.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.productClick,
param: {
P_NAME: name,
POS_ID: this.posId,
ARTICLE_ID: this.articleId,
PRD_SKN: skn,
PRD_TYPE: type
}
}
});
},
reportFavProduct(skn, type) {
this.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.productFav,
param: {
POS_ID: this.posId,
ARTICLE_ID: this.articleId,
PRD_SKN: skn,
PRD_TYPE: type,
I_INDEX: this.index
}
}
});
}
}
};
</script>
... ...
... ... @@ -64,17 +64,6 @@ const trackPage = (path) => {
};
router.onReady(() => {
store.dispatch('reportYas', {
params: {
appop: 'YB_H5_PAGE_OPEN_L',
param: {
F_URL: `${location.origin}${router.currentRoute.fullPath}`,
PAGE_URL: '',
PAGE_NAME: router.currentRoute.name
}
}
});
router.beforeResolve((to, from, next) => {
try {
trackPage(to.fullPath);
... ...
<template>
<div class="article-item-header">
<div class="avatar" @click="toUserPage">
<WidgetAvatar :share="share" :lazy="lazy" class="widget-avatar" :src="data.authorHeadIco" :width="70" :height="70"></WidgetAvatar>
<WidgetAvatar :pos-id="posId" :share="share" :lazy="lazy" class="widget-avatar" :src="data.authorHeadIco" :width="70" :height="70"></WidgetAvatar>
<span class="user-name">{{data.authorName}}</span>
</div>
<div class="opts">
<WidgetFollow :class="invisibleClass" :share="share" :author-uid="data.authorUid" :authorType="data.authorType" :follow="data.hasAttention === 'Y'" @on-follow="onFollow"></WidgetFollow>
<WidgetFollow :class="invisibleClass" :share="share" :author-uid="data.authorUid" :authorType="data.authorType" :follow="data.hasAttention === 'Y'" @on-follow="onFollow" :pos-id="posId"></WidgetFollow>
<i class="iconfont icon-more1" @click="onMore"></i>
</div>
</div>
... ...
... ... @@ -190,7 +190,7 @@ export default {
params: {
appop: YAS.eventName.labelClick,
param: {
AUTH_ID: id,
LABEL_ID: id,
POS_ID: this.posId
}
}
... ...
... ... @@ -6,7 +6,7 @@
<ArticleItemIntro :thumb="thumb" :type="type" :share="share" :data="introData" @on-expand="onExpand" @on-expanding="onExpanding" @on-show-guang="onShowGuang" @on-show-comment="onShowComment"
:article-id="articleId" :pos-id="posId">
</ArticleItemIntro>
<ArticleItemComment :thumb="thumb" :type="type" :share="share" :data="commentData" @on-show-comment="onShowComment" @on-resize="onResize" :pos-id="posId" :article-id="articleId" ></ArticleItemComment>
<ArticleItemComment :thumb="thumb" :type="type" :share="share" :data="commentData" @on-show-comment="onShowComment" @on-resize="onResize" :pos-id="posId" :article-id="data.articleId" ></ArticleItemComment>
<div class="line"></div>
</div>
</template>
... ... @@ -126,7 +126,7 @@ export default {
params: {
appop: 'YB_H5_PAGE_OPEN_L',
param: {
F_URL: `${location.origin}/news/${this.articleId}`,
F_URL: `${location.origin}/news/${this.data.articleId}`,
PAGE_URL: '',
PAGE_NAME: 'news'
}
... ...
... ... @@ -12,14 +12,15 @@
<WidgetFollow :share="share" class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)" :pos-id="posId"></WidgetFollow>
</template>
</LayoutHeader>
<LayoutRecycleList :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch">
<LayoutRecycleList :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch"
@on-inited="onInited">
<template class="article-item" #item="{ data }">
<ArticleItem
:type="type"
:index="data.index"
:data="data.data"
:share="share"
:article-id="data.articleId"
:article-id="data.data.articleId"
:pos-id="posId"
@on-follow="follow => onFollow(data.data, follow)"
@on-resize="onResize"
... ... @@ -195,6 +196,11 @@ export default {
this.$refs.scroll.$el.scrollTop = 0;
this.$refs.scroll.init();
},
onInited(item) {
if (item) {
this.reportShow(0, item);
}
},
onFollow(data, follow) {
if (data.authorUid === this.currentAuthor.authorUid) {
this.currentAuthor.hasAttention = follow ? 'Y' : 'N';
... ... @@ -225,6 +231,7 @@ export default {
},
startReportShow() {
let preview = null;
let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList';
return (index, item) => {
if (preview === item.data.articleId) {
... ... @@ -237,12 +244,21 @@ export default {
params: {
appop: YAS.eventName.show,
param: {
P_NAME: this.$route.name,
P_PARAM: this.$route.params,
I_INDEX: index,
ARTICLE_ID: preview,
PRD_SKN: (item.data.productList || []).map(i => i.productSkn).join(','),
POS_ID: this.posId
DATA: [{
P_NAME: name,
P_PARAM: this.$route.params.id,
I_INDEX: index,
ARTICLE_ID: preview,
POS_ID: this.posId
}, ...(item.data.productList || []).map(p => {
return {
P_NAME: name,
P_PARAM: this.$route.params.id,
I_INDEX: index,
PRD_SKN: p.productSkn,
POS_ID: this.posId
};
})],
}
}
});
... ...
... ... @@ -61,7 +61,7 @@ export default {
},
methods: {
onClick(type) {
if (type === 'article') {
if (type !== 'author') {
this.reportClickArticle();
}
this.$emit('click', {data: this.data, type});
... ...