style(history): 重新设计历史页面样式,优化布局和视觉效果
- 移除多余的样式规则,简化CSS结构 - 调整历史项的边距、内边距和圆角,提升视觉一致性 - 更新字体大小和颜色,增强可读性 - 删除不再使用的状态文本和颜色函数,精简代码
This commit is contained in:
parent
a38a0847eb
commit
1422eef000
|
|
@ -1,54 +1,10 @@
|
||||||
.history {
|
.history {
|
||||||
background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
|
background: #fff;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: flex-end;
|
|
||||||
padding: 40px 32px 32px;
|
|
||||||
background: #fff;
|
|
||||||
border-bottom: 2px solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-left {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.history-title {
|
|
||||||
font-size: 40px;
|
|
||||||
font-weight: 700;
|
|
||||||
color: #333;
|
|
||||||
letter-spacing: 0.5px;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.record-count {
|
|
||||||
font-size: 24px;
|
|
||||||
color: #666;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.clear-btn {
|
|
||||||
font-size: 28px;
|
|
||||||
color: #007aff;
|
|
||||||
background: rgb(0 122 255 / 10%);
|
|
||||||
padding: 16px 24px;
|
|
||||||
border-radius: 24px;
|
|
||||||
cursor: pointer;
|
|
||||||
border: 1px solid rgb(0 122 255 / 20%);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.clear-btn:active {
|
|
||||||
background: rgb(0 122 255 / 20%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.history-list {
|
.history-list {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
@ -58,7 +14,7 @@
|
||||||
|
|
||||||
.history-grid {
|
.history-grid {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 12px 16px;
|
padding: 8px 16px;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,43 +72,36 @@
|
||||||
|
|
||||||
.history-item {
|
.history-item {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 24px;
|
border-radius: 12px;
|
||||||
padding: 32px;
|
padding: 20px;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
|
|
||||||
border: 1px solid #f0f0f0;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-item:active {
|
|
||||||
box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-thumbnail {
|
.item-thumbnail {
|
||||||
width: 100px;
|
width: 160px;
|
||||||
height: 100px;
|
height: 160px;
|
||||||
border-radius: 20px;
|
border-radius: 12px;
|
||||||
margin-right: 32px;
|
margin-right: 20px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumbnail-image {
|
.thumbnail-image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 20px;
|
border-radius: 12px;
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumbnail-placeholder {
|
.thumbnail-placeholder {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 20px;
|
border-radius: 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -185,13 +134,13 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-title {
|
.item-title {
|
||||||
font-size: 34px;
|
font-size: 28px;
|
||||||
font-weight: 700;
|
font-weight: 600;
|
||||||
color: #1a1a1a;
|
color: #333;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
@ -289,10 +238,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-time {
|
.item-time {
|
||||||
font-size: 24px;
|
font-size: 22px;
|
||||||
color: #8e8e93;
|
color: #999;
|
||||||
font-weight: 500;
|
font-weight: 400;
|
||||||
opacity: 0.8;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 加载指示器 */
|
/* 加载指示器 */
|
||||||
|
|
|
||||||
|
|
@ -76,32 +76,6 @@ export default function History() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getStatusText = (status: string) => {
|
|
||||||
switch (status) {
|
|
||||||
case 'processing':
|
|
||||||
return '生成中';
|
|
||||||
case 'completed':
|
|
||||||
return '已完成';
|
|
||||||
case 'failed':
|
|
||||||
return '生成失败';
|
|
||||||
default:
|
|
||||||
return '未知状态';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getStatusColor = (status: string) => {
|
|
||||||
switch (status) {
|
|
||||||
case 'processing':
|
|
||||||
return '#FF9500';
|
|
||||||
case 'completed':
|
|
||||||
return '#34C759';
|
|
||||||
case 'failed':
|
|
||||||
return '#FF3B30';
|
|
||||||
default:
|
|
||||||
return '#8E8E93';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatTime = (timeStr: string) => {
|
const formatTime = (timeStr: string) => {
|
||||||
const date = new Date(timeStr);
|
const date = new Date(timeStr);
|
||||||
const year = date.getFullYear();
|
const year = date.getFullYear();
|
||||||
|
|
@ -153,10 +127,6 @@ export default function History() {
|
||||||
<View className="item-header">
|
<View className="item-header">
|
||||||
<Text className="item-title">{record.templateName}</Text>
|
<Text className="item-title">{record.templateName}</Text>
|
||||||
<View className="item-right">
|
<View className="item-right">
|
||||||
<Text className="item-status" style={{ color: getStatusColor(record.status) }}>
|
|
||||||
{getStatusText(record.status)}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
{/* 添加状态指示器 */}
|
{/* 添加状态指示器 */}
|
||||||
{record.status === 'generating' && (
|
{record.status === 'generating' && (
|
||||||
<View className="loading-indicator">
|
<View className="loading-indicator">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue