闫增涛
2024-03-21 057199d5c5284a71e5d04e091492873ced412fa5
packageBookService/pages/bookServices/detail/index.js
@@ -430,11 +430,11 @@
              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 => {
              //   item.checked = false
              // })
              // const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
              console.log(list, 'currentlist');
              res.datas.cmsDatas[0].datas.forEach(item => {
                item.checked = false
              })
              const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
              console.log(list, 'list');
              this.setData({
                learn: list,
                loading: false
@@ -1003,14 +1003,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({
@@ -1155,7 +1155,6 @@
        })
        res = await app.MG.store.initOrder(query)
      }
      if (res.orderNumber && this.data.mockData.price) {
        wx.navigateTo({
          url: `/pages/cart/paymentPage/index?orderNumber=${res.orderNumber}`,
@@ -1206,11 +1205,16 @@
      this.buyBook()
    }
    else if (this.data.tabValue == 'jsek_cloudLearning') {
      console.log('云学习');
      const tree = this.selectComponent('#tree')
      tree.onCloudShoppingCart()
    } else if (this.data.tabValue == 'questionBank') {
      this.buyMock()
    } else {
      console.log(this.data.tabValue);
    }
  }
  },
})