Authored by 杨延青

Merge branch 'feature/0530' into 'release/6.9.5'

Feature/0530



See merge request !89
... ... @@ -14,7 +14,7 @@
<div class="price-wrap">
<div class="price-left">
<label v-if="priceTag" class="price-tag" :class="priceTag"></label>
<span class="price">¥{{salesPrice}}</span>
<span v-show="salesPrice" class="price">¥{{salesPrice}}</span>
</div>
<div class="btn-right btn-buy hover-opacity" :class="{'btn-disable': !hasStock}">
<span class="iconfont icon-cart"></span>购买
... ... @@ -231,7 +231,7 @@ export default {
.price-tag {
width: 94px;
height: 28px;
margin-right: 16px;
margin-right: 10px;
background-size: 100%;
}
... ...
<template>
<AuthComponent class="btn-follow hover-opacity" :class="followClass" @click="onFollow">
<AuthComponent class="btn-follow hover-opacity" :class="followClass" :auth="isAuth" @click="onFollow">
<span>{{followText}}</span>
</AuthComponent>
</template>
... ... @@ -42,6 +42,9 @@ export default {
},
followText() {
return this.followStatus ? '已关注' : '关注';
},
isAuth() {
return !this.share;
}
},
methods: {
... ...
... ... @@ -118,7 +118,7 @@ export default {
return '';
},
isAuth() {
return !!this.syncFnName;
return !this.share && !!this.syncFnName;
},
btnStyle() {
let color = this.viewOption.color || defaultOption.color;
... ...
... ... @@ -150,6 +150,21 @@ router.onReady(() => {
});
}
if (to.query.report_yas) {
let reportParam = to.query.report_param || {};
store.dispatch('reportYas', {
params: {
appop: to.query.report_yas,
param: {
...reportParam,
FP_NAME: from.name,
FP_PARAM: from.params[getReportParamsKey(from.name)],
}
}
});
}
return next();
} catch (e) {
store.dispatch('reportError', {error: e});
... ...
... ... @@ -82,6 +82,8 @@ export default {
if (+this.$route.params.id !== this.id) {
this.id = +this.$route.params.id;
this.init();
} else {
this.reportProductShow(this.articleInfo);
}
},
async serverPrefetch() {
... ... @@ -113,6 +115,7 @@ export default {
...mapMutations(['CHANGE_AUTHOR_FOLLOW']),
init() {
this.recommendArticles = {};
this.fetching = true;
this.syncServiceArticleDetail();
},
loadPreData(articleId) {
... ... @@ -145,10 +148,13 @@ export default {
this.listTitle = '';
setTimeout(() => {
this.fetching = false;
this.$refs.scroll.init();
}, 500);
}
this.reportProductShow(get(res, 'data.detailList[0]'));
if (this.share && this.setShareData) {
this.setShareData(get(res, 'data.detailList[0]', this.articleInfo));
}
... ... @@ -209,6 +215,36 @@ export default {
this.$refs.detailNote && ($detail = this.$refs.detailNote);
$detail.$refs.header && $detail.$refs.header.onBack();
},
reportProductShow(article) {
const productList = article.productList || [];
if (!productList.length) {
return;
}
let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList';
this.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.show,
param: {
DATA: [
...productList.map((p, i) => {
return {
P_NAME: name,
P_PARAM: this.id,
I_INDEX: i,
ARTICLE_ID: this.id,
PRD_SKN: p.productSkn,
ATR_TYPE: article.sort == 2 ? 1 : 2,
PRD_TYPE: p.collage_activity_id ? 'collage_info' : ''
};
})
],
}
}
});
}
},
components: {
... ...
... ... @@ -120,6 +120,13 @@ export default {
name: 'article',
params: {
id: this.data.articleId
},
query: {
report_yas: YAS.eventName.detailShow,
report_param: {
ART_ID: this.data.articleId,
ATR_TYPE: this.data.sort === 2 ? 1 : 2
}
}
});
this.reportClickArticle();
... ...
... ... @@ -38,11 +38,16 @@ export default {
return parseInt(this.step, 10) / 100;
},
headerStyle() {
let style = {};
this.setIconColor(Math.floor((255 - 68) * (1 - this.stepPercent) + 68));
style.background = `rgba(255,255,255,${this.stepPercent})`;
if (this.stepPercent > 0.98) {
style.borderBottom = '1px solid #efefef';
}
return {
background: `rgba(255,255,255,${this.stepPercent})`
};
return style;
},
blockTranslateY() {
return '-' + parseInt(`0${this.titleStep}`, 10) + '%';
... ...
... ... @@ -67,7 +67,7 @@ export default {
this.list[0].hide = authorState.hasAttention !== 'Y';
this.list[2].href = `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${article.articleId}"}}`;
this.list[2].hide = version(this.$yoho.appVersion, '6.9.5') < 0 || article.isAuthor !== 'Y';
this.list[2].hide = article.sort === 2 || version(this.$yoho.appVersion, '6.9.5') < 0 || article.isAuthor !== 'Y';
this.list[3].hide = article.isAuthor !== 'Y';
this.list = [...this.list];
... ...
... ... @@ -3,7 +3,7 @@
<Layout class="article">
<TopicHeader ref="header" :title="topicTitle" :step="headerAnimateStep" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicHeader>
<RecycleScrollReveal v-if="topicInfo.viewModel == 2" :size="5" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="800" :on-fetch="onFetch" :manual-init="true"
<RecycleScrollReveal :size="5" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="800" :on-fetch="onFetch" :manual-init="true"
@on-inited="onInited">
<template v-slot:eternalTop>
<TopicBanner ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner>
... ... @@ -24,32 +24,6 @@
</template>
</RecycleScrollReveal>
<LayoutRecycleList v-if="topicInfo.viewModel == 1" :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch" :manual-init="true"
@on-inited="onInited">
<template class="article-item" #item="{ data }">
<TopicBanner v-if="data.data.topicHead" ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner>
<ArticleItem
v-else
type="topic"
:index="data.index"
:data="data.data"
:share="share"
:article-id="data.data.articleId"
:user-head-ico="yoho.context.userHeadIco"
:pos-id="posId"
@on-follow="follow => onFollow(data.data, follow)"
@on-resize="onResize"
@on-unlock-height="onUnlockHeight"
@on-show-guang="onShowGuang"
@on-show-comment="onShowComment"
@on-show-more="onShowMore">
<template v-if="data.data.dataType == 2">
<ArticleResource :data="data.data"></ArticleResource>
</template>
</ArticleItem>
</template>
</LayoutRecycleList>
<a v-if="publishUrl && !share" class="publish-btn hover-opacity" :class="{'scroll-opacity': scrolling}" :href="publishUrl">
<span class="avatar-block">
<WidgetAvatar class="avatar" :src="yoho.context.userHeadIco" :width="70" :height="70"></WidgetAvatar>
... ...
... ... @@ -62,7 +62,7 @@ export default {
actionUrl() {
if (this.data.sort === 3) {
return this.data.actionUrl;
} else if (+this.data.authStatus === 2 && version(this.$yoho.appVersion, '6.9.5') >= 0) {
} else if (+this.data.authStatus === 2 && +this.data.sort !== 2 && version(this.$yoho.appVersion, '6.9.5') >= 0) {
return `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${this.data.articleId}"}}`;
}
... ...
... ... @@ -29,23 +29,25 @@
@scroll="onScrollHandle"
@scroll-end="onScrollEndHandle"
@before-scroll-start="beforeScrollStartHandle">
<div ref="authorProfile" class="author-profile">
<WidgetAvatar class="avatar-box" :class="{'avatar-opacity': authorBaseData.showAvatar}" :src="authorBaseData.headIco" :group="authorBaseData.authGroupId" :width="100" :height="100"></WidgetAvatar>
<div class="author-section">
<ul class="author-fans">
<li v-for="item in fansList" :key="item.key">
<div class="click-wrap" @click="toPage(item.type)"></div>
<span class="num">{{authorBaseData[item.key] || 0}}</span>
<p class="name"><span>{{item.name}}</span></p>
</li>
</ul>
<div class="operate-wrap">
<a v-if="isOwner" class="operate-btn btn-user-edit" :href="mineInfoUrl">编辑个人资料</a>
<WidgetFollow v-if="!isOwner" class="operate-btn" :author-uid="authorInfo.authorUid" :author-type="authorInfo.authorType" :follow="isAttention" @on-follow="follow => onFollow(follow)" :pos-id="sceneId"></WidgetFollow>
<div ref="authorProfile">
<div class="author-profile">
<WidgetAvatar class="avatar-box" :class="{'avatar-opacity': authorBaseData.showAvatar}" :src="authorBaseData.headIco" :group="authorBaseData.authGroupId" :width="100" :height="100"></WidgetAvatar>
<div class="author-section">
<ul class="author-fans">
<li v-for="item in fansList" :key="item.key">
<div class="click-wrap" @click="toPage(item.type)"></div>
<span class="num">{{authorBaseData[item.key] || 0}}</span>
<p class="name"><span>{{item.name}}</span></p>
</li>
</ul>
<div class="operate-wrap">
<a v-if="isOwner" class="operate-btn btn-user-edit" :href="mineInfoUrl">编辑个人资料</a>
<WidgetFollow v-if="!isOwner" class="operate-btn" :author-uid="authorInfo.authorUid" :author-type="authorInfo.authorType" :follow="isAttention" @on-follow="follow => onFollow(follow)" :pos-id="sceneId"></WidgetFollow>
</div>
</div>
</div>
<p v-if="authorBaseData.signature" class="author-desc">{{authorBaseData.signature}}</p>
</div>
<p v-if="authorBaseData.signature" class="author-desc">{{authorBaseData.signature}}</p>
<div ref="tabBlock" class="tab-block">
<FavTabBlock :tabs-num="tabsNum" :active-index="activeIndex" @change="changeTab"></FavTabBlock>
</div>
... ... @@ -594,8 +596,9 @@ export default {
}
.author-desc {
margin: 20px 30px;
padding: 20px 30px;
font-size: 24px;
line-height: 1.4;
font-weight: 300;
overflow: hidden;
text-overflow: ellipsis;
... ...
... ... @@ -14,6 +14,7 @@
import ArticleItem from './author-article-item';
import {assign, get, forEach} from 'lodash';
import {getArticleImageSize} from 'utils/image-handler';
import YAS from 'utils/yas-constants';
export default {
data() {
... ... @@ -159,15 +160,20 @@ export default {
}
});
},
toArticle({articleId}) {
let router = {
toArticle({articleId, sort}) {
this.$router.push({
name: 'article',
params: {
id: articleId
},
query: {
report_yas: YAS.eventName.detailShow,
report_param: {
ART_ID: articleId,
ATR_TYPE: sort === 2 ? 1 : 2
}
}
};
this.$router.push(router);
});
}
},
components: {
... ...

1.76 KB | W: | H:

1.74 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin