fix: 卖出时输入框改用disabled禁止编辑,点击自动展开持仓列表

This commit is contained in:
claw_bot 2026-03-10 04:09:23 +00:00
parent b523346eaf
commit b400c4646d

View File

@ -164,9 +164,16 @@
v-model="transactionForm.stockCode"
class="form-input"
:placeholder="transactionType === 'sell' ? '请选择要卖出的持仓' : '请输入股票代码'"
:readonly="transactionType === 'sell'"
:disabled="transactionType === 'sell'"
@input="transactionType === 'buy' ? searchStock(e.detail.value) : () => {}"
@click="transactionType === 'sell' && searchResults.length > 0 ? () => {} : () => {}"
@click="transactionType === 'sell' ? (searchResults.length = positions.value.map(pos => ({
ticker: pos.stockCode,
stockName: pos.stockName,
assetType: pos.assetType || 'Stock',
currency: pos.currency,
amount: pos.amount,
exchange: ''
}))) : () => {}"
/>
<!-- 搜索下拉列表/持仓列表 -->
<view class="search-dropdown" v-if="searchResults.length > 0">