litian
2024-04-03 d44f1c3412aeb61709e58c737279ac2b2f60e018
packageBookService/pages/bookServices/detail/index.js
@@ -418,10 +418,6 @@
          selectedIds: res.datas[0].defaultSaleMethod.id,
          bookBuy: res.datas[0].purchasedSaleMethodIdList.indexOf(res.datas[0].defaultSaleMethodId) > -1
        });
        console.log(res);
        console.log(res.datas[0].defaultSaleMethod.endDate, 'res.datas[0].defaultSaleMethod.endDate');
        console.log(res.datas[0].defaultSaleMethod.beginDate, 'res.datas[0].defaultSaleMethod.beginDate');
        console.log(this.data.bookItemDetail, 'bookItemData.value');
        let times = new Date(res.datas[0].defaultSaleMethod.endDate).getTime()
        let startTime = new Date(res.datas[0].defaultSaleMethod.beginDate).getTime()
@@ -888,8 +884,12 @@
    console.log(this.data.bookItemDetail.defaultSaleMethodId, 'this.data.bookItemDetail.defaultSaleMethodId');
    if (!this.data.expire) {
      let bookOrdersId = ''
      let pBookInfo = {
        type: "电子书",
        pId: this.data.bookItemDetail ? this.data.bookDetail.id : ''
      }
      let query = {
        remarks: '电子书',
        remarks: JSON.stringify(pBookInfo),
        requests: [{
          saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId,
          count: 1
@@ -1003,13 +1003,12 @@
    this.setData({
      applyResourceState: true
    })
    wx.showLoading({
      title: '加载中',
    })
    let role = wx.getStorageSync(app.config.userInfoKey).role
    let role = JSON.parse(wx.getStorageSync(app.config.userInfoKey)).role
    if (role) {
      debugger
      if (role == 'Teacher') {
        wx.showLoading({
          title: '加载中',
        })
        // 申请教学资源
        let query = {
          topicIdOrRefCode: 'productDownLoad',
@@ -1048,6 +1047,19 @@
          }
        })
      }
    } else {
      wx.showModal({
        title: '尊敬的用户,您好!',
        content: '请先进行教师认证!',
        complete: (res) => {
          if (res.cancel) {}
          if (res.confirm) {
            wx.navigateTo({
              url: '/packageDomain/pages/teacherCertification/index',
            })
          }
        }
      })
    }
  },
  // 教学资源下载前往PC提示Diialog
@@ -1271,6 +1283,7 @@
      let freeIds = arr.filter((item) => {
        return item.saleMethod[0].Price == 0
      })
      debugger
      if (!freeIds.length) return wx.showToast({
        icon: "error",
        title: '暂无免费资源',
@@ -1285,7 +1298,7 @@
          })
        }
      })
      debugger
      let query = {
        remarks: '云学习',
        requests,