Commit df797987 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 26a75089 918a681b
......@@ -17,17 +17,17 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
const { shopList } = props
const renderCommodityPrice = (unitPrice) => {
let price = 0
if (unitPrice) {
const priceArr = []
Object.keys(unitPrice).forEach(key => {
priceArr.push(unitPrice[key])
})
price = priceArr[0] || 0
}
// const price = 0
// if (unitPrice) {
// const priceArr = []
// Object.keys(unitPrice).forEach(key => {
// priceArr.push(unitPrice[key])
// })
// price = priceArr[0] || 0
// }
return <div className={styles.shop_list_goods_item_price}>
<span className={styles.unit}></span>
<span>{priceFormat(price)}</span>
<span>{priceFormat(unitPrice)}</span>
</div>
}
......@@ -90,7 +90,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
<div className={styles.shop_list_goods_item_imgbox_img} style={{ backgroundImage: `url(${commodityItem.mainPic})` }}></div>
</div>
{
renderCommodityPrice(commodityItem.unitPrice)
renderCommodityPrice(commodityItem.min)
}
</div>
</Link>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment