ui: 暗色金融风重构 + 自定义货币选择器
- 深色主题:深蓝背景 + 毛玻璃卡片 + 金色结果数字 - 自定义底部弹窗货币选择器,替换原生白色 Picker - 换算卡片内容居中竖排布局 - 汇率信息条改为竖排独立卡片 - 实时脉冲徽章 + 蓝紫渐变互换按钮 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,76 +1,84 @@
|
||||
<view class="container">
|
||||
<!-- 顶部标题区 -->
|
||||
<!-- 顶部 -->
|
||||
<view class="hero">
|
||||
<view class="hero-title">💱 汇率换算</view>
|
||||
<view class="hero-desc" wx:if="{{updatedAt}}">{{updatedAt}} 更新</view>
|
||||
<view class="hero-desc" wx:if="{{loading}}">正在获取最新汇率...</view>
|
||||
<view class="hero-row">
|
||||
<view class="hero-title">汇率换算</view>
|
||||
<view class="hero-badge" wx:if="{{!loading}}">
|
||||
<view class="badge-dot"></view>
|
||||
<text class="badge-text">实时</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hero-desc" wx:if="{{updatedAt}}">{{updatedAt}}</view>
|
||||
<view class="hero-desc" wx:if="{{loading}}">正在同步汇率数据...</view>
|
||||
</view>
|
||||
|
||||
<!-- 换算主卡片 -->
|
||||
<view class="card converter-card">
|
||||
<!-- 源币种 -->
|
||||
<view class="currency-block from-block">
|
||||
<picker range="{{pickerData}}" value="{{fromIndex}}" bindchange="handleFromChange">
|
||||
<view class="currency-tag">
|
||||
<text class="currency-tag-text">{{pickerData[fromIndex]}}</text>
|
||||
<text class="tag-arrow">▼</text>
|
||||
</view>
|
||||
</picker>
|
||||
<text class="block-label">从</text>
|
||||
<view class="currency-chip" bindtap="openFromPicker">
|
||||
<text class="chip-text">{{pickerData[fromIndex]}}</text>
|
||||
<text class="chip-arrow">›</text>
|
||||
</view>
|
||||
<input
|
||||
class="amount-input"
|
||||
type="digit"
|
||||
value="{{amount}}"
|
||||
bindinput="handleAmountInput"
|
||||
placeholder="输入金额"
|
||||
placeholder="0.00"
|
||||
placeholder-class="amount-placeholder"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 互换按钮 -->
|
||||
<view class="swap-wrapper">
|
||||
<view class="swap-line"></view>
|
||||
<view class="swap-btn" bindtap="handleSwap">
|
||||
<!-- 互换 -->
|
||||
<view class="swap-zone" bindtap="handleSwap">
|
||||
<view class="swap-track"></view>
|
||||
<view class="swap-btn">
|
||||
<text class="swap-icon">⇅</text>
|
||||
</view>
|
||||
<view class="swap-line"></view>
|
||||
<view class="swap-track"></view>
|
||||
</view>
|
||||
|
||||
<!-- 目标币种 -->
|
||||
<view class="currency-block to-block">
|
||||
<picker range="{{pickerData}}" value="{{toIndex}}" bindchange="handleToChange">
|
||||
<view class="currency-tag">
|
||||
<text class="currency-tag-text">{{pickerData[toIndex]}}</text>
|
||||
<text class="tag-arrow">▼</text>
|
||||
</view>
|
||||
</picker>
|
||||
<view class="result-display">{{result || '—'}}</view>
|
||||
<text class="block-label">到</text>
|
||||
<view class="currency-chip" bindtap="openToPicker">
|
||||
<text class="chip-text">{{pickerData[toIndex]}}</text>
|
||||
<text class="chip-arrow">›</text>
|
||||
</view>
|
||||
<view class="result-amount">{{result || '0.00'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 单位汇率卡片 -->
|
||||
<view class="card rate-card" wx:if="{{unitRate}}">
|
||||
<view class="rate-row">
|
||||
<text class="rate-dot from-dot"></text>
|
||||
<!-- 汇率信息 -->
|
||||
<view class="rate-list" wx:if="{{unitRate}}">
|
||||
<view class="card rate-item">
|
||||
<text class="rate-text">{{unitRate}}</text>
|
||||
</view>
|
||||
<view class="rate-row">
|
||||
<text class="rate-dot to-dot"></text>
|
||||
<view class="card rate-item">
|
||||
<text class="rate-text">{{reverseRate}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 错误提示 -->
|
||||
<!-- 错误 -->
|
||||
<view class="card error-card" wx:if="{{error}}">
|
||||
<text class="error-icon">⚠</text>
|
||||
<text class="error-text">{{error}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 汇率总览入口 -->
|
||||
<view class="card overview-entry" bindtap="goOverview">
|
||||
<view class="overview-left">
|
||||
<text class="overview-icon">📊</text>
|
||||
<text class="overview-label">查看汇率总览</text>
|
||||
<!-- 总览入口 -->
|
||||
<view class="overview-btn" bindtap="goOverview">
|
||||
<view class="overview-inner">
|
||||
<text class="overview-label">查看全部汇率</text>
|
||||
<text class="overview-arrow">→</text>
|
||||
</view>
|
||||
<text class="overview-arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<currency-picker
|
||||
show="{{showPicker}}"
|
||||
list="{{pickerData}}"
|
||||
current="{{pickerTarget === 'from' ? fromIndex : toIndex}}"
|
||||
bind:select="handlePickerSelect"
|
||||
bind:close="handlePickerClose"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user