闫增涛
2024-03-26 90f83bf13fd0d6b97897deadc4a9e6a204b530aa
packageBookService/pages/bookServices/detail/index.js
@@ -53,7 +53,6 @@
      mockList: [] // 用户组卷提交信息
    },
    flag: true,
    applyResourceLoading: false,
    noResources: false,
    selectedIds: "",//商品或子商品销售方式
    bookBuy: false, //商品或子商品是否购买
@@ -180,7 +179,7 @@
  // 格式化日期
  formatDate(dateString) {
    if (!dateString) {
      return 'Invalid date';
      return '';
    }
    const match = dateString.match(/^(\d{4})\/(\d{1,2})\/(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/);
    if (!match) {
@@ -281,9 +280,12 @@
      });
      this.getSubTtem();
      // 获取图书分类
      const iconType = JSON.parse(res.datas.bookClassification)[0][0];
      const classType = JSON.parse(res.datas.bookClassification)[0][1];
      const className = await this.getBookClass(iconType, classType)
      let className = ''
      if (Array.isArray(res.datas.bookClassification) && res.datas.bookClassification.length) {
        const iconType = JSON.parse(res.datas.bookClassification)[0][0];
        const classType = JSON.parse(res.datas.bookClassification)[0][1];
        className = await this.getBookClass(iconType, classType)
      }
      // 获取组卷销售id
      if (res.datas.saleMethod && res.datas.saleMethod.length) {
        res.datas.saleMethod.forEach((item) => {
@@ -905,14 +907,12 @@
        })
      }
    })
    this.setData({
      applyResourceLoading: false
    })
    wx.hideLoading()
  },
  // 申请教学资源
  applyResource() {
    this.setData({
      applyResourceLoading: true
    wx.showLoading({
      title: '加载中',
    })
    // let role = userStore.userInfo ? userStore.userInfo.role : null
    // if (role) {
@@ -1306,7 +1306,6 @@
        keys: [this.data.bookId]
      })
      .then((res) => {
        console.log(JSON.parse(res[0].value));
        if (res && res.length) {
          const mock = JSON.parse(res[0].value)
          mock.forEach(item => {