Authored by yyq

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

... ... @@ -577,8 +577,6 @@ const yoho = {
goProductDetail(skn) {
var url = window.location.protocol + '//m.yohobuy.com/';
console.log(url);
if (this.isYohoBuy && window.yohoInterface) {
url = url + '?openby:yohobuy=' + JSON.stringify({
action: 'go.productDetail',
... ...
... ... @@ -109,7 +109,7 @@ export default {
right: 0;
top: 0;
bottom: 0;
z-index: 100;
z-index: 5;
.yoho-popup-mask {
display: block;
... ...
... ... @@ -90,7 +90,7 @@ export default {
}
},
onClick() {
this.product.productSkn && this.$yoho.goProductDetail(this.product.productSkn);
this.product.product_skn && this.$yoho.goProductDetail(this.product.product_skn);
}
}
};
... ...
<template>
<Layout class="article">
<LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity">
<template v-if="showHeader">
<WidgetAvatar class="widget-avatar" :src="currentAuthor.authorHeadIco" :width="70" :height="70"></WidgetAvatar>
<span class="user-name">{{currentAuthor.authorName}}</span>
</template>
<template v-if="showHeader" v-slot:opts>
<WidgetFollow class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)"></WidgetFollow>
</template>
</LayoutHeader>
<LayoutRecycleList v-if="isMounted" ref="scroll" @scroll="onScroll" :offset="1000" :on-fetch="onFetch">
<template class="article-item" v-slot:item="{ data }">
<ArticleItem
:id="`item${data.index}`"
:data="data"
:data-id="data.articleId"
@on-resize="onResize(data)"
@on-resizeing="onResizeing(data)"
@on-follow="follow => onFollow(data, follow)"
@on-expand="onExpand"
@on-comment="onComment"></ArticleItem>
<div :id="`ph${data.index}`"></div>
</template>
</LayoutRecycleList>
<slot name="thumb" v-else></slot>
<div>
<Layout class="article">
<LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity">
<template v-if="showHeader">
<WidgetAvatar class="widget-avatar" :src="currentAuthor.authorHeadIco" :width="70" :height="70"></WidgetAvatar>
<span class="user-name">{{currentAuthor.authorName}}</span>
</template>
<template v-if="showHeader" v-slot:opts>
<WidgetFollow class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)"></WidgetFollow>
</template>
</LayoutHeader>
<LayoutRecycleList v-if="isMounted" ref="scroll" @scroll="onScroll" :offset="1000" :on-fetch="onFetch">
<template class="article-item" v-slot:item="{ data }">
<ArticleItem
:id="`item${data.index}`"
:data="data"
:data-id="data.articleId"
@on-resize="onResize(data)"
@on-resizeing="onResizeing(data)"
@on-follow="follow => onFollow(data, follow)"
@on-expand="onExpand"
@on-comment="onComment"></ArticleItem>
<div :id="`ph${data.index}`"></div>
</template>
</LayoutRecycleList>
<slot name="thumb" v-else></slot>
</Layout>
<ArticleActionSheet v-if="showArticleDetailAction" ref="actionSheet"></ArticleActionSheet>
<YohoActionSheet transfer v-if="showCommentAction" ref="commentAction" :full="true">
<Comment ref="comment" :destId="articleId" :popup="true" @on-close="onClose"></Comment>
</YohoActionSheet>
</Layout>
</div>
</template>
<script>
... ...
... ... @@ -30,6 +30,8 @@ export default {
},
computed: {
},
mounted() {
},
methods: {
onComment() {
this.$emit('on-comment-click');
... ...
... ... @@ -109,8 +109,8 @@ export default {
let article = (result.getArticle = (data && data.data) || {});
let promises = [
this.$api.get('/api/guang/article/content', { article_id }),
this.$api.get('/api/guang/article/zan', { articleId: grass_id })
this.$api.post('/api/guang/article/content', { article_id }),
this.$api.post('/api/guang/article/zan', { articleId: grass_id })
];
const [content, zan] = await Promise.all(promises);
... ... @@ -120,12 +120,12 @@ export default {
// 插入商品
const [goodsList, favsList] = await Promise.all([
this.$api.get('/api/guang/article/queryGoods', {
this.$api.post('/api/guang/article/queryGoods', {
query: processContents.allgoods.join(','),
order: 's_t_desc',
limit: processContents.allgoods.length || 1
}),
this.$api.get('/api/favorite/batchCheckIsFavorite', {
this.$api.post('/api/favorite/batchCheckIsFavorite', {
favIds: processContents.allgoods.join(','),
type: 'product'
})
... ... @@ -155,7 +155,7 @@ export default {
result.getAuthor.name = zan.data.authorName;
result.getAuthor.avatar = zan.data.authorHeadIco;
result.getAuthor.authorType = zan.data.authorType;
result.getAuthor.follow = get(zan, 'data.hasAttention', false);
result.getAuthor.follow = get(zan, 'data.hasAttention', false) === 'Y';
}
if (article && article.tags) {
... ...
... ... @@ -282,6 +282,7 @@ function processProductList(list, favsList) {
product.productImage = product.default_images;
product.salesPrice = product.sales_price;
product.productName = product.product_name;
product.productId = product.product_id;
product.is_soon_sold_out = product.is_soon_sold_out === 'Y';
... ... @@ -290,12 +291,12 @@ function processProductList(list, favsList) {
}
// fav
const fav = favsList.find(i => i.id === product.product_id);
const fav = favsList.find(i => `${i.id}` === `${product.product_skn}`);
product.id = product.product_id;
product.productType = 1;
product.favorite = fav || false;
product.favorite = fav.favorite || false;
/**
* 全球购商品标记
... ...
... ... @@ -65,7 +65,7 @@ module.exports = {
api: URI_PACKAGE_ARTICLE,
path: 'getArticle',
params: {
article_id: {type: String}
article_id: {type: Number}
}
},
'/api/guang/article/author': {
... ... @@ -81,7 +81,7 @@ module.exports = {
api: URI_PACKAGE_ARTICLE,
path: 'getArticleContent',
params: {
article_id: {type: String}
article_id: {type: Number}
}
},
'/api/guang/article/zan': {
... ...