Commit d4d790c2 authored by 崔佳豪's avatar 崔佳豪

perf: 新产品引导页优化

parent 916ea520
Pipeline #54046 passed with stages
This diff was suppressed by a .gitattributes entry.
...@@ -43,7 +43,6 @@ const NewProducts = props => { ...@@ -43,7 +43,6 @@ const NewProducts = props => {
setLoading(false); setLoading(false);
const configData = JSON.parse(res.data.jsonData || '[]'); const configData = JSON.parse(res.data.jsonData || '[]');
const configMap = configData.reduce((pre, item, index) => { const configMap = configData.reduce((pre, item, index) => {
item['排序'] = index
if(item.site && item['是否显示'] === '是') { if(item.site && item['是否显示'] === '是') {
pre[item.site] = item; pre[item.site] = item;
} }
...@@ -53,7 +52,7 @@ const NewProducts = props => { ...@@ -53,7 +52,7 @@ const NewProducts = props => {
const data = Groups const data = Groups
.filter(item => item.industry === '熊猫新产品' && configMap[item.site]) .filter(item => item.industry === '熊猫新产品' && configMap[item.site])
.map(item => ({ ...item, config: configMap[item.site] })); .map(item => ({ ...item, config: configMap[item.site] }));
data.sort((a,b) => a.config['排序'] - b.config['排序']); data.sort((a,b) => Number(a.config['排序']) - Number(b.config['排序']));
setProducts(chunk(data, pageSize)); setProducts(chunk(data, pageSize));
}).catch(err => { }).catch(err => {
setLoading(false); setLoading(false);
......
@import '~antd/es/style/themes/default.less';
@wh-scale: 1080/1920; @wh-scale: 1080/1920;
.nowrap-text { .nowrap-text {
white-space: nowrap; white-space: nowrap;
...@@ -131,6 +132,17 @@ ...@@ -131,6 +132,17 @@
font-size: 1em; font-size: 1em;
font-weight: bold; font-weight: bold;
line-height: 1.8; line-height: 1.8;
position: relative;
&::after {
content: '';
width: 1.2em;
height: 3px;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0;
background: @primary-color;
}
} }
.card-desc { .card-desc {
font-size: 0.7em; font-size: 0.7em;
......
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