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,36 @@
Page({
data: {
id: '',
exit_price: '',
loading: false,
submitted: false,
pnlPct: 0,
violated: false,
score: 0,
aiSummary: '',
},
onLoad(opt: { id?: string }) {
this.setData({ id: opt.id || '' });
},
onExitInput(e: WechatMiniprogram.CustomEvent) {
this.setData({ exit_price: e.detail.value as string });
},
onSubmit() {
const exit = parseFloat(this.data.exit_price);
if (!exit) {
wx.showToast({ title: '请输入退出价', icon: 'none' });
return;
}
this.setData({ loading: true });
setTimeout(() => {
this.setData({
loading: false,
submitted: true,
pnlPct: 2.1,
violated: false,
score: 85,
aiSummary: '本次交易执行符合计划,止盈目标达成。建议继续保持当前风险控制节奏。',
});
}, 800);
},
});

View File

@@ -0,0 +1,16 @@
<view class="page">
<view class="card" wx:if="{{!submitted}}">
<view class="label">退出价</view>
<input class="input" type="digit" value="{{exit_price}}" bindinput="onExitInput" placeholder="输入实际退出价格" />
<button class="btn" bindtap="onSubmit" loading="{{loading}}">生成复盘</button>
</view>
<view class="card" wx:else>
<view class="row"><text class="label">盈亏 %</text><text class="{{pnlPct >= 0 ? 'profit' : 'loss'}}">{{pnlPct}}%</text></view>
<view class="row"><text class="label">是否违反止损</text><text>{{violated ? '是' : '否'}}</text></view>
<view class="row"><text class="label">纪律评分</text><text>{{score}}</text></view>
<view class="block">
<view class="label">AI 评语</view>
<text class="ai">{{aiSummary}}</text>
</view>
</view>
</view>

View File

@@ -0,0 +1,9 @@
.page { padding: 20rpx; }
.label { color: #888; margin-bottom: 12rpx; }
.input { width: 100%; padding: 20rpx; border: 1rpx solid #ddd; border-radius: 12rpx; box-sizing: border-box; margin-bottom: 24rpx; }
.btn { width: 100%; padding: 28rpx; background: #5a9; color: #fff; border-radius: 16rpx; border: none; }
.row { display: flex; justify-content: space-between; padding: 20rpx 0; border-bottom: 1rpx solid #eee; }
.profit { color: #5a9; }
.loss { color: #a44; }
.block { padding: 24rpx 0; }
.ai { font-size: 28rpx; color: #333; line-height: 1.6; }