diff --git a/doc/api.md b/doc/api.md index de97c37..a146379 100644 --- a/doc/api.md +++ b/doc/api.md @@ -248,7 +248,8 @@ Request { "token": "token_test", "id": "id", - "content" : "为什么 PD 不能充电呢?" + "content": "为什么 PD 不能充电呢?", + "pic": ["https://....jpg"] } ``` diff --git a/src/pages/TicketDetail/Comment.tsx b/src/pages/TicketDetail/Comment.tsx index 0944773..737a73f 100644 --- a/src/pages/TicketDetail/Comment.tsx +++ b/src/pages/TicketDetail/Comment.tsx @@ -79,6 +79,7 @@ export class Comment extends Component { showAddBtn={this.state.files.length !== 3} count={3} files={this.state.files} + sizeType={['compressed']} onChange={this.handlePicChange.bind(this)} /> diff --git a/src/service/submitComment.ts b/src/service/submitComment.ts index 0e8726c..c31a9b8 100644 --- a/src/service/submitComment.ts +++ b/src/service/submitComment.ts @@ -11,11 +11,13 @@ export function submitComment(that: Comment) { isLoading: true, }); Taro.request({ - url: getUrl('/report'), + url: getUrl('/ticket/addnote'), method: 'POST', data: { token: wechatUser.getToken(), - comment: that.state.comment, + content: that.state.comment, + id: that.props.id, + pic: that.state.files, }, }) .then((res) => {