闫增涛
2024-04-02 aef06b129be7a3a12ac097db8e372b0cb33c6c42
packageBookService/pages/bookServices/detail/components/note/note.js
@@ -32,6 +32,7 @@
    noteList: [],
    activeValues: 0,
    loading: false,
    noList: false,
  },
  /**
   * 组件的方法列表
@@ -62,7 +63,6 @@
      })
    },
    openDialog() {
      console.log(this.properties.bookInfo.name);
      this.setData({
        submitTitle: this.properties.bookInfo.name,
        showNoteDialog: true
@@ -92,12 +92,14 @@
    },
    // 弹窗确定按钮
    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: '请填写笔记内容',
@@ -136,10 +138,10 @@
    },
    // 获取笔记列表
    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({
@@ -169,6 +171,13 @@
        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
@@ -180,7 +189,6 @@
          noteList: res.datas,
          loading: false
        })
        console.log('笔记列表', res.datas);
      })
    },
    // 新建笔记接口
@@ -233,13 +241,15 @@
      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: '删除成功',
@@ -270,7 +280,10 @@
        submitTitle: note.name,
        noteId: note.id
      })
      this.openDialog()
      console.log(note.name, this.data.submitTitle);
      this.setData({
        showNoteDialog: true
      })
    },
    // 编辑笔记接口
    updateNote() {
@@ -316,4 +329,4 @@
      })
    }
  }
})
})