ui: 暗色金融风重构 + 自定义货币选择器

- 深色主题:深蓝背景 + 毛玻璃卡片 + 金色结果数字
- 自定义底部弹窗货币选择器,替换原生白色 Picker
- 换算卡片内容居中竖排布局
- 汇率信息条改为竖排独立卡片
- 实时脉冲徽章 + 蓝紫渐变互换按钮

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
manpengan
2026-03-18 18:19:02 +08:00
parent 92304d4fa2
commit 2516cc2085
14 changed files with 543 additions and 311 deletions

View File

@@ -0,0 +1,24 @@
Component({
properties: {
show: { type: Boolean, value: false },
list: { type: Array, value: [] },
current: { type: Number, value: 0 },
},
methods: {
handleSelect(e) {
const index = e.currentTarget.dataset.index;
this.triggerEvent('select', { value: index });
},
handleClose() {
this.triggerEvent('close');
},
handleMaskTap() {
this.triggerEvent('close');
},
preventBubble() {},
},
});

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,20 @@
<view class="picker-mask" wx:if="{{show}}" bindtap="handleMaskTap">
<view class="picker-sheet" catchtap="preventBubble">
<view class="sheet-header">
<text class="sheet-title">选择货币</text>
<text class="sheet-close" bindtap="handleClose">✕</text>
</view>
<scroll-view class="sheet-scroll" scroll-y enhanced show-scrollbar="{{false}}">
<view
class="sheet-item {{index === current ? 'sheet-item-active' : ''}}"
wx:for="{{list}}"
wx:key="index"
data-index="{{index}}"
bindtap="handleSelect"
>
<text class="item-text">{{item}}</text>
<text class="item-check" wx:if="{{index === current}}">✓</text>
</view>
</scroll-view>
</view>
</view>

View File

@@ -0,0 +1,84 @@
.picker-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 1000;
display: flex;
align-items: flex-end;
}
.picker-sheet {
width: 100%;
max-height: 70vh;
background: #1E293B;
border-top-left-radius: 36rpx;
border-top-right-radius: 36rpx;
border-top: 2rpx solid rgba(148, 163, 184, 0.15);
padding-bottom: env(safe-area-inset-bottom);
}
.sheet-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 36rpx 40rpx 24rpx;
border-bottom: 2rpx solid rgba(148, 163, 184, 0.08);
}
.sheet-title {
font-size: 34rpx;
font-weight: 700;
color: #F1F5F9;
letter-spacing: 2rpx;
}
.sheet-close {
font-size: 32rpx;
color: #64748B;
width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: rgba(148, 163, 184, 0.08);
}
.sheet-scroll {
max-height: 56vh;
padding: 12rpx 0;
}
.sheet-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 28rpx 40rpx;
margin: 0 16rpx;
border-radius: 16rpx;
}
.sheet-item-active {
background: rgba(99, 102, 241, 0.12);
border: 2rpx solid rgba(99, 102, 241, 0.25);
}
.item-text {
font-size: 30rpx;
color: #CBD5E1;
font-weight: 500;
}
.sheet-item-active .item-text {
color: #A5B4FC;
font-weight: 600;
}
.item-check {
font-size: 30rpx;
color: #818CF8;
font-weight: 700;
}