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 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,18 @@
Component({
properties: {
id: String,
symbol: String,
direction: String,
entry_price: [String, Number],
status: String,
position_size: [String, Number],
pnl: Number,
},
methods: {
onTap() {
if (this.data.id) {
wx.navigateTo({ url: `/pages/trade-detail/trade-detail?id=${this.data.id}` });
}
},
},
});

View File

@@ -0,0 +1,14 @@
<view class="trade-item card" bindtap="onTap">
<view class="row">
<text class="symbol">{{symbol}}</text>
<text class="dir {{direction}}">{{direction === 'long' ? '多' : '空'}}</text>
</view>
<view class="row sub">
<text>入场 {{entry_price}}</text>
<text class="status-{{status}}">{{status === 'open' ? '持仓' : '已平'}}</text>
</view>
<view class="row sub" wx:if="{{pnl !== undefined}}">
<text>盈亏</text>
<text class="{{pnl >= 0 ? 'profit' : 'loss'}}">{{pnl >= 0 ? '+' : ''}}{{pnl}}</text>
</view>
</view>

View File

@@ -0,0 +1,9 @@
.trade-item { cursor: pointer; }
.trade-item .row { display: flex; justify-content: space-between; margin-bottom: 8rpx; }
.trade-item .symbol { font-weight: 600; color: #333; }
.trade-item .dir { font-size: 24rpx; }
.trade-item .dir.long { color: #5a9; }
.trade-item .dir.short { color: #95a; }
.trade-item .sub { font-size: 24rpx; color: #888; }
.trade-item .profit { color: #5a9; }
.trade-item .loss { color: #a44; }