闫增涛
2024-04-01 aa2c08b3be23a01d44205b2c19d21a2bf53f944f
pages/cart/index.js
@@ -78,9 +78,13 @@
        // console.log(item, 'item456');
        item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160');
        this.setData({
          type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'
        })
        // this.setData({
        //   type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'
        // })
        const type = item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product';
        item.type = type; // 将type设置为item对象的属性,而不是使用setData
        // debugger
      });