Commit c42cd1a7 authored by GuanHua's avatar GuanHua

fix:修改商城首页询价商品价格显示

parent 5fed6d7c
......@@ -42,7 +42,7 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
useEffect(() => {
fetchBrandsList()
}, [filterParam])
}, [filterParam, current])
const fetchBrandsList = () => {
let param = {
......@@ -84,7 +84,6 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const handlePageChange = (page: number, pageSize?: number | undefined) => {
setCurrent(page)
setPageSize(pageSize || 10)
fetchBrandsList()
}
const handleSearch = () => {
......
......@@ -9,6 +9,26 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
const { dataInfo = {} } = props
const renderPriceByType = (info: any) => {
switch (info.priceType) {
case 1:
return (
<div className={styles.goods_item_info_price}>
<i></i>
<span>{dataInfo.priceRange || dataInfo.goodsPrice}</span>
</div>
)
case 2:
return (
<div className={styles.inquiry_price}>
<label>在线询价</label>
</div>
)
default:
break
}
}
return (
<div className={styles.goods_item}>
<div className={styles.goods_item_imgbox}>
......@@ -16,10 +36,7 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
</div>
<div className={styles.goods_item_info}>
<div className={styles.goods_item_info_name}>{dataInfo.goodsName}</div>
<div className={styles.goods_item_info_price}>
<i></i>
<span>{dataInfo.priceRange || dataInfo.goodsPrice}</span>
</div>
{ renderPriceByType(dataInfo) }
<div className={styles.goods_item_info_brief}>
<span>品类:</span>
<span>{dataInfo.categoryName}</span>
......
......@@ -14,6 +14,17 @@
}
}
.inquiry_price {
color: #FFF;
background-color: #D32F2F;
font-size: 12px;
height: 18px;
line-height: 14px;
padding: 2px 8px;
display: inline-block;
margin-top: 2px;
}
&_info {
flex-grow: 1;
width: 0;
......
......@@ -95,7 +95,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
useEffect(() => {
fetchGoodsList()
}, [filterParam])
}, [filterParam, current])
const fetchGoodsList = () => {
let param = {
......@@ -150,7 +150,6 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const handlePageChange = (page: number, pageSize?: number | undefined) => {
setCurrent(page)
setPageSize(pageSize || 10)
fetchGoodsList()
}
const handleSearch = () => {
......
......@@ -109,7 +109,9 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
// @ts-ignore
PublicApi.getTemplateChannelFindFirstCategoryDetail(param).then(res => {
resolve(res.data)
if(res.code === 1000) {
resolve(res.data)
}
})
})
}
......
......@@ -96,7 +96,9 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
// @ts-ignore
PublicApi.getTemplateShopFindFirstCategoryDetail(param).then(res => {
resolve(res.data)
if(res.code === 1000) {
resolve(res.data)
}
})
})
}
......
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