diff --git a/src/component/notebook/notebookDiaryList.js b/src/component/notebook/notebookDiaryList.js index 8e2b564..2a9e018 100644 --- a/src/component/notebook/notebookDiaryList.js +++ b/src/component/notebook/notebookDiaryList.js @@ -86,10 +86,10 @@ export default class NotebookDiaryList extends Component { } refreshOne(index, diary) { - console.log('index, diary:', index, diary); if(diary) { let list = this.state.rawlist; diary.user = list[index].user; + list[index] = diary; this.setState({ @@ -188,8 +188,7 @@ export default class NotebookDiaryList extends Component { diary: diary, showField: ['createdTime'], - expired: this.notebook.isExpired, - refreshBack: this.refreshOne.bind(this, index) + expired: this.notebook.isExpired } } }); @@ -215,7 +214,7 @@ export default class NotebookDiaryList extends Component { renderItem={(rowData) => { return ( - { + Msg.hideMsg(waitingToast); Msg.showMsg('日记保存完成'); DeviceEventEmitter.emit(Event.updateDiarys); @@ -271,6 +279,7 @@ export default class WritePage extends Component { } }) .catch(e => { + Msg.hideMsg(waitingToast); Msg.showMsg('保存失败'); }) .done(); diff --git a/src/util/msg.js b/src/util/msg.js index c6c4b49..846ab66 100644 --- a/src/util/msg.js +++ b/src/util/msg.js @@ -14,9 +14,14 @@ function showMsg(msg, option) { } } - Toast.show(msg, option); + return Toast.show(msg, option); +} + +function hideMsg(toast) { + Toast.hide(toast); } export default { - showMsg + showMsg, + hideMsg } \ No newline at end of file