Authored by 陈峰

commit

... ... @@ -7,7 +7,11 @@
<p class="comment-user-name">{{parentComment.userName || '&nbsp;'}}</p>
<p class="comment-time">{{parentComment.createTime | time}}</p>
</div>
<WidgetFav class="comment-fav" :num="parentComment.praiseTotal"></WidgetFav>
<WidgetFav
class="comment-fav"
:comment-id="parentComment.id"
:num="parentComment.praiseTotal"
:option="favOption"></WidgetFav>
</div>
<div class="comment-cont" @click="replyComment(parentComment.id)" :data-parent-id="parentComment.parentId" :data-root-id="parentComment.rootId">
... ... @@ -51,10 +55,15 @@ export default {
data() {
return {
isShowAllReply: false,
limitNum: 2
limitNum: 2,
};
},
computed: {
favOption() {
return {
selected: this.parentComment.isPraise === 'Y'
};
},
replayShowList() {
if (this.childrenComments.length <= this.limitNum) {
return this.childrenComments;
... ... @@ -71,8 +80,6 @@ export default {
return this.isShowAllReply ? '收起' : `查看${this.moreReplyNum}条回复`;
}
},
created() {
},
methods: {
...mapActions(['postComment']),
onShowMore() {
... ... @@ -142,6 +149,10 @@ export default {
}
}
.comment-fav {
padding-right: 20px;
}
.comment-cont {
font-size: 28px;
color: #444;
... ...
... ... @@ -41,6 +41,7 @@ export default {
bottom: 0;
display: flex;
flex-direction: column;
background-color: #fff;
&.header-fixed {
display: block;
... ...
... ... @@ -191,6 +191,7 @@
this.syncService(syncFnName, {
articleId: this.articleId,
commentId: this.commentId,
status: this.btnSelected
}).then(backFn).catch(backFn);
}
... ...
... ... @@ -27,7 +27,7 @@ window._router = get(store, 'state.yoho.context.route');
Vue.prop('yoho', yoho);
Vue.prop('sdk', sdk);
Vue.prop('auth', function() {
if (!get(this.$store, '$context.islogin')) {
if (!get(this.$store, '$context.isLogin')) {
this.$sdk && this.$sdk.goLogin && this.$sdk.goLogin();
return false;
}
... ...