Files
wechat_wc/src/pages/diy/index.scss
T

445 lines
7.7 KiB
SCSS

.diy-page {
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: 24rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 24rpx;
}
.canvas-area {
position: relative;
background: var(--bg-input);
overflow: hidden;
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 {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 1rpx solid var(--border-strong);
pointer-events: none;
z-index: 2;
}
.canvas-image {
position: absolute;
max-width: 100%;
max-height: 100%;
z-index: 5;
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 0 8rpx var(--danger-soft);
}
/* 贴纸面板 */
.sticker-panel {
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: 16rpx;
}
.sticker-thumb {
position: relative;
width: 164rpx;
height: 164rpx;
border: 1rpx solid var(--border);
border-radius: 20rpx;
overflow: hidden;
background: var(--bg-input);
box-shadow: var(--shadow-card);
}
.sticker-thumb.active {
border-color: var(--accent-primary);
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 {
width: 100%;
height: 100%;
}
.sticker-del {
position: absolute;
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: 28rpx;
font-weight: 700;
line-height: 1;
}
.sticker-add-btn {
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-muted);
}
.sticker-add-btn:active {
transform: scale(0.97);
}
.add-icon {
font-size: 44rpx;
color: var(--accent-primary);
line-height: 1;
font-weight: 600;
}
.add-label {
font-size: 22rpx;
color: var(--text-secondary);
margin-top: 8rpx;
}
.overlap-hint {
display: block;
margin-top: 16rpx;
font-size: 24rpx;
color: var(--danger);
font-weight: 600;
text-align: center;
}
/* 工具栏 */
.toolbar {
padding: 24rpx;
}
.tool-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
padding: 8rpx 0;
}
.tool-row + .tool-row {
border-top: 1rpx solid var(--border);
margin-top: 8rpx;
padding-top: 16rpx;
}
.tool-label {
font-size: 26rpx;
font-weight: 600;
color: var(--text-primary);
}
.tool-btn {
width: 64rpx;
height: 64rpx;
background: var(--bg-input);
border: 1rpx solid var(--border);
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: var(--text-primary);
font-weight: 600;
}
.tool-btn:active {
transform: scale(0.96);
background: var(--bg-muted);
}
.tool-value {
font-size: 26rpx;
font-weight: 600;
color: var(--accent-primary);
min-width: 88rpx;
text-align: center;
font-variant-numeric: tabular-nums;
}
.tool-hint {
font-size: 24rpx;
color: var(--text-secondary);
}
/* 常驻编辑按钮 */
.edit-btn-bar {
display: flex;
justify-content: flex-end;
margin-top: 24rpx;
}
.edit-btn {
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);
color: var(--text-secondary);
border: 1rpx solid var(--border-strong);
transition: all 0.2s ease;
}
.edit-btn.active {
background: var(--accent-primary-soft);
color: var(--accent-primary);
border-color: var(--accent-primary);
}
.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;
}
/* 局部间距 */
.mt-20 {
margin-top: 24rpx;
}