fix: 修复编译错误
- config.vue: 删除重复的 onStrategyChange 声明 - detail.vue: 简化小程序中的input组件,去掉复杂样式和事件
This commit is contained in:
parent
5671f7a618
commit
a76325882b
@ -342,33 +342,6 @@ const fetchStrategies = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const onStrategyChange = (e) => {
|
||||
strategyIndex.value = e.detail.value;
|
||||
const strategy = strategies.value[strategyIndex.value];
|
||||
|
||||
console.log('选择的策略:', strategy);
|
||||
console.log('策略参数:', strategy?.parameters);
|
||||
|
||||
if (strategy && strategy.parameters && strategy.parameters.assets) {
|
||||
console.log('找到assets,开始填充:', strategy.parameters.assets);
|
||||
form.value.stocks = strategy.parameters.assets.map(asset => ({
|
||||
name: asset.symbol,
|
||||
price: '',
|
||||
amount: '',
|
||||
date: ''
|
||||
}));
|
||||
console.log('填充后的form.stocks:', form.value.stocks);
|
||||
} else {
|
||||
console.log('条件判断失败:', {
|
||||
hasStrategy: !!strategy,
|
||||
hasParameters: !!(strategy && strategy.parameters),
|
||||
hasAssets: !!(strategy && strategy.parameters && strategy.parameters.assets)
|
||||
});
|
||||
form.value.stocks = [{ name: '', price: '', amount: '', date: '' }];
|
||||
console.log('未找到标的配置,使用默认值');
|
||||
}
|
||||
};
|
||||
|
||||
const onDateChange = (e, index) => {
|
||||
form.value.stocks[index].date = e.detail.value;
|
||||
};
|
||||
|
||||
@ -271,11 +271,8 @@
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<input
|
||||
v-model="transactionForm.stockCode"
|
||||
class="stock-input"
|
||||
:placeholder="transactionType === 'sell' ? '点击选择要卖出的持仓' : '请输入股票代码搜索'"
|
||||
:disabled="transactionType === 'sell'"
|
||||
@input="onStockInput"
|
||||
@click="handleStockInputClick"
|
||||
placeholder="请输入股票代码"
|
||||
disabled
|
||||
/>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 || APP-PLUS -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user