feat: initialize luobo printing WeChat mini program with full feature stack

- Add comprehensive project documentation (README.md) with tech stack, structure, and usage guide
- Implement API layer with modular services (auth, file, order, printer, price, pay)
- Add Redux Toolkit state management with slices for user, order, file, and printer
- Create complete page structure: index, login, user center, file management, order management, print settings
- Build reusable UI components (OrderCard, PriceTable) with consistent styling
- Establish design system with CSS variables, animations, and common styles
- Add TypeScript type definitions for all domain entities
- Implement utility functions for formatting, HTTP requests, and local storage
- Configure ESLint to use CommonJS format for compatibility
- Update dependencies: add Redux Toolkit, React Redux, and related packages
- Style pages with gradient backgrounds, card layouts, and smooth animations

BREAKING CHANGE: This is an initial project setup that replaces the previous Taro Hooks demo template with a complete printing service mini program
This commit is contained in:
Mikuisnotavailable
2026-03-30 23:22:30 +08:00
parent a424d06731
commit c9a70a139c
20 changed files with 4022 additions and 1697 deletions

View File

@@ -1,58 +1,70 @@
/* ============================================
首页样式 - 爱印通
首页样式 - 爱印通 Apple Liquid Glass 设计系统
大字体大控件版本 - 微信小程序优化
============================================ */
@import '../../styles/variables.css';
page {
background: linear-gradient(180deg, #e8f0fe 0%, #f0f5ff 30%, #fafbfc 100%);
background: var(--bg-page-gradient);
min-height: 100vh;
}
.index-page {
min-height: 100vh;
padding-bottom: 140px;
/* 增加底部填充确保内容不被TabBar遮挡 */
padding-bottom: 320rpx;
position: relative;
/* 创建独立的堆叠上下文,确保毛玻璃效果正确渲染 */
z-index: 0;
/* 确保背景正确传递,避免毛玻璃效果失效 */
background: transparent;
}
/* 头部区域 */
/* ========== 头部区域 ========== */
.header {
background: var(--primary-gradient);
padding: 100px 32px 80px;
padding: 192rpx 48rpx 144rpx;
position: relative;
overflow: hidden;
border-radius: 0 0 40px 40px;
border-radius: 0 0 64rpx 64rpx;
}
.header::before {
content: '';
position: absolute;
top: -30%;
right: -15%;
width: 350px;
height: 350px;
background: rgba(255, 255, 255, 0.12);
top: -20%;
right: -10%;
width: 600rpx;
height: 600rpx;
background: rgba(255, 255, 255, 0.15);
border-radius: 50%;
animation: float 6s ease-in-out infinite;
animation: float 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
filter: blur(80rpx);
}
.header::after {
content: '';
position: absolute;
bottom: -20%;
left: -10%;
width: 250px;
height: 250px;
background: rgba(255, 255, 255, 0.08);
bottom: -15%;
left: -5%;
width: 400rpx;
height: 400rpx;
background: rgba(255, 255, 255, 0.1);
border-radius: 50%;
animation: float 8s ease-in-out infinite reverse;
animation: float 8s cubic-bezier(0.4, 0, 0.2, 1) infinite reverse;
filter: blur(60rpx);
}
@keyframes float {
0%, 100% {
transform: translateY(0) scale(1);
opacity: 0.8;
}
50% {
transform: translateY(-20px) scale(1.05);
transform: translateY(-30rpx) scale(1.05);
opacity: 1;
}
}
@@ -64,101 +76,140 @@ page {
}
.app-title {
font-size: 48px;
font-size: 88rpx;
font-weight: 700;
color: #fff;
letter-spacing: 4px;
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
color: #7279be;
letter-spacing: 4rpx;
text-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.15);
line-height: 1.2;
}
.app-subtitle {
font-size: 24px;
font-size: 36rpx;
color: rgba(255, 255, 255, 0.85);
margin-top: 8px;
letter-spacing: 2px;
margin-top: 16rpx;
letter-spacing: 2rpx;
font-weight: 400;
}
/* 登录按钮区域 */
/* ========== 登录按钮 ========== */
.login-section {
padding: 0 32px;
margin-top: -30px;
padding: 0 48rpx;
margin-top: -48rpx;
position: relative;
z-index: 2;
animation: slideUp 0.5s ease forwards;
animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.login-btn {
width: 100%;
background: rgba(255, 255, 255, 0.95);
border: 1px solid rgba(90, 147, 223, 0.2);
color: var(--primary-color);
font-size: var(--font-size-lg);
font-weight: var(--font-weight-semibold);
padding: 24px 0;
border-radius: 50px;
box-shadow: var(--shadow-lg);
backdrop-filter: blur(10px);
transition: all var(--transition-base);
letter-spacing: 2px;
background: var(--bg-glass-heavy);
backdrop-filter: blur(48rpx) saturate(180%);
-webkit-backdrop-filter: blur(48rpx) saturate(180%);
/* 增强的多层边框描边 */
border: 3rpx solid rgba(0, 122, 255, 0.3);
outline: 1rpx solid rgba(255, 255, 255, 0.8);
outline-offset: -4rpx;
color: var(--primary);
font-size: 34rpx;
font-weight: 700;
padding: 40rpx 0;
border-radius: var(--radius-xl);
/* 增强的阴影效果 */
box-shadow:
0 8rpx 32rpx rgba(0, 122, 255, 0.15),
0 2rpx 8rpx rgba(0, 0, 0, 0.06),
inset 0 1rpx 0 rgba(255, 255, 255, 0.9),
inset 0 -1rpx 0 rgba(0, 122, 255, 0.1);
transition: all var(--transition-scale);
letter-spacing: 2rpx;
cursor: pointer;
position: relative;
z-index: 1;
}
.login-btn::after {
border: none;
/* 按钮内部光泽效果 */
.login-btn::before {
content: '';
position: absolute;
top: 2rpx;
left: 2rpx;
right: 2rpx;
height: 50%;
background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
border-radius: var(--radius-lg);
pointer-events: none;
}
.login-btn:active {
transform: scale(0.97);
transform: scale(0.98);
background: rgba(255, 255, 255, 0.95);
border-color: rgba(0, 122, 255, 0.5);
box-shadow:
0 4rpx 16rpx rgba(0, 122, 255, 0.1),
0 1rpx 4rpx rgba(0, 0, 0, 0.04),
inset 0 1rpx 0 rgba(255, 255, 255, 0.9);
}
/* 用户卡片 */
/* ========== 用户卡片 ========== */
.user-section {
padding: 0 32px;
margin-top: -30px;
padding: 0 48rpx;
margin-top: -48rpx;
position: relative;
z-index: 2;
animation: slideUp 0.5s ease forwards;
animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
opacity: 0;
}
.user-card {
background: rgba(255, 255, 255, 0.95);
background: var(--bg-glass-heavy);
backdrop-filter: blur(48rpx) saturate(180%);
-webkit-backdrop-filter: blur(48rpx) saturate(180%);
border-radius: var(--radius-xl);
padding: 24px;
padding: 40rpx;
display: flex;
align-items: center;
box-shadow: var(--shadow-lg);
border: 1px solid rgba(255, 255, 255, 0.8);
backdrop-filter: blur(20px);
border: 1px solid var(--glass-border);
transition: all var(--transition-base);
}
.user-card:active {
transform: scale(0.99);
}
.avatar-wrapper {
margin-right: 20px;
margin-right: 32rpx;
position: relative;
}
.avatar-img {
width: 80px;
height: 80px;
width: 128rpx;
height: 128rpx;
border-radius: 50%;
border: 3px solid #fff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
border: 6rpx solid var(--bg-card-solid);
box-shadow: var(--shadow-md);
object-fit: cover;
}
.avatar-placeholder {
width: 80px;
height: 80px;
width: 128rpx;
height: 128rpx;
background: var(--primary-gradient);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
border: 3px solid #fff;
box-shadow: 0 4px 12px rgba(90, 147, 223, 0.3);
border: 6rpx solid var(--bg-card-solid);
box-shadow: 0 8rpx 24rpx rgba(0, 122, 255, 0.3);
}
.avatar-text {
font-size: 36px;
color: #fff;
font-weight: var(--font-weight-bold);
font-size: 56rpx;
color: #ffffff;
font-weight: 700;
}
.user-detail {
@@ -166,191 +217,328 @@ page {
}
.user-name {
font-size: var(--font-size-xl);
font-size: 36rpx;
color: var(--text-primary);
font-weight: var(--font-weight-semibold);
font-weight: 600;
display: block;
margin-bottom: 4px;
margin-bottom: 8rpx;
letter-spacing: -0.3px;
}
.user-balance {
font-size: var(--font-size-sm);
color: var(--text-tertiary);
font-size: 28rpx;
color: var(--text-secondary);
font-weight: 400;
}
.logout-btn-small {
background: #f5f5f7;
color: var(--text-tertiary);
font-size: var(--font-size-xs);
padding: 10px 20px;
border-radius: 24px;
background: var(--bg-hover);
color: var(--text-secondary);
font-size: 26rpx;
padding: 16rpx 32rpx;
border-radius: var(--radius-full);
border: none;
transition: all var(--transition-base);
font-weight: 500;
}
.logout-btn-small:active {
background: #e8e8ea;
background: var(--border-primary);
transform: scale(0.95);
}
/* 快捷操作 */
/* ========== 快捷操作区域 ========== */
.quick-actions {
display: flex;
padding: 32px 24px 0;
gap: 16px;
justify-content: space-around;
padding: 48rpx 32rpx;
gap: 24rpx;
animation: fadeInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
opacity: 0;
/* 启用GPU加速确保滚动时毛玻璃效果正常 */
transform: translateZ(0);
-webkit-transform: translateZ(0);
}
/* 快捷操作按钮 - 简化样式避免与TabBar毛玻璃冲突 */
.action-item {
flex: 1;
background: var(--bg-card);
/* 使用实心背景色避免与TabBar毛玻璃效果叠加 */
background: var(--bg-card-solid);
border-radius: var(--radius-lg);
padding: 28px 12px;
padding: 40rpx 24rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-md);
border: 2rpx solid var(--border-light);
transition: all var(--transition-base);
cursor: pointer;
min-height: 200rpx;
position: relative;
}
/* 主操作按钮(上传文件)特殊样式 */
.action-item.primary {
background: var(--primary-gradient);
box-shadow: 0 8rpx 32rpx rgba(0, 122, 255, 0.3);
border: 2rpx solid rgba(255, 255, 255, 0.3);
}
.action-item:active {
transform: scale(0.96);
}
.action-icon {
font-size: 64rpx;
margin-bottom: 16rpx;
}
.action-text {
font-size: 28rpx;
font-weight: 600;
color: var(--text-primary);
text-align: center;
}
.action-item.primary .action-text {
color: var(--primary) !important;
text-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.1);
}
.business-card {
background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
border-radius: var(--radius-lg);
padding: 40rpx 28rpx;
display: flex;
flex-direction: column;
align-items: center;
box-shadow: var(--shadow-md);
transition: all var(--transition-base);
border: 1px solid var(--border-light);
transition: all var(--transition-base);
position: relative;
overflow: hidden;
animation: fadeInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
opacity: 0;
cursor: pointer;
}
.action-item::before {
.business-card:nth-child(1) { animation-delay: 0.25s; }
.business-card:nth-child(2) { animation-delay: 0.3s; }
.business-card:nth-child(3) { animation-delay: 0.35s; }
.business-card:nth-child(4) { animation-delay: 0.4s; }
/* 卡片顶部装饰色条 */
.business-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: var(--primary-gradient);
opacity: 0;
transition: opacity var(--transition-base);
height: 6rpx;
opacity: 0.8;
}
.action-item:active {
.business-card.doc::before {
background: linear-gradient(90deg, #007AFF, #5AC8FA);
}
.business-card.image::before {
background: linear-gradient(90deg, #5856D6, #AF52DE);
}
.business-card.archive::before {
background: linear-gradient(90deg, #FF9500, #FFCC00);
}
.business-card.scan::before {
background: linear-gradient(90deg, #34C759, #30D158);
}
.business-card:active {
transform: scale(0.96);
box-shadow: var(--shadow-sm);
}
.action-item:active::before {
opacity: 1;
}
.action-item.primary {
background: var(--primary-gradient);
box-shadow: 0 8px 24px rgba(90, 147, 223, 0.3);
}
.action-item.primary .action-text {
color: #fff;
}
.action-item.primary .action-icon {
background: rgba(255, 255, 255, 0.25);
color: #fff;
}
.action-icon {
width: 64px;
height: 64px;
background: linear-gradient(135deg, #f0f5ff 0%, #e8eefa 100%);
.business-icon {
width: 100rpx;
height: 100rpx;
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
margin-bottom: 12px;
transition: all var(--transition-base);
font-size: 52rpx;
margin-bottom: 20rpx;
box-shadow: var(--shadow-sm);
}
.action-text {
font-size: var(--font-size-base);
color: var(--text-secondary);
font-weight: var(--font-weight-medium);
.business-card.doc .business-icon {
background: linear-gradient(135deg, #E8F0FE 0%, #D0DCFA 100%);
}
/* 价目表 */
.business-card.image .business-icon {
background: linear-gradient(135deg, #EDE8FD 0%, #D8D0F8 100%);
}
.business-card.archive .business-icon {
background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
}
.business-card.scan .business-icon {
background: linear-gradient(135deg, #E8F8EC 0%, #C8F5D0 100%);
}
.business-text {
font-size: 28rpx;
font-weight: 600;
color: var(--text-primary);
text-align: center;
}
.business-desc {
font-size: 22rpx;
color: var(--text-tertiary);
margin-top: 8rpx;
text-align: center;
}
/* ========== 价目表 ========== */
.price-section {
padding: 28px 24px 0;
padding: 48rpx 32rpx 0;
animation: fadeInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
opacity: 0;
}
.price-table {
background: var(--bg-card);
background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
border-radius: var(--radius-lg);
padding: 24px;
padding: 40rpx;
box-shadow: var(--shadow-md);
border: 1px solid var(--border-light);
position: relative;
overflow: hidden;
}
/* 价目表顶部装饰线 */
.price-table::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 6rpx;
background: var(--primary-gradient);
}
/* 价目表底部装饰 */
.price-table::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 4rpx;
background: linear-gradient(90deg, transparent 0%, rgba(0,122,255,0.06) 50%, transparent 100%);
}
.price-title {
font-size: var(--font-size-xl);
font-weight: var(--font-weight-semibold);
font-size: 36rpx;
font-weight: 600;
color: var(--text-primary);
display: block;
margin-bottom: 20px;
padding-left: 12px;
border-left: 4px solid var(--primary-color);
margin-bottom: 32rpx;
padding-left: 24rpx;
border-left: 6rpx solid var(--primary);
letter-spacing: -0.3px;
}
.price-list {
display: flex;
flex-direction: column;
gap: 8rpx;
}
.price-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 12px;
border-radius: var(--radius-sm);
padding: 24rpx;
border-radius: var(--radius-md);
transition: background var(--transition-fast);
}
.price-item:nth-child(odd) {
background: #fafbfc;
background: rgba(0, 122, 255, 0.04);
}
.price-item:nth-child(even) {
background: var(--bg-card);
background: rgba(0, 0, 0, 0.01);
}
.price-name {
font-size: var(--font-size-base);
color: var(--text-secondary);
font-weight: var(--font-weight-medium);
font-size: 30rpx;
color: var(--text-primary);
font-weight: 500;
}
.price-value {
font-size: var(--font-size-md);
color: var(--error-color);
font-weight: var(--font-weight-semibold);
font-size: 32rpx;
color: var(--primary);
font-weight: 700;
}
/* 使用提示 */
/* ========== 使用提示 ========== */
.tips-section {
padding: 28px 24px;
margin-top: 12px;
padding: 48rpx 32rpx;
margin-top: 24rpx;
animation: fadeInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards;
opacity: 0;
}
.tips-card {
background: linear-gradient(135deg, #fefcf3 0%, #fdf9f0 100%);
background: linear-gradient(145deg, #FFF9E6 0%, #FFF8E1 50%, #FFFDE7 100%);
border-radius: var(--radius-lg);
padding: 24px;
border: 1px solid #f5e8c7;
box-shadow: var(--shadow-sm);
padding: 40rpx;
border: 2rpx solid rgba(255, 214, 102, 0.4);
box-shadow: 0 8rpx 32rpx rgba(255, 214, 102, 0.15);
position: relative;
overflow: hidden;
}
/* 提示卡片右上角装饰 */
.tips-card::before {
content: '';
position: absolute;
top: -20rpx;
right: -20rpx;
width: 80rpx;
height: 80rpx;
background: radial-gradient(circle, rgba(255, 214, 102, 0.15) 0%, transparent 70%);
border-radius: 50%;
}
.tips-title {
font-size: var(--font-size-lg);
font-weight: var(--font-weight-semibold);
color: #b08945;
font-size: 32rpx;
font-weight: 600;
color: #8B6914;
display: block;
margin-bottom: 16px;
margin-bottom: 32rpx;
letter-spacing: -0.3px;
position: relative;
z-index: 1;
}
.tips-item {
display: flex;
align-items: center;
margin-bottom: 12px;
align-items: flex-start;
margin-bottom: 24rpx;
gap: 24rpx;
position: relative;
z-index: 1;
}
.tips-item:last-child {
@@ -358,48 +546,65 @@ page {
}
.tips-number {
width: 28px;
height: 28px;
background: linear-gradient(135deg, #d4a853 0%, #c49a47 100%);
width: 48rpx;
height: 48rpx;
background: linear-gradient(135deg, #D4A853 0%, #C49A47 100%);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: #fff;
font-weight: var(--font-weight-medium);
margin-right: 12px;
font-size: 26rpx;
color: #ffffff;
font-weight: 600;
flex-shrink: 0;
margin-top: 2rpx;
box-shadow: 0 4rpx 12rpx rgba(196, 154, 71, 0.4);
}
.tips-text {
font-size: var(--font-size-sm);
color: #8a7340;
line-height: 1.5;
font-size: 28rpx;
color: #6B5210;
line-height: 1.6;
flex: 1;
}
/* 动画 */
@keyframes slideUp {
/* ========== 装饰光晕 - 使用 absolute 确保毛玻璃效果正确 ========== */
.index-page::before {
content: '';
position: absolute;
top: -300rpx;
right: -300rpx;
width: 1000rpx;
height: 1000rpx;
background: radial-gradient(circle, rgba(0, 122, 255, 0.08) 0%, transparent 70%);
border-radius: 50%;
pointer-events: none;
z-index: 0;
}
.index-page::after {
content: '';
position: absolute;
bottom: -200rpx;
left: -200rpx;
width: 800rpx;
height: 800rpx;
background: radial-gradient(circle, rgba(90, 200, 250, 0.06) 0%, transparent 70%);
border-radius: 50%;
pointer-events: none;
z-index: 0;
}
/* ========== 进入动画 ========== */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
transform: translateY(40rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 装饰光晕 */
.index-page::before {
content: '';
position: fixed;
top: -100px;
right: -100px;
width: 400px;
height: 400px;
background: radial-gradient(circle, rgba(125, 179, 245, 0.1) 0%, transparent 70%);
border-radius: 50%;
pointer-events: none;
z-index: 0;
}