闫增涛
2025-03-28 38cd76c5f05fd55855038e2d393074e27909c63d
pages/digitalCourses/digitalCoursesDetails/components/note/note.js
@@ -1,5 +1,8 @@
// pages/bookServices/detail/components/note/note.js
const app = getApp();
import {
  loginInfo
} from '../../../../../assets/js/login';
Component({
  /**
   * 组件的属性列表
@@ -15,8 +18,7 @@
   * 组件的初始数据
   */
  data: {
    inputStyle:
      "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx",
    inputStyle: "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx",
    placeholderstyle: "font-size:28rpx",
    flag: false, // 输入框是否显示
    submitType: "new", //  新建 or 编辑
@@ -64,10 +66,15 @@
      });
    },
    openDialog() {
      const token = wx.getStorageSync(app.config.tokenKey)
      if (token) {
      this.setData({
        submitTitle: this.properties.bookInfo.name,
        showNoteDialog: true,
      });
      } else {
        loginInfo(app, (data) => {})
      }
    },
    closeDialog() {
      this.setData({
@@ -144,6 +151,7 @@
    },
    // 获取笔记列表
    async getNoteList() {
      const getFun = async () => {
      if (!this.data.isMore) {
        this.setData({
          loading: true,
@@ -168,7 +176,6 @@
            });
          }
        });
      // loadings.value.bookResource = true
      let query = {
        start: 0,
        size: this.data.pageCount.page * 5,
@@ -201,6 +208,25 @@
          noList: false,
        });
      });
      }
      const token = wx.getStorageSync(app.config.tokenKey)
      if (!token) {
        loginInfo(app, (data) => {
          if (data) {
            getFun()
          } else {
            this.setData({
              loading: false,
              noList: true,
              noteList: [],
            });
          }
        })
      } else {
        getFun()
      }
    },
    // 新建笔记接口
    async makeNote() {