Authored by yyq

Merge branch 'master' of git.yoho.cn:fe/yoho-community-web

@@ -577,8 +577,6 @@ const yoho = { @@ -577,8 +577,6 @@ const yoho = {
577 goProductDetail(skn) { 577 goProductDetail(skn) {
578 var url = window.location.protocol + '//m.yohobuy.com/'; 578 var url = window.location.protocol + '//m.yohobuy.com/';
579 579
580 - console.log(url);  
581 -  
582 if (this.isYohoBuy && window.yohoInterface) { 580 if (this.isYohoBuy && window.yohoInterface) {
583 url = url + '?openby:yohobuy=' + JSON.stringify({ 581 url = url + '?openby:yohobuy=' + JSON.stringify({
584 action: 'go.productDetail', 582 action: 'go.productDetail',
@@ -109,7 +109,7 @@ export default { @@ -109,7 +109,7 @@ export default {
109 right: 0; 109 right: 0;
110 top: 0; 110 top: 0;
111 bottom: 0; 111 bottom: 0;
112 - z-index: 100; 112 + z-index: 5;
113 113
114 .yoho-popup-mask { 114 .yoho-popup-mask {
115 display: block; 115 display: block;
@@ -90,7 +90,7 @@ export default { @@ -90,7 +90,7 @@ export default {
90 } 90 }
91 }, 91 },
92 onClick() { 92 onClick() {
93 - this.product.productSkn && this.$yoho.goProductDetail(this.product.productSkn); 93 + this.product.product_skn && this.$yoho.goProductDetail(this.product.product_skn);
94 } 94 }
95 } 95 }
96 }; 96 };
1 <template> 1 <template>
2 - <Layout class="article">  
3 - <LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity">  
4 - <template v-if="showHeader">  
5 - <WidgetAvatar class="widget-avatar" :src="currentAuthor.authorHeadIco" :width="70" :height="70"></WidgetAvatar>  
6 - <span class="user-name">{{currentAuthor.authorName}}</span>  
7 - </template>  
8 - <template v-if="showHeader" v-slot:opts>  
9 - <WidgetFollow class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)"></WidgetFollow>  
10 - </template>  
11 - </LayoutHeader>  
12 - <LayoutRecycleList v-if="isMounted" ref="scroll" @scroll="onScroll" :offset="1000" :on-fetch="onFetch">  
13 - <template class="article-item" v-slot:item="{ data }">  
14 - <ArticleItem  
15 - :id="`item${data.index}`"  
16 - :data="data"  
17 - :data-id="data.articleId"  
18 - @on-resize="onResize(data)"  
19 - @on-resizeing="onResizeing(data)"  
20 - @on-follow="follow => onFollow(data, follow)"  
21 - @on-expand="onExpand"  
22 - @on-comment="onComment"></ArticleItem>  
23 - <div :id="`ph${data.index}`"></div>  
24 - </template>  
25 - </LayoutRecycleList>  
26 - <slot name="thumb" v-else></slot>  
27 - 2 + <div>
  3 + <Layout class="article">
  4 + <LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity">
  5 + <template v-if="showHeader">
  6 + <WidgetAvatar class="widget-avatar" :src="currentAuthor.authorHeadIco" :width="70" :height="70"></WidgetAvatar>
  7 + <span class="user-name">{{currentAuthor.authorName}}</span>
  8 + </template>
  9 + <template v-if="showHeader" v-slot:opts>
  10 + <WidgetFollow class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)"></WidgetFollow>
  11 + </template>
  12 + </LayoutHeader>
  13 + <LayoutRecycleList v-if="isMounted" ref="scroll" @scroll="onScroll" :offset="1000" :on-fetch="onFetch">
  14 + <template class="article-item" v-slot:item="{ data }">
  15 + <ArticleItem
  16 + :id="`item${data.index}`"
  17 + :data="data"
  18 + :data-id="data.articleId"
  19 + @on-resize="onResize(data)"
  20 + @on-resizeing="onResizeing(data)"
  21 + @on-follow="follow => onFollow(data, follow)"
  22 + @on-expand="onExpand"
  23 + @on-comment="onComment"></ArticleItem>
  24 + <div :id="`ph${data.index}`"></div>
  25 + </template>
  26 + </LayoutRecycleList>
  27 + <slot name="thumb" v-else></slot>
  28 + </Layout>
28 <ArticleActionSheet v-if="showArticleDetailAction" ref="actionSheet"></ArticleActionSheet> 29 <ArticleActionSheet v-if="showArticleDetailAction" ref="actionSheet"></ArticleActionSheet>
29 <YohoActionSheet transfer v-if="showCommentAction" ref="commentAction" :full="true"> 30 <YohoActionSheet transfer v-if="showCommentAction" ref="commentAction" :full="true">
30 <Comment ref="comment" :destId="articleId" :popup="true" @on-close="onClose"></Comment> 31 <Comment ref="comment" :destId="articleId" :popup="true" @on-close="onClose"></Comment>
31 </YohoActionSheet> 32 </YohoActionSheet>
32 - </Layout> 33 + </div>
33 </template> 34 </template>
34 35
35 <script> 36 <script>
@@ -30,6 +30,8 @@ export default { @@ -30,6 +30,8 @@ export default {
30 }, 30 },
31 computed: { 31 computed: {
32 }, 32 },
  33 + mounted() {
  34 + },
33 methods: { 35 methods: {
34 onComment() { 36 onComment() {
35 this.$emit('on-comment-click'); 37 this.$emit('on-comment-click');
@@ -109,8 +109,8 @@ export default { @@ -109,8 +109,8 @@ export default {
109 let article = (result.getArticle = (data && data.data) || {}); 109 let article = (result.getArticle = (data && data.data) || {});
110 110
111 let promises = [ 111 let promises = [
112 - this.$api.get('/api/guang/article/content', { article_id }),  
113 - this.$api.get('/api/guang/article/zan', { articleId: grass_id }) 112 + this.$api.post('/api/guang/article/content', { article_id }),
  113 + this.$api.post('/api/guang/article/zan', { articleId: grass_id })
114 ]; 114 ];
115 115
116 const [content, zan] = await Promise.all(promises); 116 const [content, zan] = await Promise.all(promises);
@@ -120,12 +120,12 @@ export default { @@ -120,12 +120,12 @@ export default {
120 120
121 // 插入商品 121 // 插入商品
122 const [goodsList, favsList] = await Promise.all([ 122 const [goodsList, favsList] = await Promise.all([
123 - this.$api.get('/api/guang/article/queryGoods', { 123 + this.$api.post('/api/guang/article/queryGoods', {
124 query: processContents.allgoods.join(','), 124 query: processContents.allgoods.join(','),
125 order: 's_t_desc', 125 order: 's_t_desc',
126 limit: processContents.allgoods.length || 1 126 limit: processContents.allgoods.length || 1
127 }), 127 }),
128 - this.$api.get('/api/favorite/batchCheckIsFavorite', { 128 + this.$api.post('/api/favorite/batchCheckIsFavorite', {
129 favIds: processContents.allgoods.join(','), 129 favIds: processContents.allgoods.join(','),
130 type: 'product' 130 type: 'product'
131 }) 131 })
@@ -155,7 +155,7 @@ export default { @@ -155,7 +155,7 @@ export default {
155 result.getAuthor.name = zan.data.authorName; 155 result.getAuthor.name = zan.data.authorName;
156 result.getAuthor.avatar = zan.data.authorHeadIco; 156 result.getAuthor.avatar = zan.data.authorHeadIco;
157 result.getAuthor.authorType = zan.data.authorType; 157 result.getAuthor.authorType = zan.data.authorType;
158 - result.getAuthor.follow = get(zan, 'data.hasAttention', false); 158 + result.getAuthor.follow = get(zan, 'data.hasAttention', false) === 'Y';
159 } 159 }
160 160
161 if (article && article.tags) { 161 if (article && article.tags) {
@@ -282,6 +282,7 @@ function processProductList(list, favsList) { @@ -282,6 +282,7 @@ function processProductList(list, favsList) {
282 product.productImage = product.default_images; 282 product.productImage = product.default_images;
283 product.salesPrice = product.sales_price; 283 product.salesPrice = product.sales_price;
284 product.productName = product.product_name; 284 product.productName = product.product_name;
  285 + product.productId = product.product_id;
285 286
286 product.is_soon_sold_out = product.is_soon_sold_out === 'Y'; 287 product.is_soon_sold_out = product.is_soon_sold_out === 'Y';
287 288
@@ -290,12 +291,12 @@ function processProductList(list, favsList) { @@ -290,12 +291,12 @@ function processProductList(list, favsList) {
290 } 291 }
291 292
292 // fav 293 // fav
293 - const fav = favsList.find(i => i.id === product.product_id); 294 + const fav = favsList.find(i => `${i.id}` === `${product.product_skn}`);
294 295
295 product.id = product.product_id; 296 product.id = product.product_id;
296 product.productType = 1; 297 product.productType = 1;
297 298
298 - product.favorite = fav || false; 299 + product.favorite = fav.favorite || false;
299 300
300 /** 301 /**
301 * 全球购商品标记 302 * 全球购商品标记
@@ -65,7 +65,7 @@ module.exports = { @@ -65,7 +65,7 @@ module.exports = {
65 api: URI_PACKAGE_ARTICLE, 65 api: URI_PACKAGE_ARTICLE,
66 path: 'getArticle', 66 path: 'getArticle',
67 params: { 67 params: {
68 - article_id: {type: String} 68 + article_id: {type: Number}
69 } 69 }
70 }, 70 },
71 '/api/guang/article/author': { 71 '/api/guang/article/author': {
@@ -81,7 +81,7 @@ module.exports = { @@ -81,7 +81,7 @@ module.exports = {
81 api: URI_PACKAGE_ARTICLE, 81 api: URI_PACKAGE_ARTICLE,
82 path: 'getArticleContent', 82 path: 'getArticleContent',
83 params: { 83 params: {
84 - article_id: {type: String} 84 + article_id: {type: Number}
85 } 85 }
86 }, 86 },
87 '/api/guang/article/zan': { 87 '/api/guang/article/zan': {