fix: 修复编译错误

- config.vue: 删除重复的 onStrategyChange 声明
- detail.vue: 简化小程序中的input组件,去掉复杂样式和事件
This commit is contained in:
claw_bot 2026-03-13 08:09:36 +00:00
parent 5671f7a618
commit a76325882b
2 changed files with 2 additions and 32 deletions

View File

@ -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) => { const onDateChange = (e, index) => {
form.value.stocks[index].date = e.detail.value; form.value.stocks[index].date = e.detail.value;
}; };

View File

@ -271,11 +271,8 @@
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<input <input
v-model="transactionForm.stockCode" v-model="transactionForm.stockCode"
class="stock-input" placeholder="请输入股票代码"
:placeholder="transactionType === 'sell' ? '点击选择要卖出的持仓' : '请输入股票代码搜索'" disabled
:disabled="transactionType === 'sell'"
@input="onStockInput"
@click="handleStockInputClick"
/> />
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 || APP-PLUS --> <!-- #ifdef H5 || APP-PLUS -->