feat: 全站视觉焕新与悬浮玻璃 TabBar 迁移

This commit is contained in:
2026-08-07 23:29:19 +08:00
parent 19408e5a8c
commit 61f1217384
97 changed files with 4007 additions and 2024 deletions
+270 -145
View File
@@ -1,24 +1,91 @@
.diy-page {
padding: 0 24px 24px;
padding: 0 32rpx calc(48rpx + env(safe-area-inset-bottom));
min-height: 100vh;
box-sizing: border-box;
}
/* 顶部标题区 */
.diy-page .page-header {
display: flex;
align-items: center;
margin: 0 0 24rpx;
padding-top: 0;
padding-bottom: 16rpx;
background: transparent;
border: none;
box-shadow: none;
}
.diy-page .page-header.surface-card {
background: transparent;
border: none;
box-shadow: none;
}
.diy-page .page-header .flex-between {
min-height: 88rpx;
}
.back-btn {
display: flex;
align-items: center;
justify-content: center;
width: 80rpx;
height: 80rpx;
flex-shrink: 0;
border-radius: 50%;
background: var(--bg-card);
border: 1rpx solid var(--border-strong);
box-shadow: var(--shadow-card);
font-size: 36rpx;
line-height: 1;
color: var(--text-primary);
}
.back-btn:active {
transform: scale(0.96);
}
.diy-page .page-title {
flex: 1;
min-width: 0;
padding: 0 16rpx;
text-align: center;
font-size: 34rpx;
font-weight: 700;
color: var(--text-primary);
letter-spacing: 0;
line-height: 1.2;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.header-spacer {
width: 80rpx;
height: 80rpx;
flex-shrink: 0;
}
/* 画布区域 */
.canvas-wrapper {
padding: 40px;
padding: 24rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 24rpx;
}
.canvas-area {
position: relative;
background: var(--bg-input);
overflow: hidden;
border-radius: 16px;
min-width: 200px;
min-height: 200px;
border-radius: 24rpx;
min-width: 300rpx;
min-height: 400rpx;
max-width: 100%;
box-sizing: border-box;
box-shadow: inset 0 0 0 1rpx var(--border-strong);
}
.mask-border {
@@ -37,46 +104,59 @@
max-width: 100%;
max-height: 100%;
z-index: 5;
border: 2px solid transparent;
border: 2rpx solid transparent;
border-radius: 8rpx;
}
.canvas-image.active {
border-color: var(--accent-primary);
box-shadow: 0 0 0 8rpx var(--accent-primary-soft);
}
.canvas-image.overlap {
border-color: var(--danger);
box-shadow: 0 0 12px var(--danger-soft);
box-shadow: 0 0 0 8rpx var(--danger-soft);
}
/* 贴纸面板 */
.sticker-panel {
padding: 28px;
padding: 24rpx;
}
.sticker-panel .section-title {
display: block;
margin-bottom: 20rpx;
font-size: 32rpx;
font-weight: 700;
color: var(--text-primary);
letter-spacing: 0;
}
.sticker-list {
display: flex;
flex-wrap: wrap;
gap: 16px;
gap: 16rpx;
}
.sticker-thumb {
position: relative;
width: 120px;
height: 120px;
width: 164rpx;
height: 164rpx;
border: 1rpx solid var(--border);
border-radius: 12px;
border-radius: 20rpx;
overflow: hidden;
background: var(--bg-input);
box-shadow: var(--shadow-card);
}
.sticker-thumb.active {
border-color: var(--accent-primary);
border-width: 2rpx;
box-shadow: 0 0 0 6rpx var(--accent-primary-soft);
}
.sticker-thumb.overlap {
border-color: var(--danger);
box-shadow: 0 0 0 6rpx var(--danger-soft);
}
.sticker-thumb-img {
@@ -86,52 +166,59 @@
.sticker-del {
position: absolute;
top: 4px;
right: 4px;
width: 36px;
height: 36px;
top: 8rpx;
right: 8rpx;
width: 44rpx;
height: 44rpx;
background: var(--danger);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
box-shadow: var(--shadow-card);
}
.del-icon {
color: #fff;
font-size: 24px;
font-size: 28rpx;
font-weight: 700;
line-height: 1;
}
.sticker-add-btn {
width: 120px;
height: 120px;
border: 1rpx solid var(--border);
border-radius: 12px;
width: 164rpx;
height: 164rpx;
border: 1rpx solid var(--border-strong);
border-radius: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: var(--bg-input);
background: var(--bg-muted);
}
.sticker-add-btn:active {
transform: scale(0.97);
}
.add-icon {
font-size: 48px;
font-size: 44rpx;
color: var(--accent-primary);
line-height: 1;
font-weight: 600;
}
.add-label {
font-size: 22px;
font-size: 22rpx;
color: var(--text-secondary);
margin-top: 8px;
margin-top: 8rpx;
}
.overlap-hint {
display: block;
margin-top: 16px;
font-size: 26px;
margin-top: 16rpx;
font-size: 24rpx;
color: var(--danger);
font-weight: 600;
text-align: center;
@@ -139,153 +226,78 @@
/* 工具栏 */
.toolbar {
padding: 28px 32px;
padding: 24rpx;
}
.tool-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
gap: 16rpx;
padding: 8rpx 0;
}
.tool-row:last-child {
margin-bottom: 0;
.tool-row + .tool-row {
border-top: 1rpx solid var(--border);
margin-top: 8rpx;
padding-top: 16rpx;
}
.tool-label {
font-size: 28px;
font-size: 26rpx;
font-weight: 600;
color: var(--text-primary);
}
.tool-btn {
width: 56px;
height: 56px;
width: 64rpx;
height: 64rpx;
background: var(--bg-input);
border: 1rpx solid var(--border-strong);
border-radius: 50%;
border: 1rpx solid var(--border);
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
font-size: 32rpx;
color: var(--text-primary);
font-weight: 700;
font-weight: 600;
}
.tool-btn:active {
transform: scale(0.96);
background: var(--bg-muted);
}
.tool-value {
font-size: 28px;
font-size: 26rpx;
font-weight: 600;
color: var(--accent-primary);
min-width: 80px;
min-width: 88rpx;
text-align: center;
font-variant-numeric: tabular-nums;
}
.tool-hint {
font-size: 24px;
font-size: 24rpx;
color: var(--text-secondary);
}
/* 预览弹窗 */
.preview-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
padding: 40px;
}
.preview-card {
background: var(--bg-card);
width: 100%;
max-height: 80vh;
overflow-y: auto;
padding: 40px;
}
.preview-title {
font-size: 36px;
font-weight: 700;
color: var(--text-primary);
display: block;
margin-bottom: 24px;
text-align: center;
}
.preview-canvas {
background: var(--bg-input);
border-radius: 16px;
overflow: hidden;
margin: 0 auto 24px;
border: 1rpx solid var(--border-strong);
position: relative;
min-width: 200px;
min-height: 200px;
max-width: 100%;
box-sizing: border-box;
}
.preview-image {
position: absolute;
max-width: 100%;
max-height: 100%;
z-index: 5;
}
.preview-image.overlap {
border: 2px solid var(--danger);
}
.product-info {
text-align: center;
margin-bottom: 32px;
}
.product-name {
font-size: 30px;
font-weight: 700;
color: var(--text-primary);
display: block;
margin-bottom: 8px;
}
.product-size {
font-size: 24px;
color: var(--text-secondary);
}
.preview-actions {
display: flex;
gap: 20px;
}
.preview-actions .btn-secondary,
.preview-actions .btn-primary {
flex: 1;
text-align: center;
}
.preview-actions .btn-primary.disabled {
opacity: 0.5;
pointer-events: none;
}
/* 常驻编辑按钮 */
.edit-btn-bar {
display: flex;
justify-content: flex-end;
margin-top: 24rpx;
}
.edit-btn {
padding: 16px 48px;
border-radius: 50px;
font-size: 28px;
display: flex;
align-items: center;
justify-content: center;
min-width: 176rpx;
height: 88rpx;
padding: 0 40rpx;
border-radius: 999rpx;
font-size: 28rpx;
font-weight: 600;
text-align: center;
background: var(--bg-input);
@@ -301,19 +313,132 @@
}
.edit-btn.disabled {
opacity: 0.45;
pointer-events: none;
}
/* 底部操作栏 — 毛玻璃由 BottomActionBar 提供 */
.bottom-action-bar .btn-primary,
.bottom-action-bar .btn-secondary {
flex: 1;
text-align: center;
padding: 28rpx 0;
font-size: 28rpx;
font-weight: 600;
line-height: 1.2;
}
/* 预览弹层 */
.preview-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.45);
display: flex;
align-items: flex-end;
justify-content: center;
z-index: 1000;
}
.preview-card {
width: 100%;
max-height: 88vh;
overflow-y: auto;
padding: 40rpx 32rpx calc(32rpx + env(safe-area-inset-bottom));
background: var(--bg-card);
border-radius: 32rpx 32rpx 0 0;
border: 1rpx solid var(--border);
box-shadow: var(--shadow-elevated);
box-sizing: border-box;
}
.preview-card::before {
content: '';
display: block;
width: 64rpx;
height: 8rpx;
margin: 0 auto 32rpx;
border-radius: 999rpx;
background: var(--bg-muted);
}
.preview-title {
font-size: 34rpx;
font-weight: 700;
color: var(--text-primary);
display: block;
margin-bottom: 24rpx;
text-align: center;
letter-spacing: 0;
}
.preview-canvas {
background: var(--bg-input);
border-radius: 24rpx;
overflow: hidden;
margin: 0 auto 24rpx;
border: 1rpx solid var(--border-strong);
position: relative;
min-width: 300rpx;
min-height: 400rpx;
max-width: 100%;
box-sizing: border-box;
}
.preview-image {
position: absolute;
max-width: 100%;
max-height: 100%;
z-index: 5;
}
.preview-image.overlap {
border: 2rpx solid var(--danger);
border-radius: 8rpx;
}
.product-info {
text-align: center;
margin-bottom: 28rpx;
}
.product-name {
font-size: 32rpx;
font-weight: 700;
color: var(--text-primary);
display: block;
margin-bottom: 8rpx;
letter-spacing: 0;
}
.product-size {
font-size: 24rpx;
color: var(--text-secondary);
}
.preview-actions {
display: flex;
gap: 16rpx;
}
.preview-actions .btn-secondary,
.preview-actions .btn-primary {
flex: 1;
text-align: center;
padding: 28rpx 0;
font-size: 28rpx;
font-weight: 600;
line-height: 1.2;
}
.preview-actions .btn-primary.disabled {
opacity: 0.5;
pointer-events: none;
}
/* 底部操作栏 — 毛玻璃规则由全局 .action-bar 提供 */
.action-bar .btn-primary,
.action-bar .btn-secondary {
flex: 1;
text-align: center;
padding: 24px 0;
font-size: 28px;
}
/* 局部间距 */
.mt-20 {
margin-top: 20px;
margin-top: 24rpx;
}
+5 -4
View File
@@ -8,6 +8,7 @@ import { useThemeContext } from '../../context/ThemeContext'
import { useSafeArea } from '../../hooks/useSafeArea'
import { useStatusBar } from '../../hooks/useStatusBar'
import ThemedPageMeta from '../../components/ThemedPageMeta'
import BottomActionBar from '../../components/BottomActionBar'
export default function DIYPage() {
const { theme, resolvedTheme } = useThemeContext()
@@ -275,11 +276,11 @@ export default function DIYPage() {
<ThemedPageMeta />
<View className='diy-page'>
<View className='page-header surface-card mt-20' style={{ marginTop: `${safe.headerPaddingTop}px` }}>
<View className='page-header surface-card mt-20' style={{ paddingTop: `${safe.headerPaddingTop}px` }}>
<View className='flex-between' style={{ width: '100%' }}>
<Text className='back-btn' onTap={goBack}></Text>
<Text className='page-title'></Text>
<View style={{ width: '60px' }} />
<View className='header-spacer' />
</View>
</View>
@@ -358,14 +359,14 @@ export default function DIYPage() {
</View>
{/* 底部操作按钮 */}
<View className='action-bar'>
<BottomActionBar>
<View className='btn-primary' onTap={() => setPreviewMode(true)}>
<Text></Text>
</View>
<View className='btn-secondary' onTap={addSticker}>
<Text></Text>
</View>
</View>
</BottomActionBar>
{/* 预览弹层 */}
{previewMode && (
+126 -76
View File
@@ -1,37 +1,65 @@
.sticker-edit-page {
padding: 0 24px 24px;
padding: 0 32rpx calc(48rpx + env(safe-area-inset-bottom));
min-height: 100vh;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
/* 顶部导航 */
.edit-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: calc(env(safe-area-inset-top, 0px) + 24px) 0 24px;
gap: 16rpx;
padding-bottom: 24rpx;
}
.edit-back {
font-size: 36px;
display: flex;
align-items: center;
justify-content: center;
width: 80rpx;
height: 80rpx;
flex-shrink: 0;
border-radius: 50%;
background: var(--bg-card);
border: 1rpx solid var(--border-strong);
box-shadow: var(--shadow-card);
font-size: 36rpx;
line-height: 1;
color: var(--text-primary);
width: 60px;
}
.edit-back:active {
transform: scale(0.96);
}
.edit-title {
font-size: 34px;
flex: 1;
min-width: 0;
text-align: center;
font-size: 34rpx;
font-weight: 700;
color: var(--text-primary);
text-align: center;
flex: 1;
letter-spacing: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.edit-save {
font-size: 28px;
color: var(--accent-primary);
display: flex;
align-items: center;
justify-content: flex-end;
min-width: 80rpx;
font-size: 26rpx;
font-weight: 600;
width: 60px;
text-align: right;
color: var(--accent-primary);
}
.edit-save:active {
opacity: 0.85;
}
/* 画布区域 */
@@ -40,27 +68,30 @@
display: flex;
align-items: center;
justify-content: center;
padding: 20px 0;
min-height: 400px;
padding: 8rpx 0 24rpx;
min-height: 480rpx;
}
.edit-canvas {
width: 100%;
height: 500px;
height: 480rpx;
background: var(--bg-input);
border-radius: 16px;
border-radius: 24rpx;
border: 1rpx solid var(--border-strong);
box-shadow: var(--shadow-card);
}
/* 工具面板 */
.edit-tools {
padding: 32px;
padding: 24rpx;
}
.edit-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 32px;
gap: 24rpx;
margin-bottom: 24rpx;
}
.edit-row:last-child {
@@ -68,76 +99,36 @@
}
.edit-label {
font-size: 28px;
font-weight: 500;
font-size: 26rpx;
font-weight: 600;
color: var(--text-primary);
width: 120px;
width: 96rpx;
flex-shrink: 0;
}
.slider-wrap {
flex: 1;
display: flex;
align-items: center;
gap: 16px;
}
.slider-track {
flex: 1;
height: 8px;
border-radius: 4px;
background: var(--bg-input);
position: relative;
}
.slider-fill {
height: 100%;
border-radius: 4px;
background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-soft));
position: absolute;
left: 0;
top: 0;
}
.slider-thumb {
width: 32px;
height: 32px;
border-radius: 50%;
background: #fff;
border: 4px solid var(--accent-primary);
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.slider-value {
font-size: 24px;
color: var(--text-secondary);
min-width: 60px;
text-align: right;
}
/* 快速操作按钮 */
.edit-quick-actions {
display: flex;
gap: 16px;
gap: 16rpx;
flex-wrap: wrap;
}
.quick-btn {
padding: 16px 28px;
border-radius: 40px;
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
height: 64rpx;
padding: 0 28rpx;
border-radius: 999rpx;
font-size: 24rpx;
font-weight: 500;
background: var(--bg-input);
color: var(--text-primary);
border: 1rpx solid var(--border);
transition: all 0.2s;
transition: all 0.2s ease;
}
.quick-btn:active {
opacity: 0.8;
opacity: 0.85;
transform: scale(0.97);
}
@@ -147,13 +138,67 @@
color: var(--accent-primary);
}
/* 底部操作栏 — 毛玻璃规则由全局 .action-bar 提供 */
/* 滑块 */
.slider-wrap {
flex: 1;
display: flex;
align-items: center;
gap: 12rpx;
min-width: 0;
}
.slider-track {
flex: 1;
height: 8rpx;
border-radius: 999rpx;
background: var(--bg-input);
border: 1rpx solid var(--border);
position: relative;
min-width: 0;
}
.slider-fill {
height: 100%;
border-radius: 999rpx;
background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-soft));
position: absolute;
left: 0;
top: 0;
}
.slider-thumb {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background: var(--bg-card);
border: 4rpx solid var(--accent-primary);
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
box-shadow: var(--shadow-card);
}
.slider-thumb.dragging {
transform: translate(-50%, -50%) scale(1.12);
}
.slider-value {
font-size: 22rpx;
color: var(--text-secondary);
min-width: 80rpx;
text-align: right;
font-variant-numeric: tabular-nums;
}
/* 底部操作栏 — 毛玻璃由 BottomActionBar 提供 */
.edit-footer .btn-primary,
.edit-footer .btn-secondary {
flex: 1;
text-align: center;
padding: 24px 0;
font-size: 28px;
padding: 28rpx 0;
font-size: 28rpx;
font-weight: 600;
line-height: 1.2;
}
/* 加载遮罩 */
@@ -163,7 +208,7 @@
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.4);
background: rgba(0, 0, 0, 0.45);
z-index: 1000;
display: flex;
align-items: center;
@@ -172,7 +217,12 @@
}
.edit-loading-text {
font-size: 28px;
font-size: 28rpx;
color: #fff;
margin-top: 20px;
margin-top: 20rpx;
}
/* 局部间距 */
.mt-20 {
margin-top: 24rpx;
}
+4 -3
View File
@@ -8,6 +8,7 @@ import { useThemeContext } from '../../../context/ThemeContext'
import { useSafeArea } from '../../../hooks/useSafeArea'
import { useStatusBar } from '../../../hooks/useStatusBar'
import ThemedPageMeta from '../../../components/ThemedPageMeta'
import BottomActionBar from '../../../components/BottomActionBar'
/* ============================================================
使用 Canvas 实现贴纸编辑(亮度/色相/线稿)
@@ -324,7 +325,7 @@ export default function StickerEditPage() {
id='editCanvas'
type='2d'
className='edit-canvas'
style={{ width: '100%', height: '400px' }}
style={{ width: '100%', height: '480rpx' }}
/>
</View>
@@ -415,14 +416,14 @@ export default function StickerEditPage() {
<View style={{ flex: 1 }} />
<View className='action-bar edit-footer'>
<BottomActionBar className='edit-footer'>
<View className='btn-secondary' onTap={() => Taro.navigateBack()}>
<Text></Text>
</View>
<View className='btn-primary' onTap={handleSave}>
<Text></Text>
</View>
</View>
</BottomActionBar>
<View className='safe-bottom-placeholder' />