Skip to content

Commit 46be180

Browse files
committed
feat: 更新评论功能,添加账号认证提示及相关样式
1 parent 8b88230 commit 46be180

File tree

6 files changed

+76
-9
lines changed

6 files changed

+76
-9
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
"root": true
2929
},
3030
"dependencies": {
31-
"@jx3box/jx3box-comment-ui": "^2.0.7",
31+
"@jx3box/jx3box-comment-ui": "^2.0.8",
3232
"@jx3box/jx3box-common": "^8.7.4",
33-
"@jx3box/jx3box-common-ui": "^9.5.14",
33+
"@jx3box/jx3box-common-ui": "^9.5.15",
3434
"@jx3box/jx3box-data": "^3.9.2",
3535
"@jx3box/jx3box-editor": "^2.2.41",
3636
"@jx3box/jx3box-emotion": "^1.2.14",

src/components/community/ReplyForReply.vue

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<el-form ref="form" class="c-comment-subbox m-comment-editor">
2+
<el-form ref="form" class="c-comment-subbox m-comment-editor" :class="{'m-comment-mask': commentStrict}">
3+
<div class="u-mask">
4+
参与评论,需先进行<a href="/dashboard/auth" class="u-link">账号认证</a>。
5+
</div>
36
<div class="u-subbox-label">
47
回复
58
<el-link type="primary" target="_blank" :href="userHref">@{{ username }}</el-link>
@@ -29,7 +32,7 @@
2932
// import Uploader from "./upload.vue";
3033
import Emotion from "@jx3box/jx3box-emotion/src/Emotion.vue";
3134
export default {
32-
props: ["username", "userHref", "currentId"],
35+
props: ["username", "userHref", "currentId", "commentStrict"],
3336
data: function () {
3437
return {
3538
content: "",
@@ -120,5 +123,29 @@ export default {
120123
margin: 0 10px 0 0;
121124
vertical-align: middle;
122125
}
126+
.pr;
127+
128+
.u-mask {
129+
.pa;
130+
top: 0;
131+
left: 0;
132+
width: 100%;
133+
height: 100%;
134+
background: rgba(255, 255, 255, 0.8);
135+
z-index: 10;
136+
display: none;
137+
text-align: center;
138+
align-content: center;
139+
}
140+
141+
.u-link {
142+
color: @primary;
143+
}
144+
}
145+
.m-comment-mask {
146+
.pr;
147+
.u-mask {
148+
.db;
149+
}
123150
}
124151
</style>

src/components/community/comment_editor.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
22
<el-form ref="form" :model="newComment" class="c-comment-box m-comment-reply">
3+
<div class="u-mask">
4+
参与评论,需先进行<a href="/dashboard/auth" class="u-link">账号认证</a>。
5+
</div>
36
<el-form-item>
47
<el-input
58
rows="6"
@@ -301,6 +304,25 @@ export default {
301304
}
302305
.size(180px,42px);
303306
}
307+
308+
.pr;
309+
310+
.u-mask {
311+
.pa;
312+
top: 0;
313+
left: 0;
314+
width: 100%;
315+
height: 100%;
316+
background: rgba(255, 255, 255, 0.8);
317+
z-index: 10;
318+
display: none;
319+
text-align: center;
320+
align-content: center;
321+
}
322+
323+
.u-link {
324+
color: @primary;
325+
}
304326
}
305327
@media screen and (max-width: @phone) {
306328
.u-comment-editor.el-textarea {

src/components/community/comment_item.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
:user-href="authorLink(userInfo.id)"
5858
@hideForm="showReplyForReplyFrom = false"
5959
@doReply="doReply"
60+
:commentStrict="commentStrict"
6061
/>
6162
</div>
6263
</div>
@@ -79,7 +80,7 @@ const DECORATION_KEY = "decoration_comment_";
7980
8081
export default {
8182
name: "CommentItem",
82-
props: ["post"],
83+
props: ["post", "commentStrict"],
8384
inject: ["getTopicData", "getReplyData", "getCommentList"],
8485
components: {
8586
ReplyForReply,

src/components/community/reply_item.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
:user-href="authorLink(userId)"
181181
@hideForm="showReplyForReplyFrom = false"
182182
@doReply="doReply"
183+
:commentStrict="commentStrict"
183184
/>
184185
</div>
185186

@@ -196,7 +197,7 @@
196197
</div>
197198
<!-- 评论列表 -->
198199
<div v-if="!isMaster && commentList.length" class="m-comment-list">
199-
<CommentItem v-for="item in commentList" :key="item.id" :post="item" />
200+
<CommentItem v-for="item in commentList" :key="item.id" :post="item" :commonStrict="commentStrict" />
200201
</div>
201202

202203
<!-- 分页 -->
@@ -238,7 +239,7 @@ import { getHistorySummary } from "@/service/pay";
238239
export default {
239240
name: "ReplyItem",
240241
inject: ["getTopicData", "getReplyList", "onReplyTopic"],
241-
props: ["isMaster", "post", "isAuthor", "nullTip"],
242+
props: ["isMaster", "post", "isAuthor", "nullTip", "commentStrict"],
242243
components: {
243244
DeleteButton,
244245
ForwardButton,

src/views/CommunitySingle.vue

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
:post="item"
7777
:is-master="false"
7878
:is-author="isAuthor"
79+
:comment-strict="comment_strict"
7980
/>
8081
</div>
8182
</div>
@@ -109,7 +110,7 @@
109110
</div>
110111
<div class="u-editor">
111112
<el-divider content-position="left">回帖</el-divider>
112-
<CommentEditor @submit="onReplyTopic" v-if="!isDisabledComment" />
113+
<CommentEditor @submit="onReplyTopic" v-if="!isDisabledComment" :class="{ 'c-comment-mask': comment_strict }" />
113114
<el-alert :show-close="false" center v-else class="m-disabled-comment-tip"
114115
>作者已关闭回帖功能</el-alert
115116
>
@@ -135,7 +136,7 @@
135136
></boxCoinRecords>
136137

137138
<el-dialog :visible.sync="showComment" title="快捷回复" :width="isPhone ? '95%' : ''">
138-
<CommentEditor @submit="onReplyTopic"></CommentEditor>
139+
<CommentEditor @submit="onReplyTopic" :class="{ 'c-comment-mask': comment_strict }"></CommentEditor>
139140
</el-dialog>
140141

141142
<go-to-top-or-bottom />
@@ -165,6 +166,7 @@ import renderJx3Element from "@jx3box/jx3box-editor/assets/js/jx3_element";
165166
import Author from "@jx3box/jx3box-editor/src/components/Author.vue";
166167
import { __visibleMap } from "@/utils/config";
167168
import { postReadHistory } from "@jx3box/jx3box-common/js/stat";
169+
import {getConfig} from "@jx3box/jx3box-common/js/api_misc";
168170
169171
const appKey = "community";
170172
@@ -215,6 +217,7 @@ export default {
215217
// 打赏相关 end
216218
217219
showComment: false,
220+
comment_strict: false,
218221
219222
collection_data: "",
220223
@@ -292,6 +295,12 @@ export default {
292295
});
293296
});
294297
298+
getConfig({
299+
key: "comment_strict"
300+
}).then((res) => {
301+
this.comment_strict = res.data.data.val == 1;
302+
});
303+
295304
// 打赏
296305
bus.on("onThx", (data) => {
297306
this.postType = data.postType;
@@ -580,6 +589,13 @@ export default {
580589
.z(2000);
581590
}
582591
592+
.c-comment-mask {
593+
.pr;
594+
.u-mask {
595+
display: block;
596+
}
597+
}
598+
583599
@media screen and (max-width: @phone) {
584600
.m-single-thx {
585601
zoom: 0.8;

0 commit comments

Comments
 (0)