Commit 3f63bfc7 authored by GuanHua's avatar GuanHua

feat: 商品搜索列表添加搜索关键词高亮效果

parent 17c14a38
...@@ -115,11 +115,13 @@ ...@@ -115,11 +115,13 @@
.price_info_wrap { .price_info_wrap {
margin-bottom: 6px; margin-bottom: 6px;
& > span {
&>span {
font-size: 18px; font-size: 18px;
color: #D32F2F; color: #D32F2F;
font-weight: bold; font-weight: bold;
} }
.price_info_unit { .price_info_unit {
font-size: 12px; font-size: 12px;
color: #909399; color: #909399;
...@@ -328,3 +330,12 @@ ...@@ -328,3 +330,12 @@
} }
} }
:global {
.highlight {
color: #D32F2F;
font-weight: 500;
font-size: 13px;
}
}
...@@ -75,7 +75,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => { ...@@ -75,7 +75,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
{ {
renderPrice(item) renderPrice(item)
} }
<div className={styles.goods_name}>{item.name}</div> <div className={styles.goods_name} dangerouslySetInnerHTML={{ __html: item.name }} />
<div className={styles.count}>成交{numFormat(item.sold) || 0}{item.unitName}</div> <div className={styles.count}>成交{numFormat(item.sold) || 0}{item.unitName}</div>
<div className={styles.company_info}> <div className={styles.company_info}>
<img className={styles.credit_icon} src={shopDefaultIcon} /> <img className={styles.credit_icon} src={shopDefaultIcon} />
...@@ -104,7 +104,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => { ...@@ -104,7 +104,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
<div className={styles.commodity_info}> <div className={styles.commodity_info}>
<div className={styles.commodity_info_name}> <div className={styles.commodity_info_name}>
<a href={getCommodityDetailLink(item)} target="_blank" rel="noreferrer"> <a href={getCommodityDetailLink(item)} target="_blank" rel="noreferrer">
{item.name} <div dangerouslySetInnerHTML={{ __html: item.name }} />
</a> </a>
</div> </div>
<div className={styles.commodity_info_slogan}>{item.slogan}</div> <div className={styles.commodity_info_slogan}>{item.slogan}</div>
...@@ -121,7 +121,6 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => { ...@@ -121,7 +121,6 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
<img className={styles.credit_icon} src={shopDefaultIcon} /> <img className={styles.credit_icon} src={shopDefaultIcon} />
<div className={styles.shop_name}>{item.memberName}</div> <div className={styles.shop_name}>{item.memberName}</div>
</div> </div>
{/* <Rate className={styles.star} count={5} disabled defaultValue={5} /> */}
<div className={styles.credit}> <div className={styles.credit}>
<img className={styles.credit_icon} src={creditIcon} /> <img className={styles.credit_icon} src={creditIcon} />
<span>{item.creditScore || 0}</span> <span>{item.creditScore || 0}</span>
...@@ -150,36 +149,6 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => { ...@@ -150,36 +149,6 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
查看详情 查看详情
</a> </a>
</div> </div>
{/* <div className={styles.info_box_content}>
<div className={styles.name}>{item.name}</div>
<div className={styles.price}>
{
item.priceType === 1 ? (
<>
<span>¥</span>{priceFormat(item.min)}
</>
) : (
<div className={styles.inquiry_price}>
<label>在线询价</label>
</div>
)
}
</div>
<div className={styles.count}>已售: {numFormat(item.sold) || 0} {item.unitName}</div>
</div>
<ul className={styles.tags_list}>
{
item.sellingPoint && item.sellingPoint.map((pointItem, pointIndex) => (
<li className={styles.tags_list_item} key={`tags_list_item_${pointIndex}`}>{pointItem}</li>
))
}
</ul>
<div className={styles.credit}>
<img className={styles.credit_icon} src={creditIcon} />
<span>{item.creditScore || 0}</span>
</div>
<div className={styles.shopname}>{item.memberName}</div> */}
</div> </div>
</div> </div>
......
...@@ -4,7 +4,6 @@ import { inject, observer } from 'mobx-react' ...@@ -4,7 +4,6 @@ import { inject, observer } from 'mobx-react'
import CommonlyUsed from './components/CommonlyUsed' import CommonlyUsed from './components/CommonlyUsed'
import Category from './components/Category' import Category from './components/Category'
import { FILTER_TYPE } from '@/constants' import { FILTER_TYPE } from '@/constants'
import Style from './components/Style'
import Brand from './components/Brand' import Brand from './components/Brand'
import Price from './components/Price' import Price from './components/Price'
import UseArea from './components/UseArea' import UseArea from './components/UseArea'
......
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