|
@@ -11,10 +11,17 @@ class CommentInput extends Component {
|
11
|
11
|
|
12
|
12
|
/**
|
13
|
13
|
* 提交评论
|
14
|
|
- * @param {string} value 需要提交的评论的值
|
|
14
|
+ * @param {object} { text<string>, files<array> } 需要提交的评论的文本和图片
|
15
|
15
|
* @param {function} cb 提交成功后的回掉
|
16
|
16
|
*/
|
17
|
|
- handleSubmit(value, cb) {
|
|
17
|
+ handleSubmit({ text, files }, cb) {
|
|
18
|
+ let value = text;
|
|
19
|
+ if (files && files.length) {
|
|
20
|
+ value += "<br /><br />";
|
|
21
|
+ files.forEach(file => {
|
|
22
|
+ value += `[${file}]`;
|
|
23
|
+ });
|
|
24
|
+ }
|
18
|
25
|
const { action, commentId, replyId, callback } = this.props;
|
19
|
26
|
if (action === "comment") {
|
20
|
27
|
this.props.app.sCreateComment(
|