闫增涛
2024-04-02 9f916f98c6cc6827c84da18fbc9a5e2cacbefc0a
pages/cart/index.js
@@ -58,7 +58,17 @@
        title: '删除图书成功',
        icon: 'none'
      });
      this.setData({
        totalPrice: 0.00,
        selectedCount: 0,
        checkAll: false,
      })
    });
  },
  shoppingCartGet() {
@@ -75,15 +85,12 @@
      })
      res.datas.forEach(item => {
        console.log(item, 'item456');
        item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160');
        // this.setData({
        //   type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'
        // })
        const type = item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product';
        item.type = type; // 将type设置为item对象的属性,而不是使用setData
        // debugger
      });
@@ -94,7 +101,6 @@
      if (this.data.shoppingCartData.length === 0) {
        console.log(11111);
        this.setData({
          onDisabled: true
        })
@@ -233,8 +239,9 @@
      url: '/pages/testLogin/index'
    });
  },
  //触底函数
  onReachBottom() {
  onScrollToLower() {
    if (this.data.shoppingCartData.length < this.data.totalSize) {
      this.setData({
        isMore: true,
@@ -251,7 +258,6 @@
        })
        console.log('300');
      }, 300)
    }
  },
  // 下拉函数