【发布时间】:2019-08-21 04:43:25
【问题描述】:
我是 ionic 新手,
我正在尝试在购物车中添加的购物车页面中显示产品。使用 rest API,我在控制台中得到这样的响应。
"items": {
"29.2.2.0.YTowOnt9": {
"j2store_orderitem_id": null,
"order_id": null,
"orderitem_type": "normal",
"cart_id": "59",
"cartitem_id": "29",
"product_id": "2"
},
"30.5.5.0.YTowOnt9": {
"j2store_orderitem_id": null,
"order_id": null,
"orderitem_type": "normal",
"cart_id": "59",
"cartitem_id": "30",
"product_id": "5"
}
现在,问题是 29.2.2.0.YTowOnt9(购物车项目唯一键)是一种产品,而 30.5.5.0.YTowOnt9 是另一种产品。现在我需要在卡片中显示此内容,并且每个产品属性都应显示在相应的卡片中。
如何在循环中获取 cart_id 和 product_id?
【问题讨论】:
-
如果我是正确的,您希望在卡片中显示返回结果作为产品明智并显示其属性。
标签: javascript html typescript ionic-framework ionic3