Initial commit

Made-with: Cursor
This commit is contained in:
Daniel
2026-02-28 18:39:00 +08:00
commit a94bd44c3a
49 changed files with 917 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "交易详情"
}

View File

@@ -0,0 +1,21 @@
import { mockTrades } from '../../services/api';
Page({
data: { trade: null as any },
onLoad(opt: { id?: string }) {
const id = opt.id;
const t = mockTrades.find((x: any) => x.id === id) || mockTrades[0];
this.setData({
trade: {
...t,
take_profit: (t as any).entry_price * 1.02,
stop_loss: (t as any).entry_price * 0.98,
position_size: 0.5,
logic: '示例交易逻辑文本,用于展示交易计划的结构与内容。',
},
});
},
onClose() {
wx.navigateTo({ url: '/pages/review/review?id=' + this.data.trade.id });
},
});

View File

@@ -0,0 +1,15 @@
<view class="page" wx:if="{{trade}}">
<view class="card">
<view class="row"><text class="label">标的</text><text>{{trade.symbol}}</text></view>
<view class="row"><text class="label">方向</text><text>{{trade.direction === 'long' ? '多' : '空'}}</text></view>
<view class="row"><text class="label">入场价</text><text>{{trade.entry_price}}</text></view>
<view class="row"><text class="label">目标价</text><text>{{trade.take_profit}}</text></view>
<view class="row"><text class="label">止损价</text><text>{{trade.stop_loss}}</text></view>
<view class="row"><text class="label">建议仓位</text><text>{{trade.position_size}}</text></view>
<view class="row"><text class="label">逻辑</text><text class="logic">{{trade.logic || '-'}}</text></view>
</view>
<view class="section" wx:if="{{trade.status === 'open'}}">
<button class="btn-danger" bindtap="onClose">关闭交易</button>
</view>
</view>
<view wx:else class="loading">加载中...</view>

View File

@@ -0,0 +1,6 @@
.page { padding: 20rpx; }
.row { display: flex; justify-content: space-between; padding: 20rpx 0; border-bottom: 1rpx solid #eee; }
.row .label { color: #888; }
.logic { flex: 1; margin-left: 24rpx; word-break: break-all; }
.btn-danger { width: 100%; padding: 28rpx; background: #a44; color: #fff; border-radius: 16rpx; border: none; }
.loading { padding: 80rpx; text-align: center; color: #888; }