Authored by yyq

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

... ... @@ -604,6 +604,17 @@ const yoho = {
} else {
// tip(tipInfo);
}
},
share(args, success, fail) {
if (this.isYohoBuy && window.yohoInterface) {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.showshareaction',
arguments: args
});
} else {
// tip(tipInfo);
}
}
};
... ...
... ... @@ -22,14 +22,10 @@ export default {
const hint = this.user ? `回复${this.user}:` : '';
if (this.$yoho.isYohoBuy) {
this.$yoho.getInput({
hint,
success: (content) => {
this.comment(content);
},
fail: (e) => {
console.error(e);
}
this.$yoho.getInput({hint}, (content) => {
this.comment(content);
}, (e) => {
console.error(e);
});
} else {
this.$createDialog({
... ...
... ... @@ -6,7 +6,7 @@
<i class="iconfont icon-close icon" @click="onClose"></i>
</template>
</LayoutHeader>
<CommentList :dest-id="destId" :column-type="1001" @on-page-change="onPageChange"></CommentList>
<CommentList ref="commentList" :dest-id="destId" :column-type="1001" @on-page-change="onPageChange"></CommentList>
</Layout>
</template>
... ... @@ -38,6 +38,9 @@ export default {
},
onClose() {
this.$emit('on-close');
},
init() {
this.$refs.commentList.init();
}
},
components: {CommentList}
... ...
... ... @@ -57,7 +57,7 @@ export default {
const favorite = !this.favorite;
const result = await this.postProductFav({
productId: this.product.id,
productId: this.product.productId,
favorite,
productType: this.product.productType
});
... ... @@ -90,8 +90,7 @@ export default {
}
},
onClick() {
console.log(this.product.product_skn);
this.product.product_skn && this.$yoho.goProductDetail(this.product.product_skn);
this.product.productSkn && this.$yoho.goProductDetail(this.product.productSkn);
}
}
};
... ...
... ... @@ -71,6 +71,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
&.follow {
border: solid 1px #4a4a4a;
... ...
... ... @@ -15,7 +15,7 @@
</div>
<div class="widgets">
<div class="share">
<WidgetShare></WidgetShare>
<WidgetShare @click.native="onShare"></WidgetShare>
</div>
<div class="opts">
<WidgetFav :num="data.praiseCount" :article-id="data.articleId" :option="praiseOption"></WidgetFav>
... ... @@ -95,6 +95,15 @@ export default {
}
});
},
onShare() {
console.log(this.data.imageUrl)
this.$yoho.share({
title: '逛资讯',
imgUrl: this.data.imageUrl,
link: `http://yoho-community-web.test3.ingress.dev.yohocorp.com/article/${this.data.articleId}`,
desc: this.data.intro,
});
},
onExpand() {
if (this.data.articleType === 2) {
this.$emit('on-expand');
... ... @@ -129,6 +138,7 @@ export default {
.article-item-intro {
width: 100%;
padding: 0 30px;
margin-top: 20px;
.intro {
font-size: 28px;
... ...
... ... @@ -10,7 +10,7 @@
</template>
<script>
import {get} from 'lodash';
import {get, first} from 'lodash';
import ArticleItemHeader from './article-item-header';
import ArticleItemSlide from './article-item-slide';
import ArticleItemIntro from './article-item-intro';
... ... @@ -52,7 +52,8 @@ export default {
commentCount: this.data.commentCount,
praiseCount: this.data.praiseCount,
favoriteCount: this.data.favoriteCount,
articleId: this.data.articleId
articleId: this.data.articleId,
imageUrl: get(first(this.slideData.blockList), 'contentData', '').replace('{mode}', 2).replace('{width}', 200).replace('{height}', 200)
};
},
commentData() {
... ...
... ... @@ -27,7 +27,7 @@
<ArticleActionSheet v-if="showArticleDetailAction" ref="actionSheet"></ArticleActionSheet>
<YohoActionSheet transfer v-if="showCommentAction" ref="commentAction" :full="true">
<Comment :destId="articleId" :popup="true" @on-close="onClose"></Comment>
<Comment ref="comment" :destId="articleId" :popup="true" @on-close="onClose"></Comment>
</YohoActionSheet>
</Layout>
</template>
... ... @@ -78,6 +78,7 @@ export default {
this.articleId = articleId;
this.showCommentAction = true;
this.$nextTick(() => {
this.$refs.comment.init();
this.$refs.commentAction.show();
});
},
... ... @@ -186,7 +187,7 @@ export default {
.user-name {
margin-left: 10px;
font-size: 12px;
font-size: 24px;
color: #000;
}
</style>
... ...
... ... @@ -31,9 +31,9 @@ export default {
articles.forEach(article => {
get(article, 'productList', []).forEach(product => {
if (article.articleProductType === 1) {
products.push(product.id);
products.push(product.productId);
} else if (article.articleProductType === 2) {
ufoProducts.push(product.id);
ufoProducts.push(product.productId);
}
});
});
... ...
... ... @@ -28,7 +28,7 @@ export default {
articles.forEach(article => {
if (article.articleProductType === articleProductType) {
get(article, 'productList', []).forEach(product => {
const find = favs.find(f => f.id === product.id);
const find = favs.find(f => f.id === product.productId);
if (find) {
product.favorite = find.favorite;
... ...
... ... @@ -4,10 +4,17 @@ export default {
if (productType === 1) {
postUrl = favorite ? '/api/favorite/add' : '/api/favorite/cancel';
params = {
type: 'product',
fav_id: productId
};
if (favorite) {
params = {
type: 'product',
id: productId
};
} else {
params = {
type: 'product',
fav_id: productId
};
}
} else if (productType === 2) { // ufo
postUrl = favorite ? '/api/ufo/user/favoriteAdd' : '/api/ufo/user/favoriteCancel';
params = {
... ...
... ... @@ -18,7 +18,7 @@ module.exports = {
},
'/api/grass/columnArticleDetail': {
api: 'app.grass.columnArticleDetail',
cache: true,
auth: true,
params: {
page: {type: Number, require: false},
limit: {type: Number, require: false},
... ...