Ver código fonte

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

zhengyingya 4 anos atrás
pai
commit
24f5a3bb89

+ 1
- 1
lib/App.js.map
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


BIN
lib/assert/icon_like_fill.png Ver arquivo


BIN
lib/assert/icon_like_line.png Ver arquivo


+ 10
- 3
lib/components/ContentItem/index.css Ver arquivo

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

+ 2
- 2
lib/components/ContentItem/index.js Ver arquivo

351
                 showReply ? _react2.default.createElement(_icon2.default, { type: "up" }) : _react2.default.createElement(_icon2.default, { type: "down" })
351
                 showReply ? _react2.default.createElement(_icon2.default, { type: "up" }) : _react2.default.createElement(_icon2.default, { type: "down" })
352
               )
352
               )
353
             ) : null,
353
             ) : null,
354
-            showEdit && _react2.default.createElement("i", {
354
+            showEdit && app.userId === content.user_id && _react2.default.createElement("i", {
355
               className: "comment-item-edit",
355
               className: "comment-item-edit",
356
               onClick: function onClick() {
356
               onClick: function onClick() {
357
                 return _this2.props.app.handleEdit({
357
                 return _this2.props.app.handleEdit({
396
                 },
396
                 },
397
                 style: { color: "" + IconColor }
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
             _react2.default.createElement(
401
             _react2.default.createElement(
402
               "span",
402
               "span",

+ 1
- 1
lib/components/ContentItem/index.js.map
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 1
- 1
lib/components/EditComment/EditComment.css Ver arquivo

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

+ 1
- 1
lib/index.js Ver arquivo

43
         //   uid: "rc-upload-1564206005248-2"
43
         //   uid: "rc-upload-1564206005248-2"
44
         // }
44
         // }
45
       ],
45
       ],
46
-      value: "2"
46
+      value: ""
47
     };
47
     };
48
     return _this;
48
     return _this;
49
   }
49
   }

+ 1
- 1
lib/index.js.map
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 4
- 4
lib/version.json Ver arquivo

1
 {
1
 {
2
     "name":       "comment",
2
     "name":       "comment",
3
-    "buildDate":  1564190100286,
3
+    "buildDate":  1564281547826,
4
     "version":    "1.0.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 Ver arquivo


BIN
src/assert/icon_like_line.png Ver arquivo


+ 9
- 2
src/components/ContentItem/index.css Ver arquivo

56
 }
56
 }
57
 .comment-item-delete,
57
 .comment-item-delete,
58
 .comment-item-edit,
58
 .comment-item-edit,
59
-.comment-item-like {
59
+.comment-item-like,
60
+.comment-item-unlike {
60
   display: inline-block;
61
   display: inline-block;
61
   background: url(../../assert/icon_delete.png);
62
   background: url(../../assert/icon_delete.png);
62
   width: 18px;
63
   width: 18px;
74
   /* margin-left: 10px; */
75
   /* margin-left: 10px; */
75
 }
76
 }
76
 .comment-item-like {
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
   background-size: 100% 100%;
85
   background-size: 100% 100%;
79
   margin-left: 15px;
86
   margin-left: 15px;
80
   margin-right: 2px;
87
   margin-right: 2px;

+ 6
- 2
src/components/ContentItem/index.js Ver arquivo

261
                 </a>
261
                 </a>
262
               </div>
262
               </div>
263
             ) : null}
263
             ) : null}
264
-            {showEdit && (
264
+            {showEdit && app.userId === content.user_id && (
265
               <i
265
               <i
266
                 className="comment-item-edit"
266
                 className="comment-item-edit"
267
                 onClick={() =>
267
                 onClick={() =>
309
               }}
309
               }}
310
               style={{ color: `${IconColor}` }}
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
             </div>
317
             </div>
314
             <span>&nbsp;{content.favor_count}</span>
318
             <span>&nbsp;{content.favor_count}</span>
315
             <div
319
             <div

+ 1
- 1
src/index.js Ver arquivo

15
         //   uid: "rc-upload-1564206005248-2"
15
         //   uid: "rc-upload-1564206005248-2"
16
         // }
16
         // }
17
       ],
17
       ],
18
-      value: "2"
18
+      value: ""
19
     };
19
     };
20
   }
20
   }
21
 
21