litian
2024-03-21 36b2ce21114082da777b66b4bda250c9ca7ecd30
packageBookService/pages/bookServices/detail/index.js
@@ -51,7 +51,8 @@
      residue: 0, // 组卷剩余次数
      mockList: [] // 用户组卷提交信息
    },
    flag: true
    flag: true,
    applyResourceLoading: false
  },
@@ -262,7 +263,6 @@
          })
        }
      }
      console.log('组卷信息', this.data.mockData);
      this.setData({
        'bookDetail.publicationDate': this.formatDate(this.data.bookDetail.publicationDate),
        'bookDetail.class': className,
@@ -270,6 +270,7 @@
        'bookDetail.oldPrice': this.numFormat(this.data.bookDetail.oldPrice),
        'bookDetail.paperPrice': this.numFormat(this.data.bookDetail.paperPrice),
      });
      console.log('图书信息', this.data.bookDetail);
    });
  },
@@ -426,6 +427,7 @@
                teach: list,
                loading: false
              })
              console.log('教学资源', this.data.teach);
              this.findChildIds(this.data.teach, this.data.openTeachids = [])
            } else if (type.refCode == 'jsek_cloudLearning') {
              res.datas.cmsDatas[0].datas.forEach(item => {
@@ -555,6 +557,17 @@
  // 图书添加购物车
  async addBookShopcCar() {
    const token = wx.getStorageSync('jsek-token')
    if (!token) {
      return wx.getUserProfile({
        desc: '用户登录',
        success: (res) => {
          console.log(res);
        }
      })
    }
    const shoppingCartGetId = []
    let query = {
@@ -706,10 +719,15 @@
        })
      }
    })
    console.log('有效日期', this.data.deadline);
    this.setData({
      applyResourceLoading: false
    })
  },
  // 申请教学资源
  applyResource() {
    this.setData({
      applyResourceLoading: true
    })
    // let role = userStore.userInfo ? userStore.userInfo.role : null
    // if (role) {
    //   if (role == 'Teacher') {
@@ -732,7 +750,9 @@
    }
    app.MG.ugc.newTopicMessage(query).then((res) => {
      if (res) {
        Message.success('申请已提交,请待审核通过后下载')
        wx.showToast({
          title: '申请已提交,请待审核通过后下载',
        })
      }
      this.getApplyInfo(this.data.bookDetail.id)
    })
@@ -994,14 +1014,14 @@
  async allAddShoppiingCar() {
    const child = this.selectComponent('#learn-resource')
    const token = wx.getStorageSync('jsek-token')
    // if (!token) {
    //   return wx.getUserProfile({
    //     desc: '用户登录',
    //     success: (res) => {
    //       console.log(res);
    //     }
    //   })
    // }
    if (!token) {
      return wx.getUserProfile({
        desc: '用户登录',
        success: (res) => {
          console.log(res);
        }
      })
    }
    let shopList = this.handleTreeData(this.data.learn).filter((item) => this.resourceIsBuy(item))
    this.getShoppingCartProductGet()
    if (!shopList.length) return wx.showToast({
@@ -1197,7 +1217,7 @@
    }
    else if (this.data.tabValue == 'jsek_cloudLearning') {
      const tree = this.selectComponent('#tree')
      tree.onCloudShoppingCart()