| | |
| | | noteList: [], |
| | | activeValues: 0, |
| | | loading: false, |
| | | noList: false, |
| | | }, |
| | | /** |
| | | * 组件的方法列表 |
| | |
| | | }) |
| | | }, |
| | | openDialog() { |
| | | console.log(this.properties.bookInfo.name); |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | showNoteDialog: true |
| | |
| | | }, |
| | | // 弹窗确定按钮 |
| | | confirmSuggest() { |
| | | if (!this.data.submitTitle) { |
| | | const submitTitle = this.data.submitTitle.trim() |
| | | const textvalue = this.data.textvalue.trim() |
| | | if (!submitTitle.length) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请填写笔记标题', |
| | | }) |
| | | } else if (!this.data.textvalue) { |
| | | } else if (!textvalue.length) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请填写笔记内容', |
| | |
| | | }, |
| | | // 获取笔记列表 |
| | | async getNoteList() { |
| | | // this.setData({ |
| | | // loading: true |
| | | // }) |
| | | console.log(this.properties.bookInfo.id, 'this.properties.bookInfo.id'); |
| | | this.setData({ |
| | | loading: true, |
| | | noList: false |
| | | }) |
| | | let topicId |
| | | await app.MG.ugc |
| | | .getProductUserSubmitTopic({ |
| | |
| | | topicIdOrRefCode: topicId + '' |
| | | } |
| | | await app.MG.ugc.getTopicMessageList(query).then((res) => { |
| | | if (!res.datas.length) { |
| | | return this.setData({ |
| | | noList: true, |
| | | loading: false, |
| | | noteList: res.datas, |
| | | }) |
| | | } |
| | | // notePage.value.total = res.totalSize |
| | | res.datas.forEach((item) => { |
| | | item.compliceHover = false |
| | |
| | | noteList: res.datas, |
| | | loading: false |
| | | }) |
| | | console.log('笔记列表', res.datas); |
| | | }) |
| | | }, |
| | | // 新建笔记接口 |
| | |
| | | messageIds.push(id) |
| | | wx.showModal({ |
| | | title: '提示', |
| | | content: '确认删除该笔记吗?',//editable如果为true,这就是输入框的内容 |
| | | editable: false,//是否显示输入框 |
| | | placeholderText: '请输入内容吧',//输入框的默认内容 |
| | | content: '确认删除该笔记吗?', //editable如果为true,这就是输入框的内容 |
| | | editable: false, //是否显示输入框 |
| | | placeholderText: '请输入内容吧', //输入框的默认内容 |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | app.MG.ugc |
| | | .delTopicMessage({ messageIds }) |
| | | .delTopicMessage({ |
| | | messageIds |
| | | }) |
| | | .then((res) => { |
| | | wx.showToast({ |
| | | title: '删除成功', |
| | |
| | | submitTitle: note.name, |
| | | noteId: note.id |
| | | }) |
| | | this.openDialog() |
| | | console.log(note.name, this.data.submitTitle); |
| | | this.setData({ |
| | | showNoteDialog: true |
| | | }) |
| | | }, |
| | | // 编辑笔记接口 |
| | | updateNote() { |
| | |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }) |