22 lines
609 B
TypeScript
22 lines
609 B
TypeScript
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 });
|
|
},
|
|
});
|