Browse Source

fix:#6565 评论编辑问题汇总

zhengyingya 4 years ago
parent
commit
24f5a3bb89

+ 1
- 1
lib/App.js.map
File diff suppressed because it is too large
View File


BIN
lib/assert/icon_like_fill.png View File


BIN
lib/assert/icon_like_line.png View File


+ 10
- 3
lib/components/ContentItem/index.css View File

@@ -56,7 +56,8 @@
56 56
 }
57 57
 .comment-item-delete,
58 58
 .comment-item-edit,
59
-.comment-item-like {
59
+.comment-item-like,
60
+.comment-item-unlike {
60 61
   display: inline-block;
61 62
   background: url(../../assert/icon_delete.png);
62 63
   width: 18px;
@@ -74,7 +75,13 @@
74 75
   /* margin-left: 10px; */
75 76
 }
76 77
 .comment-item-like {
77
-  background: url(../../assert/icon_like@2x.png);
78
+  background: url(../../assert/icon_like_fill.png);
79
+  background-size: 100% 100%;
80
+  margin-left: 15px;
81
+  margin-right: 2px;
82
+}
83
+.comment-item-unlike {
84
+  background: url(../../assert/icon_like_line.png);
78 85
   background-size: 100% 100%;
79 86
   margin-left: 15px;
80 87
   margin-right: 2px;
@@ -83,7 +90,7 @@
83 90
   margin-left: 20px;
84 91
   cursor: pointer;
85 92
   color: red;
86
-} 
93
+}
87 94
 .comment-item-bottom-left {
88 95
   color: #71c135;
89 96
   margin-right: 20px;

+ 2
- 2
lib/components/ContentItem/index.js View File

@@ -351,7 +351,7 @@ var CommentItem = function (_Component) {
351 351
                 showReply ? _react2.default.createElement(_icon2.default, { type: "up" }) : _react2.default.createElement(_icon2.default, { type: "down" })
352 352
               )
353 353
             ) : null,
354
-            showEdit && _react2.default.createElement("i", {
354
+            showEdit && app.userId === content.user_id && _react2.default.createElement("i", {
355 355
               className: "comment-item-edit",
356 356
               onClick: function onClick() {
357 357
                 return _this2.props.app.handleEdit({
@@ -396,7 +396,7 @@ var CommentItem = function (_Component) {
396 396
                 },
397 397
                 style: { color: "" + IconColor }
398 398
               },
399
-              _react2.default.createElement("i", { className: "comment-item-like" })
399
+              _react2.default.createElement("i", { className: content.favored ? "comment-item-like" : "comment-item-unlike" })
400 400
             ),
401 401
             _react2.default.createElement(
402 402
               "span",

+ 1
- 1
lib/components/ContentItem/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/components/EditComment/EditComment.css View File

@@ -96,4 +96,4 @@
96 96
   .editCommetModal .picture-btn-wrap {
97 97
     margin-left: 18px;
98 98
   }
99
-}
99
+}

+ 1
- 1
lib/index.js View File

@@ -43,7 +43,7 @@ var Index = function (_React$Component) {
43 43
         //   uid: "rc-upload-1564206005248-2"
44 44
         // }
45 45
       ],
46
-      value: "2"
46
+      value: ""
47 47
     };
48 48
     return _this;
49 49
   }

+ 1
- 1
lib/index.js.map
File diff suppressed because it is too large
View File


+ 4
- 4
lib/version.json View File

@@ -1,8 +1,8 @@
1 1
 {
2 2
     "name":       "comment",
3
-    "buildDate":  1564190100286,
3
+    "buildDate":  1564281547826,
4 4
     "version":    "1.0.4",
5
-    "numCommits": 173,
6
-    "hash":       "b9eeb6a",
7
-    "dirty":      true
5
+    "numCommits": 174,
6
+    "hash":       "5200566",
7
+    "dirty":      false
8 8
 }

BIN
src/assert/icon_like_fill.png View File


BIN
src/assert/icon_like_line.png View File


+ 9
- 2
src/components/ContentItem/index.css View File

@@ -56,7 +56,8 @@
56 56
 }
57 57
 .comment-item-delete,
58 58
 .comment-item-edit,
59
-.comment-item-like {
59
+.comment-item-like,
60
+.comment-item-unlike {
60 61
   display: inline-block;
61 62
   background: url(../../assert/icon_delete.png);
62 63
   width: 18px;
@@ -74,7 +75,13 @@
74 75
   /* margin-left: 10px; */
75 76
 }
76 77
 .comment-item-like {
77
-  background: url(../../assert/icon_like@2x.png);
78
+  background: url(../../assert/icon_like_fill.png);
79
+  background-size: 100% 100%;
80
+  margin-left: 15px;
81
+  margin-right: 2px;
82
+}
83
+.comment-item-unlike {
84
+  background: url(../../assert/icon_like_line.png);
78 85
   background-size: 100% 100%;
79 86
   margin-left: 15px;
80 87
   margin-right: 2px;

+ 6
- 2
src/components/ContentItem/index.js View File

@@ -261,7 +261,7 @@ class CommentItem extends Component {
261 261
                 </a>
262 262
               </div>
263 263
             ) : null}
264
-            {showEdit && (
264
+            {showEdit && app.userId === content.user_id && (
265 265
               <i
266 266
                 className="comment-item-edit"
267 267
                 onClick={() =>
@@ -309,7 +309,11 @@ class CommentItem extends Component {
309 309
               }}
310 310
               style={{ color: `${IconColor}` }}
311 311
             >
312
-              <i className="comment-item-like" />
312
+              <i
313
+                className={
314
+                  content.favored ? "comment-item-like" : "comment-item-unlike"
315
+                }
316
+              />
313 317
             </div>
314 318
             <span>&nbsp;{content.favor_count}</span>
315 319
             <div

+ 1
- 1
src/index.js View File

@@ -15,7 +15,7 @@ class Index extends React.Component {
15 15
         //   uid: "rc-upload-1564206005248-2"
16 16
         // }
17 17
       ],
18
-      value: "2"
18
+      value: ""
19 19
     };
20 20
   }
21 21