更新页面样式和结构,优化加载、错误和刷新页面的用户体验,调整Vite配置以使用生产环境API,新增订单详情展示功能,提升整体界面一致性和可读性

This commit is contained in:
yahaozhang
2025-11-03 21:20:52 +08:00
parent fba18fc32c
commit 2e35f219e7
9 changed files with 781 additions and 235 deletions

View File

@@ -1,11 +1,25 @@
<template>
<div class="error-page">
<div class="page-header">
<h1 class="title">出现错误</h1>
</div>
<div class="error-container">
<div class="error-icon"></div>
<div class="icon-wrapper">
<svg class="error-svg" viewBox="0 0 24 24" width="80" height="80">
<circle cx="12" cy="12" r="11" fill="#f44336" opacity="0.1"/>
<path fill="#f44336" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
</svg>
</div>
<h2 class="error-title">{{ errorTitle }}</h2>
<p class="error-message">{{ errorMessage }}</p>
<button @click="$emit('retry')" class="retry-btn">重新尝试</button>
</div>
<div class="notice-text">
<p>遇到问题请联系客服</p>
<p>我们会尽快为您解决</p>
</div>
</div>
</template>
@@ -30,54 +44,110 @@ export default {
.error-page {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
padding: 40px 20px;
flex-direction: column;
background: white;
min-height: 100vh;
}
.page-header {
text-align: center;
padding: 20px;
background: white;
border-bottom: 3px solid #f44336;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.title {
font-size: 20px;
font-weight: 600;
margin: 0;
color: #333;
background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.error-container {
background: white;
padding: 40px;
border-radius: 20px;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 40px 20px;
text-align: center;
max-width: 400px;
width: 100%;
}
.error-icon {
font-size: 48px;
margin-bottom: 16px;
.icon-wrapper {
margin-bottom: 24px;
animation: shake 0.5s ease-in-out;
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.error-svg {
filter: drop-shadow(0 4px 8px rgba(244, 67, 54, 0.3));
}
.error-title {
font-size: 20px;
font-size: 22px;
font-weight: 600;
margin: 0 0 12px 0;
color: #333;
}
.error-message {
font-size: 16px;
font-size: 14px;
color: #666;
margin: 0 0 24px 0;
line-height: 1.5;
margin: 0 0 32px 0;
line-height: 1.6;
max-width: 320px;
}
.retry-btn {
background: #667eea;
background: linear-gradient(135deg, #4776e6 0%, #8e54e9 100%);
color: white;
border: none;
padding: 12px 32px;
border-radius: 25px;
font-size: 16px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
min-width: 140px;
}
.retry-btn:hover {
background: #5a6fd8;
transform: translateY(-2px);
opacity: 0.9;
transform: translateY(-1px);
}
.notice-text {
text-align: center;
padding: 20px;
background: #f8f9fa;
border-top: 2px solid #e9ecef;
margin-top: auto;
}
.notice-text p {
margin: 4px 0;
font-size: 12px;
color: #666;
}
@media (max-width: 768px) {
.error-svg {
width: 64px;
height: 64px;
}
.error-title {
font-size: 18px;
}
}
</style>