feat ui设计稿bug修复

This commit is contained in:
Ironsp
2026-10-01 10:53:13 +08:00
parent 9ab6253c81
commit 1601bdd82c
89 changed files with 4741 additions and 3652 deletions

View File

@@ -1,5 +1,4 @@
<script setup lang="ts">
import { StatusTag } from '@/components'
import type { FinanceStats } from '@/types/business/finance'
import { formatMoney } from '@/utils/format'
@@ -16,140 +15,73 @@ const emit = defineEmits<{
</script>
<template>
<div class="finance-overview card">
<div class="finance-overview">
<!-- 卡内文字块:相对卡顶 26(设计 221 − 195) -->
<div class="finance-overview__main">
<p class="finance-overview__label text-secondary">
<p class="finance-overview__label">
累计消费总额
</p>
<p class="finance-overview__amount">
¥{{ formatMoney(stats?.totalExpense ?? 0) }}
¥ {{ formatMoney(stats?.totalExpense ?? 0) }}
</p>
<div class="finance-overview__meta">
<div class="finance-overview__periods">
<button
class="finance-overview__period"
@click="emit('periodChange', 'quarter')"
>
本季度
</button>
<button
class="finance-overview__period"
@click="emit('periodChange', 'year')"
>
本年
</button>
</div>
<span class="finance-overview__month text-secondary">{{ stats?.month }}</span>
<StatusTag
v-if="(stats?.pendingCount ?? 0) > 0"
:label="`待支付 ${stats?.pendingCount ?? 0}`"
variant="warning"
/>
</div>
</div>
<div class="finance-overview__actions">
<RouterLink to="/finance/invoices" class="finance-overview__action">
发票申请
</RouterLink>
<RouterLink to="/finance/bills" class="finance-overview__action">
账单明细
</RouterLink>
<button class="finance-overview__action" @click="emit('export')">
报表导出
</button>
</div>
<!-- 右上角「2026年账单 ›」 -->
<button class="finance-overview__period-link" @click="emit('periodChange', 'year')">
{{ stats?.month || '2026年账单' }}
<span aria-hidden="true">›</span>
</button>
</div>
</template>
<style lang="less" scoped>
// 设计 37:整卡为蓝紫渐变(累计消费总额白字),右上角白色操作链接
// 设计 6cd4aa76:渐变卡 (70,195) 1093.84×135;标签 (100,221) 13/400 #FFFFFF;
// 金额 (100,254) 38/700;右上角「2026年账单 ›」(1066.98,220) 11/500
.finance-overview {
.flex(column, flex-start, stretch);
flex: 1 1 500px;
position: relative;
flex: 1 1 auto;
min-width: 0;
padding: 14px @spacing-lg 16px;
height: 135px;
border-radius: @radius-base;
background: @finance-hero-gradient;
box-shadow: @shadow-base;
box-sizing: border-box;
&__main {
.flex(column, flex-start, flex-start);
gap: 6px;
padding: 26px 0 0 30px; // 标签 ink (100,221) → 卡内 (30,26)
gap: 16px; // 标签盒底 238 → 金额盒顶 254
}
&__label {
font-size: 13px;
font-weight: 400;
line-height: 17px;
color: @white;
font-size: 11px;
}
&__amount {
color: @white;
font-size: 29px;
font-size: 38px;
font-weight: 700;
line-height: 1.15;
}
&__meta {
.flex(row, flex-start, center);
gap: @spacing-base;
margin-top: 4px;
font-size: 11px;
color: fade(@white, 85%);
}
&__periods {
.flex(row, flex-start);
gap: @spacing-sm;
}
&__period {
height: 22px;
padding: 0 @spacing-sm;
border: 1px solid fade(@white, 45%);
border-radius: @radius-sm;
background: fade(@white, 16%);
line-height: 50px;
color: @white;
font-size: 11px;
transition: all 0.2s;
&:hover {
border-color: @white;
background: fade(@white, 30%);
color: @white;
}
}
&__month {
// 右上角链接:设计 x1066.98 y220 → 卡内右缘 27、顶 25
&__period-link {
position: absolute;
top: 25px;
right: 27px;
border: none;
background: transparent;
font-size: 11px;
color: fade(@white, 85%);
}
// 待支付小徽标压到渐变上:半透明白底 + 白字
:deep(.status-tag) {
background: fade(@white, 20%);
font-weight: 500;
line-height: 15px;
color: @white;
font-size: 11px;
}
// 操作链接置顶右对齐(对应设计右上角「2026年账单 ›」位置)
&__actions {
order: -1;
align-self: stretch;
.flex(row, flex-end, center);
gap: @spacing-base;
margin-bottom: 4px;
}
&__action {
font-size: 11px;
color: fade(@white, 92%);
cursor: pointer;
transition: color 0.2s;
transition: opacity 0.2s;
&:hover {
color: @white;
text-decoration: underline;
opacity: 0.8;
}
}
}