yiming
2024-03-21 006a2ecb6430146cea3afdf353938043c231e5fc
packageBookService/pages/bookServices/detail/index.js
@@ -557,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 = {
@@ -1003,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({