Files
lunar-mini/mini/pages/wish-tree/wish-tree.wxss
T
gouki b5bdf4c88d
Publish Mini Program Dev Version / publish (push) Failing after 10m47s
Build and Deploy Server / build (push) Failing after 2s
fix(wish-tree): 修复切换树时导航栏消失问题
- Canvas添加z-index: 1,确保不覆盖导航栏
- top-bar添加pointer-events: none,子元素恢复auto
- WXML添加trees.length保护,防止空数组访问
- switchTree添加空数组保护
2026-08-07 21:56:38 +00:00

311 lines
4.6 KiB
Plaintext

.container {
position: relative;
width: 100vw;
height: 100vh;
overflow: hidden;
background: #0f3460;
}
/* 全屏画布 */
.wish-tree-canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
/* 顶部导航 */
.top-bar {
position: absolute;
top: 0;
left: 0;
right: 0;
padding: 80rpx 30rpx 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 100;
pointer-events: none;
}
.top-bar > * {
pointer-events: auto;
}
.tree-switcher {
display: flex;
align-items: center;
gap: 20rpx;
background: rgba(0, 0, 0, 0.3);
padding: 10rpx 20rpx;
border-radius: 40rpx;
backdrop-filter: blur(10px);
}
.switch-btn {
width: 60rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
}
.switch-icon {
font-size: 40rpx;
color: #fff;
font-weight: bold;
}
.tree-name {
font-size: 32rpx;
color: #fff;
font-weight: bold;
min-width: 150rpx;
text-align: center;
}
/* 传感器控制 */
.sensor-controls {
display: flex;
gap: 16rpx;
}
.sensor-btn {
width: 70rpx;
height: 70rpx;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.3);
border-radius: 50%;
backdrop-filter: blur(10px);
transition: all 0.3s;
}
.sensor-btn.active {
background: rgba(255, 215, 0, 0.5);
box-shadow: 0 0 20rpx rgba(255, 215, 0, 0.5);
}
.sensor-icon {
font-size: 36rpx;
}
/* 许愿按钮 */
.action-bar {
position: absolute;
bottom: 60rpx;
left: 50%;
transform: translateX(-50%);
z-index: 100;
}
.btn-wish {
display: flex;
align-items: center;
justify-content: center;
gap: 12rpx;
background: linear-gradient(135deg, #C41E3A, #E74C3C);
color: #fff;
font-size: 32rpx;
padding: 24rpx 60rpx;
border-radius: 50rpx;
border: none;
box-shadow: 0 8rpx 30rpx rgba(196, 30, 58, 0.4);
}
.btn-wish .icon {
font-size: 36rpx;
}
/* 弹窗 */
.modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1000;
}
.modal-mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(5px);
}
.modal-content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: #fff;
border-radius: 32rpx 32rpx 0 0;
max-height: 80vh;
overflow: hidden;
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.modal-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.modal-close {
font-size: 48rpx;
color: #999;
padding: 10rpx;
}
.modal-body {
padding: 30rpx;
max-height: 60vh;
overflow-y: auto;
}
/* 类型选择 */
.type-selector {
display: flex;
gap: 20rpx;
margin-bottom: 30rpx;
}
.type-item {
flex: 1;
padding: 24rpx;
border: 2rpx solid #eee;
border-radius: 16rpx;
text-align: center;
transition: all 0.3s;
}
.type-item.active {
border-color: #C41E3A;
background: #FFF5F5;
}
.type-name {
display: block;
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-bottom: 8rpx;
}
.type-desc {
font-size: 22rpx;
color: #999;
}
/* 输入框 */
.wish-input {
width: 100%;
height: 200rpx;
padding: 20rpx;
border: 2rpx solid #eee;
border-radius: 16rpx;
font-size: 28rpx;
box-sizing: border-box;
}
.input-count {
text-align: right;
font-size: 22rpx;
color: #999;
margin-top: 10rpx;
}
/* 商品选择 */
.product-section {
margin-top: 30rpx;
}
.section-title {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.product-list {
display: flex;
flex-direction: column;
gap: 16rpx;
}
.product-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx;
border: 2rpx solid #eee;
border-radius: 16rpx;
transition: all 0.3s;
}
.product-item.active {
border-color: #C41E3A;
background: #FFF5F5;
}
.product-name {
font-size: 28rpx;
font-weight: bold;
color: #333;
}
.product-desc {
font-size: 22rpx;
color: #999;
margin-top: 8rpx;
}
.product-price {
font-size: 32rpx;
font-weight: bold;
color: #C41E3A;
}
/* 底部按钮 */
.modal-footer {
display: flex;
gap: 20rpx;
padding: 30rpx;
border-top: 1rpx solid #eee;
}
.modal-footer button {
flex: 1;
padding: 24rpx;
border-radius: 50rpx;
font-size: 28rpx;
}
.btn-outline {
background: #fff;
border: 2rpx solid #C41E3A;
color: #C41E3A;
}
.btn-primary {
background: linear-gradient(135deg, #C41E3A, #E74C3C);
color: #fff;
border: none;
}