Commit df797987 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 26a75089 918a681b
...@@ -17,17 +17,17 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => { ...@@ -17,17 +17,17 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
const { shopList } = props const { shopList } = props
const renderCommodityPrice = (unitPrice) => { const renderCommodityPrice = (unitPrice) => {
let price = 0 // const price = 0
if (unitPrice) { // if (unitPrice) {
const priceArr = [] // const priceArr = []
Object.keys(unitPrice).forEach(key => { // Object.keys(unitPrice).forEach(key => {
priceArr.push(unitPrice[key]) // priceArr.push(unitPrice[key])
}) // })
price = priceArr[0] || 0 // price = priceArr[0] || 0
} // }
return <div className={styles.shop_list_goods_item_price}> return <div className={styles.shop_list_goods_item_price}>
<span className={styles.unit}></span> <span className={styles.unit}></span>
<span>{priceFormat(price)}</span> <span>{priceFormat(unitPrice)}</span>
</div> </div>
} }
...@@ -90,7 +90,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => { ...@@ -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 className={styles.shop_list_goods_item_imgbox_img} style={{ backgroundImage: `url(${commodityItem.mainPic})` }}></div>
</div> </div>
{ {
renderCommodityPrice(commodityItem.unitPrice) renderCommodityPrice(commodityItem.min)
} }
</div> </div>
</Link> </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