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 });