Authored by 杨延青

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

Feature/0530



See merge request !89
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <div class="price-wrap"> 14 <div class="price-wrap">
15 <div class="price-left"> 15 <div class="price-left">
16 <label v-if="priceTag" class="price-tag" :class="priceTag"></label> 16 <label v-if="priceTag" class="price-tag" :class="priceTag"></label>
17 - <span class="price">¥{{salesPrice}}</span> 17 + <span v-show="salesPrice" class="price">¥{{salesPrice}}</span>
18 </div> 18 </div>
19 <div class="btn-right btn-buy hover-opacity" :class="{'btn-disable': !hasStock}"> 19 <div class="btn-right btn-buy hover-opacity" :class="{'btn-disable': !hasStock}">
20 <span class="iconfont icon-cart"></span>购买 20 <span class="iconfont icon-cart"></span>购买
@@ -231,7 +231,7 @@ export default { @@ -231,7 +231,7 @@ export default {
231 .price-tag { 231 .price-tag {
232 width: 94px; 232 width: 94px;
233 height: 28px; 233 height: 28px;
234 - margin-right: 16px; 234 + margin-right: 10px;
235 background-size: 100%; 235 background-size: 100%;
236 } 236 }
237 237
1 <template> 1 <template>
2 - <AuthComponent class="btn-follow hover-opacity" :class="followClass" @click="onFollow"> 2 + <AuthComponent class="btn-follow hover-opacity" :class="followClass" :auth="isAuth" @click="onFollow">
3 <span>{{followText}}</span> 3 <span>{{followText}}</span>
4 </AuthComponent> 4 </AuthComponent>
5 </template> 5 </template>
@@ -42,6 +42,9 @@ export default { @@ -42,6 +42,9 @@ export default {
42 }, 42 },
43 followText() { 43 followText() {
44 return this.followStatus ? '已关注' : '关注'; 44 return this.followStatus ? '已关注' : '关注';
  45 + },
  46 + isAuth() {
  47 + return !this.share;
45 } 48 }
46 }, 49 },
47 methods: { 50 methods: {
@@ -118,7 +118,7 @@ export default { @@ -118,7 +118,7 @@ export default {
118 return ''; 118 return '';
119 }, 119 },
120 isAuth() { 120 isAuth() {
121 - return !!this.syncFnName; 121 + return !this.share && !!this.syncFnName;
122 }, 122 },
123 btnStyle() { 123 btnStyle() {
124 let color = this.viewOption.color || defaultOption.color; 124 let color = this.viewOption.color || defaultOption.color;
@@ -150,6 +150,21 @@ router.onReady(() => { @@ -150,6 +150,21 @@ router.onReady(() => {
150 }); 150 });
151 } 151 }
152 152
  153 + if (to.query.report_yas) {
  154 + let reportParam = to.query.report_param || {};
  155 +
  156 + store.dispatch('reportYas', {
  157 + params: {
  158 + appop: to.query.report_yas,
  159 + param: {
  160 + ...reportParam,
  161 + FP_NAME: from.name,
  162 + FP_PARAM: from.params[getReportParamsKey(from.name)],
  163 + }
  164 + }
  165 + });
  166 + }
  167 +
153 return next(); 168 return next();
154 } catch (e) { 169 } catch (e) {
155 store.dispatch('reportError', {error: e}); 170 store.dispatch('reportError', {error: e});
@@ -82,6 +82,8 @@ export default { @@ -82,6 +82,8 @@ export default {
82 if (+this.$route.params.id !== this.id) { 82 if (+this.$route.params.id !== this.id) {
83 this.id = +this.$route.params.id; 83 this.id = +this.$route.params.id;
84 this.init(); 84 this.init();
  85 + } else {
  86 + this.reportProductShow(this.articleInfo);
85 } 87 }
86 }, 88 },
87 async serverPrefetch() { 89 async serverPrefetch() {
@@ -113,6 +115,7 @@ export default { @@ -113,6 +115,7 @@ export default {
113 ...mapMutations(['CHANGE_AUTHOR_FOLLOW']), 115 ...mapMutations(['CHANGE_AUTHOR_FOLLOW']),
114 init() { 116 init() {
115 this.recommendArticles = {}; 117 this.recommendArticles = {};
  118 + this.fetching = true;
116 this.syncServiceArticleDetail(); 119 this.syncServiceArticleDetail();
117 }, 120 },
118 loadPreData(articleId) { 121 loadPreData(articleId) {
@@ -145,10 +148,13 @@ export default { @@ -145,10 +148,13 @@ export default {
145 this.listTitle = ''; 148 this.listTitle = '';
146 149
147 setTimeout(() => { 150 setTimeout(() => {
  151 + this.fetching = false;
148 this.$refs.scroll.init(); 152 this.$refs.scroll.init();
149 }, 500); 153 }, 500);
150 } 154 }
151 155
  156 + this.reportProductShow(get(res, 'data.detailList[0]'));
  157 +
152 if (this.share && this.setShareData) { 158 if (this.share && this.setShareData) {
153 this.setShareData(get(res, 'data.detailList[0]', this.articleInfo)); 159 this.setShareData(get(res, 'data.detailList[0]', this.articleInfo));
154 } 160 }
@@ -209,6 +215,36 @@ export default { @@ -209,6 +215,36 @@ export default {
209 this.$refs.detailNote && ($detail = this.$refs.detailNote); 215 this.$refs.detailNote && ($detail = this.$refs.detailNote);
210 216
211 $detail.$refs.header && $detail.$refs.header.onBack(); 217 $detail.$refs.header && $detail.$refs.header.onBack();
  218 + },
  219 + reportProductShow(article) {
  220 + const productList = article.productList || [];
  221 +
  222 + if (!productList.length) {
  223 + return;
  224 + }
  225 +
  226 + let name = this.$yoho.isiOS ? 'iFP_ArticleList' : 'aFP_ArticleList';
  227 +
  228 + this.$store.dispatch('reportYas', {
  229 + params: {
  230 + appop: YAS.eventName.show,
  231 + param: {
  232 + DATA: [
  233 + ...productList.map((p, i) => {
  234 + return {
  235 + P_NAME: name,
  236 + P_PARAM: this.id,
  237 + I_INDEX: i,
  238 + ARTICLE_ID: this.id,
  239 + PRD_SKN: p.productSkn,
  240 + ATR_TYPE: article.sort == 2 ? 1 : 2,
  241 + PRD_TYPE: p.collage_activity_id ? 'collage_info' : ''
  242 + };
  243 + })
  244 + ],
  245 + }
  246 + }
  247 + });
212 } 248 }
213 }, 249 },
214 components: { 250 components: {
@@ -120,6 +120,13 @@ export default { @@ -120,6 +120,13 @@ export default {
120 name: 'article', 120 name: 'article',
121 params: { 121 params: {
122 id: this.data.articleId 122 id: this.data.articleId
  123 + },
  124 + query: {
  125 + report_yas: YAS.eventName.detailShow,
  126 + report_param: {
  127 + ART_ID: this.data.articleId,
  128 + ATR_TYPE: this.data.sort === 2 ? 1 : 2
  129 + }
123 } 130 }
124 }); 131 });
125 this.reportClickArticle(); 132 this.reportClickArticle();
@@ -38,11 +38,16 @@ export default { @@ -38,11 +38,16 @@ export default {
38 return parseInt(this.step, 10) / 100; 38 return parseInt(this.step, 10) / 100;
39 }, 39 },
40 headerStyle() { 40 headerStyle() {
  41 + let style = {};
  42 +
41 this.setIconColor(Math.floor((255 - 68) * (1 - this.stepPercent) + 68)); 43 this.setIconColor(Math.floor((255 - 68) * (1 - this.stepPercent) + 68));
  44 + style.background = `rgba(255,255,255,${this.stepPercent})`;
  45 +
  46 + if (this.stepPercent > 0.98) {
  47 + style.borderBottom = '1px solid #efefef';
  48 + }
42 49
43 - return {  
44 - background: `rgba(255,255,255,${this.stepPercent})`  
45 - }; 50 + return style;
46 }, 51 },
47 blockTranslateY() { 52 blockTranslateY() {
48 return '-' + parseInt(`0${this.titleStep}`, 10) + '%'; 53 return '-' + parseInt(`0${this.titleStep}`, 10) + '%';
@@ -67,7 +67,7 @@ export default { @@ -67,7 +67,7 @@ export default {
67 this.list[0].hide = authorState.hasAttention !== 'Y'; 67 this.list[0].hide = authorState.hasAttention !== 'Y';
68 68
69 this.list[2].href = `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${article.articleId}"}}`; 69 this.list[2].href = `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${article.articleId}"}}`;
70 - this.list[2].hide = version(this.$yoho.appVersion, '6.9.5') < 0 || article.isAuthor !== 'Y'; 70 + this.list[2].hide = article.sort === 2 || version(this.$yoho.appVersion, '6.9.5') < 0 || article.isAuthor !== 'Y';
71 this.list[3].hide = article.isAuthor !== 'Y'; 71 this.list[3].hide = article.isAuthor !== 'Y';
72 this.list = [...this.list]; 72 this.list = [...this.list];
73 73
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <Layout class="article"> 3 <Layout class="article">
4 <TopicHeader ref="header" :title="topicTitle" :step="headerAnimateStep" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicHeader> 4 <TopicHeader ref="header" :title="topicTitle" :step="headerAnimateStep" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicHeader>
5 5
6 - <RecycleScrollReveal v-if="topicInfo.viewModel == 2" :size="5" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="800" :on-fetch="onFetch" :manual-init="true" 6 + <RecycleScrollReveal :size="5" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="800" :on-fetch="onFetch" :manual-init="true"
7 @on-inited="onInited"> 7 @on-inited="onInited">
8 <template v-slot:eternalTop> 8 <template v-slot:eternalTop>
9 <TopicBanner ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner> 9 <TopicBanner ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner>
@@ -24,32 +24,6 @@ @@ -24,32 +24,6 @@
24 </template> 24 </template>
25 </RecycleScrollReveal> 25 </RecycleScrollReveal>
26 26
27 - <LayoutRecycleList v-if="topicInfo.viewModel == 1" :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch" :manual-init="true"  
28 - @on-inited="onInited">  
29 - <template class="article-item" #item="{ data }">  
30 - <TopicBanner v-if="data.data.topicHead" ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner>  
31 - <ArticleItem  
32 - v-else  
33 - type="topic"  
34 - :index="data.index"  
35 - :data="data.data"  
36 - :share="share"  
37 - :article-id="data.data.articleId"  
38 - :user-head-ico="yoho.context.userHeadIco"  
39 - :pos-id="posId"  
40 - @on-follow="follow => onFollow(data.data, follow)"  
41 - @on-resize="onResize"  
42 - @on-unlock-height="onUnlockHeight"  
43 - @on-show-guang="onShowGuang"  
44 - @on-show-comment="onShowComment"  
45 - @on-show-more="onShowMore">  
46 - <template v-if="data.data.dataType == 2">  
47 - <ArticleResource :data="data.data"></ArticleResource>  
48 - </template>  
49 - </ArticleItem>  
50 - </template>  
51 - </LayoutRecycleList>  
52 -  
53 <a v-if="publishUrl && !share" class="publish-btn hover-opacity" :class="{'scroll-opacity': scrolling}" :href="publishUrl"> 27 <a v-if="publishUrl && !share" class="publish-btn hover-opacity" :class="{'scroll-opacity': scrolling}" :href="publishUrl">
54 <span class="avatar-block"> 28 <span class="avatar-block">
55 <WidgetAvatar class="avatar" :src="yoho.context.userHeadIco" :width="70" :height="70"></WidgetAvatar> 29 <WidgetAvatar class="avatar" :src="yoho.context.userHeadIco" :width="70" :height="70"></WidgetAvatar>
@@ -62,7 +62,7 @@ export default { @@ -62,7 +62,7 @@ export default {
62 actionUrl() { 62 actionUrl() {
63 if (this.data.sort === 3) { 63 if (this.data.sort === 3) {
64 return this.data.actionUrl; 64 return this.data.actionUrl;
65 - } else if (+this.data.authStatus === 2 && version(this.$yoho.appVersion, '6.9.5') >= 0) { 65 + } else if (+this.data.authStatus === 2 && +this.data.sort !== 2 && version(this.$yoho.appVersion, '6.9.5') >= 0) {
66 return `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${this.data.articleId}"}}`; 66 return `?openby:yohobuy={"action":"go.editPost","params":{"articleId":"${this.data.articleId}"}}`;
67 } 67 }
68 68
@@ -29,23 +29,25 @@ @@ -29,23 +29,25 @@
29 @scroll="onScrollHandle" 29 @scroll="onScrollHandle"
30 @scroll-end="onScrollEndHandle" 30 @scroll-end="onScrollEndHandle"
31 @before-scroll-start="beforeScrollStartHandle"> 31 @before-scroll-start="beforeScrollStartHandle">
32 - <div ref="authorProfile" class="author-profile">  
33 - <WidgetAvatar class="avatar-box" :class="{'avatar-opacity': authorBaseData.showAvatar}" :src="authorBaseData.headIco" :group="authorBaseData.authGroupId" :width="100" :height="100"></WidgetAvatar>  
34 - <div class="author-section">  
35 - <ul class="author-fans">  
36 - <li v-for="item in fansList" :key="item.key">  
37 - <div class="click-wrap" @click="toPage(item.type)"></div>  
38 - <span class="num">{{authorBaseData[item.key] || 0}}</span>  
39 - <p class="name"><span>{{item.name}}</span></p>  
40 - </li>  
41 - </ul>  
42 - <div class="operate-wrap">  
43 - <a v-if="isOwner" class="operate-btn btn-user-edit" :href="mineInfoUrl">编辑个人资料</a>  
44 - <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> 32 + <div ref="authorProfile">
  33 + <div class="author-profile">
  34 + <WidgetAvatar class="avatar-box" :class="{'avatar-opacity': authorBaseData.showAvatar}" :src="authorBaseData.headIco" :group="authorBaseData.authGroupId" :width="100" :height="100"></WidgetAvatar>
  35 + <div class="author-section">
  36 + <ul class="author-fans">
  37 + <li v-for="item in fansList" :key="item.key">
  38 + <div class="click-wrap" @click="toPage(item.type)"></div>
  39 + <span class="num">{{authorBaseData[item.key] || 0}}</span>
  40 + <p class="name"><span>{{item.name}}</span></p>
  41 + </li>
  42 + </ul>
  43 + <div class="operate-wrap">
  44 + <a v-if="isOwner" class="operate-btn btn-user-edit" :href="mineInfoUrl">编辑个人资料</a>
  45 + <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>
  46 + </div>
45 </div> 47 </div>
46 </div> 48 </div>
  49 + <p v-if="authorBaseData.signature" class="author-desc">{{authorBaseData.signature}}</p>
47 </div> 50 </div>
48 - <p v-if="authorBaseData.signature" class="author-desc">{{authorBaseData.signature}}</p>  
49 <div ref="tabBlock" class="tab-block"> 51 <div ref="tabBlock" class="tab-block">
50 <FavTabBlock :tabs-num="tabsNum" :active-index="activeIndex" @change="changeTab"></FavTabBlock> 52 <FavTabBlock :tabs-num="tabsNum" :active-index="activeIndex" @change="changeTab"></FavTabBlock>
51 </div> 53 </div>
@@ -594,8 +596,9 @@ export default { @@ -594,8 +596,9 @@ export default {
594 } 596 }
595 597
596 .author-desc { 598 .author-desc {
597 - margin: 20px 30px; 599 + padding: 20px 30px;
598 font-size: 24px; 600 font-size: 24px;
  601 + line-height: 1.4;
599 font-weight: 300; 602 font-weight: 300;
600 overflow: hidden; 603 overflow: hidden;
601 text-overflow: ellipsis; 604 text-overflow: ellipsis;
@@ -14,6 +14,7 @@ @@ -14,6 +14,7 @@
14 import ArticleItem from './author-article-item'; 14 import ArticleItem from './author-article-item';
15 import {assign, get, forEach} from 'lodash'; 15 import {assign, get, forEach} from 'lodash';
16 import {getArticleImageSize} from 'utils/image-handler'; 16 import {getArticleImageSize} from 'utils/image-handler';
  17 +import YAS from 'utils/yas-constants';
17 18
18 export default { 19 export default {
19 data() { 20 data() {
@@ -159,15 +160,20 @@ export default { @@ -159,15 +160,20 @@ export default {
159 } 160 }
160 }); 161 });
161 }, 162 },
162 - toArticle({articleId}) {  
163 - let router = { 163 + toArticle({articleId, sort}) {
  164 + this.$router.push({
164 name: 'article', 165 name: 'article',
165 params: { 166 params: {
166 id: articleId 167 id: articleId
  168 + },
  169 + query: {
  170 + report_yas: YAS.eventName.detailShow,
  171 + report_param: {
  172 + ART_ID: articleId,
  173 + ATR_TYPE: sort === 2 ? 1 : 2
  174 + }
167 } 175 }
168 - };  
169 -  
170 - this.$router.push(router); 176 + });
171 } 177 }
172 }, 178 },
173 components: { 179 components: {

1.76 KB | W: | H:

1.74 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin