style: 修改服务中心样式

This commit is contained in:
zheng020 2026-04-30 06:07:48 +08:00
parent d7406956db
commit d7a798ecfd
2 changed files with 220 additions and 126 deletions

View File

@ -16,7 +16,10 @@
{{ tab.label }} {{ tab.label }}
</button> </button>
</div> </div>
<button class="publish-btn" @click="handlePublish">免费发布金融产品</button> <div class="nav-right">
<span class="list-count"> {{ total }} 条产品</span>
<button class="publish-btn" @click="handlePublish">免费发布金融产品</button>
</div>
</div> </div>
</div> </div>
@ -83,9 +86,6 @@
<span class="list-icon">💹</span> <span class="list-icon">💹</span>
<span class="list-title">碳金融市场</span> <span class="list-title">碳金融市场</span>
</div> </div>
<div class="list-right">
<span class="list-count"><span class="count-dot"></span> {{ total }} 条产品</span>
</div>
</div> </div>
<!-- 加载状态 --> <!-- 加载状态 -->
@ -642,8 +642,7 @@ export default {
// //
.secondary-nav { .secondary-nav {
background: @bg-white; border-bottom: none;
border-bottom: 1px solid #eee;
} }
.secondary-nav-content { .secondary-nav-content {
@ -651,49 +650,68 @@ export default {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
max-width: 1400px; max-width: 1400px;
padding: 0 20px; padding: 20px 20px 0;
margin: 0 auto; margin: 0 auto;
} }
.nav-tabs { .nav-tabs {
display: flex; display: flex;
gap: 8px; gap: 40px;
width: 596px;
height: 42px;
}
.nav-right {
display: flex;
align-items: center;
gap: 20px;
} }
.nav-tab { .nav-tab {
padding: 12px 20px; position: relative;
font-size: 14px; min-width: max-content;
color: @text-light; height: 42px;
padding: 8px 16px;
font-size: 18px;
font-weight: 500;
color: #003B1A;
cursor: pointer; cursor: pointer;
background: transparent; background: transparent;
border: none; border-radius: 32px;
border-bottom: 2px solid transparent;
transition: all 0.3s; transition: all 0.3s;
&:hover { &:hover {
color: @primary-color; color: #009a29;
} }
&.active { &.active {
color: @primary-color; background: #8CFFCE;
border-bottom-color: @primary-color; box-shadow: inset 0 0 0 1px #00B96B;
} }
} }
.publish-btn { .publish-btn {
padding: 8px 20px; width: 220px;
font-size: 14px; height: 42px;
line-height: 26px;
padding: 8px 16px;
font-size: 18px;
font-weight: 400;
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
background: linear-gradient(135deg, @primary-color 0%, @primary-light 100%); background: linear-gradient(135deg, #009a29 0%, #48C666 100%);
border: none; border: none;
border-radius: 4px; border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 154, 41, 0.3); box-shadow: 0 4px 12px rgba(0, 154, 41, 0.25);
transition: all 0.3s; transition: all 0.3s ease;
&:hover { &:hover {
transform: translateY(-2px); transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 154, 41, 0.4); box-shadow: 0 6px 16px rgba(0, 154, 41, 0.35);
}
&:active {
transform: translateY(0);
} }
} }

View File

@ -16,7 +16,7 @@
{{ tab.label }} {{ tab.label }}
</button> </button>
</div> </div>
<button class="publish-btn" @click="handlePublish">免费发布数据</button> <!-- <button class="publish-btn" @click="handlePublish">免费发布数据</button> -->
</div> </div>
</div> </div>
@ -46,34 +46,46 @@
</div> </div>
<!-- 右侧数据库卡片列表 --> <!-- 右侧数据库卡片列表 -->
<div class="content-area"> <div class="card-list">
<div class="card-grid"> <div class="service-grid">
<div <div
v-for="card in filteredCards" v-for="card in filteredCards"
:key="card.id" :key="card.id"
class="database-card" class="service-card"
> >
<div class="card-header"> <div class="card-header">
<h3 class="card-title">{{ card.name }}</h3> <div class="card-title-box">
<div class="card-tags"> <div class="card-title-text">
<span <div class="card-title-row">
v-for="tag in card.tags" <div class="card-title-main">{{ card.name }}</div>
:key="tag" </div>
class="tag" <div class="card-title-sub">
:class="getTagClass(tag)" <div class="card-tags">
> <span
{{ tag }} v-for="tag in card.tags"
</span> :key="tag"
class="tag"
:class="getTagClass(tag)"
>
{{ tag }}
</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
<p class="card-desc">{{ card.description }}</p> <div class="card-content">
<p class="card-desc">{{ card.description }}</p>
</div>
<div class="card-footer"> <div class="card-footer">
<span class="price-tag" :class="card.price === '免费' ? 'free' : 'paid'"> <div class="card-price-info">
{{ card.price }} <span class="price-value" :class="card.price === '免费' ? 'free' : 'paid'">
</span> {{ card.price }}
<t-button theme="primary" size="small" variant="outline" @click="goToDataList(card.id)"> </span>
查看数据库 </div>
</t-button> <div class="card-actions">
<span @click="goToDataList(card.id)">查看数据库</span>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -196,16 +208,16 @@ export default {
// //
.page-body { .page-body {
display: flex; display: flex;
gap: 20px;
align-items: stretch;
max-width: 1400px; max-width: 1400px;
padding: 20px; padding: 20px;
margin: 0 auto; margin: 0 auto;
gap: 20px;
} }
// //
.secondary-nav { .secondary-nav {
background: #fff; border-bottom: none;
border-bottom: 1px solid #eee;
} }
.secondary-nav-content { .secondary-nav-content {
@ -213,60 +225,53 @@ export default {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
max-width: 1400px; max-width: 1400px;
padding: 0 20px; padding: 20px 20px 0;
margin: 0 auto; margin: 0 auto;
} }
.nav-tabs { .nav-tabs {
display: flex; display: flex;
gap: 8px; gap: 40px;
width: 596px;
height: 42px;
}
.nav-right {
display: flex;
align-items: center;
gap: 20px;
} }
.nav-tab { .nav-tab {
position: relative; position: relative;
padding: 12px 20px; min-width: max-content;
font-size: 14px; height: 42px;
color: #666; padding: 8px 16px;
font-size: 18px;
font-weight: 500;
color: #003B1A;
cursor: pointer; cursor: pointer;
background: transparent; background: transparent;
border: none; border-radius: 32px;
border-bottom: 2px solid transparent;
transition: all 0.3s; transition: all 0.3s;
&::after {
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 2px;
background: linear-gradient(90deg, #009a29, #48C666);
border-radius: 1px;
content: '';
transform: translateX(-50%);
transition: all 0.3s ease;
}
&:hover { &:hover {
color: #009a29; color: #009a29;
&::after {
width: 60%;
}
} }
&.active { &.active {
color: #009a29; background: #8CFFCE;
box-shadow: inset 0 0 0 1px #00B96B;
&::after {
width: 100%;
}
} }
} }
.publish-btn { .publish-btn {
padding: 8px 24px; width: 220px;
font-size: 14px; height: 42px;
font-weight: 500; line-height: 26px;
padding: 8px 16px;
font-size: 18px;
font-weight: 400;
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
background: linear-gradient(135deg, #009a29 0%, #48C666 100%); background: linear-gradient(135deg, #009a29 0%, #48C666 100%);
@ -285,10 +290,22 @@ export default {
} }
} }
.nav-right {
display: flex;
align-items: center;
gap: 20px;
}
.list-count {
font-size: 14px;
font-weight: 400;
color: #6B8575;
}
// //
.sidebar { .sidebar {
position: sticky; position: sticky;
top: 104px; // top: 104px;
width: 220px; width: 220px;
height: fit-content; height: fit-content;
min-width: 220px; min-width: 220px;
@ -412,62 +429,82 @@ export default {
} }
} }
// //
.content-area { .card-list {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
} }
// //
.card-grid { .service-grid {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
gap: 20px; gap: 24px;
} }
.database-card { .service-card {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 24px; overflow: hidden;
background: #fff; background: #fff;
border-radius: 12px; border-radius: 12px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
transition: all 0.3s ease; transition: all 0.3s ease;
&::before { &.highlight-card {
position: absolute; animation: highlight-pulse 3s ease-out;
top: 0;
left: 0;
width: 100%;
height: 3px;
background: linear-gradient(90deg, #009a29, #48C666);
content: '';
transform: scaleX(0);
transform-origin: left;
transition: transform 0.3s ease;
}
&:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(0, 154, 41, 0.15);
&::before {
transform: scaleX(1);
}
} }
} }
.card-header { .card-header {
margin-bottom: 12px; position: relative;
padding: 16px;
height: 70px;
&::after {
position: absolute;
right: 16px;
bottom: -6px;
left: 16px;
height: 1px;
background: #E8F0EC;
content: '';
}
} }
.card-title { .card-title-box {
margin-bottom: 12px; display: flex;
font-size: 18px; justify-content: space-between;
font-weight: 600; }
line-height: 1.4;
color: #1a1a1a; .card-title-text {
flex: 1;
min-width: 0;
}
.card-title-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
}
.card-title-main {
flex: 1;
overflow: hidden;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: #003B1A;
text-overflow: ellipsis;
white-space: nowrap;
}
.card-title-sub {
display: flex;
gap: 12px;
justify-content: space-between;
} }
.card-tags { .card-tags {
@ -477,10 +514,11 @@ export default {
} }
.tag { .tag {
display: inline-block; padding: 2px 8px;
padding: 4px 10px; font-size: 13px;
font-size: 12px; font-weight: 400;
font-weight: 500; color: #00B96B;
background: #EEFAE2;
border-radius: 4px; border-radius: 4px;
} }
@ -504,34 +542,72 @@ export default {
background: #fff3e0; background: #fff3e0;
} }
.card-content {
padding: 16px;
}
.card-desc { .card-desc {
margin-bottom: 20px; display: block;
height: 70px;
overflow: hidden;
font-size: 14px; font-size: 14px;
line-height: 1.6; line-height: 1.6;
color: #666; color: #666;
flex: 1; text-overflow: ellipsis;
-webkit-line-clamp: 3;
} }
.card-footer { .card-footer {
position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 14px 16px;
height: 64px;
&::before {
position: absolute;
top: 0;
right: 16px;
left: 16px;
height: 1px;
background: #E8F0EC;
content: '';
}
} }
.price-tag { .card-price-info {
padding: 4px 12px; display: flex;
font-size: 14px; align-items: baseline;
font-weight: 600; }
.card-actions {
display: flex;
height: 32px;
padding: 6px 12px;
border-radius: 4px; border-radius: 4px;
border: 1px solid #00b96b;
color: #00b96b;
font-size: 14px;
font-weight: 400;
&:hover {
background: rgba(0, 154, 41, 0.1);
cursor: pointer;
}
}
.price-value {
font-size: 20px;
font-weight: 600;
color: #FF4D4F;
&.free { &.free {
color: #2e7d32; color: #2e7d32;
background: #e8f5e9;
} }
&.paid { &.paid {
color: #e65100; color: #e65100;
background: #fff3e0;
} }
} }