yiming
2024-04-02 312fd09aaf90c0e52ab61bde22d0edbf105baa5e
pages/cart/index.js
@@ -75,12 +75,16 @@
      })
      res.datas.forEach(item => {
        // console.log(item, 'item456');
        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
      });