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); }, });