Authored by 陈峰

commit

... ... @@ -24,23 +24,26 @@
{{parentComment.content}}
</CommentPlaceholder>
<div class="reply-main" v-if="replayShowList.length">
<p class="reply-item" v-for="(reply, replyIndex) in replayShowList" :key="replyIndex">
<CommentPlaceholder
tag="p"
class="reply-item"
v-for="(reply, replyIndex) in replayShowList"
:key="replyIndex"
:dest-id="reply.id"
:add-type="1"
:user="reply.userName"
:column-type="columnType"
@on-comment="() => onReply({destId: parentComment.id})">
<span class="reply-user">
{{reply.userName}}
</span>
<span v-if="reply.parentUserName">
回复<em class="reply-to-user">@{{reply.parentUserName}}</em>
</span>:
<CommentPlaceholder
tag="span"
:dest-id="reply.id"
:add-type="1"
:user="reply.userName"
:column-type="columnType"
@on-comment="onReply">
<span>
{{reply.content}}
</CommentPlaceholder>
</p>
</span>
</CommentPlaceholder>
<p class="reply-more" v-if="moreReplyNum > 0" @click="onShowMore">
{{replyMoreText}}
<i class="iconfont icon-right" v-if="!isShowAllReply"></i>
... ... @@ -176,7 +179,6 @@ export default {
.reply-item {
margin-bottom: 20px;
display: flex;
&:last-child {
margin-bottom: 0;
... ...
... ... @@ -7,7 +7,8 @@
:key="index"
:parent-comment="comment.parentComment"
:children-comments="comment.childrenComments"
:column-type="columnType">
:column-type="columnType"
@on-reply="onReply">
</CommentItem>
</Scroll>
</div>
... ...
... ... @@ -28,7 +28,7 @@ export default {
this.comment(content);
},
fail: (e) => {
console.log('fail', e)
console.error(e);
}
});
} else {
... ...
<template>
<div class="article-item-comment">
<p class="comment-item" v-for="(comment, inx) in data.comments" :key="inx">
<CommentPlaceholder
tag="p"
class="comment-item"
v-for="(comment, inx) in data.comments"
:key="inx"
:dest-id="comment.id"
:add-type="1"
:column-type="comment.columnType"
:user="comment.userName">
<span class="user-name">{{comment.userName}}:</span>
<span class="comment-content">{{comment.content}}</span>
</p>
</CommentPlaceholder>
<div class="comment">
<div class="comment-input hover-opacity" @click="onComment">添加回复:赞美是一种美德</div>
<CommentPlaceholder
class="comment-input hover-opacity"
:dest-id="data.articleId"
:add-type="0"
:column-type="1001">
添加回复:赞美是一种美德
</CommentPlaceholder>
</div>
<div class="total-comment">
<div class="total hover-opacity" @click="onGoComment">查看{{data.commentCount}}条评论</div>
... ...
... ... @@ -61,7 +61,7 @@ export default {
commentCount: this.data.commentCount,
publishTime: this.data.publishTime,
date: dayjs(this.data.publishTime).fromNow(),
articleId: this.data.articleId
articleId: this.data.articleId,
};
},
productListData() {
... ...
import * as Types from './types';
import { get, concat } from 'lodash';
import { get } from 'lodash';
import * as guangProcess from './guangProcess';
export default {
... ...
... ... @@ -53,7 +53,7 @@ export default {
return result;
},
async postComment(actions, {content, destId, commentId, addType, columnType = 1001}) {
const result = await this.$api.get('/api/grass/addArticleComment', {
const result = await this.$api.post('/api/grass/addArticleComment', {
destId,
content,
addType,
... ...
export default {
async postProductFav({commit}, {productId, favorite, productType}) {
async postProductFav(actions, {productId, favorite, productType}) {
let postUrl, params;
if (productType === 1) {
... ... @@ -15,7 +15,7 @@ export default {
};
}
const result = await this.$api.get(postUrl, params);
const result = await this.$api.post(postUrl, params);
return result;
}
... ...
... ... @@ -26,7 +26,7 @@ export default {
return result;
},
async praiseArticle(actions, {articleId, status}) {
const result = await this.$api.get('/api/grass/updateArticlePraise', {
const result = await this.$api.post('/api/grass/updateArticlePraise', {
articleId,
status: status ? 0 : 1
});
... ... @@ -34,7 +34,7 @@ export default {
return result;
},
async praiseComment(actions, {commentId, status}) {
const result = await this.$api.get('/api/grass/updateCommentPraise', {
const result = await this.$api.post('/api/grass/updateCommentPraise', {
commentId,
status: status ? 0 : 1
});
... ...