Merge branch 'master' of git.yoho.cn:fe/yoho-community-web
Showing
8 changed files
with
17 additions
and
15 deletions
@@ -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', |
@@ -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 | + <div> | ||
2 | <Layout class="article"> | 3 | <Layout class="article"> |
3 | <LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity"> | 4 | <LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity"> |
4 | <template v-if="showHeader"> | 5 | <template v-if="showHeader"> |
@@ -24,12 +25,12 @@ | @@ -24,12 +25,12 @@ | ||
24 | </template> | 25 | </template> |
25 | </LayoutRecycleList> | 26 | </LayoutRecycleList> |
26 | <slot name="thumb" v-else></slot> | 27 | <slot name="thumb" v-else></slot> |
27 | - | 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> |
@@ -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': { |
-
Please register or login to post a comment