Initial commit
Made-with: Cursor
This commit is contained in:
21
srde/miniprogram/pages/trade-detail/trade-detail.ts
Normal file
21
srde/miniprogram/pages/trade-detail/trade-detail.ts
Normal 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 });
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user