diff --git a/pages/config/config.vue b/pages/config/config.vue
index 4634b9e..7225e4c 100644
--- a/pages/config/config.vue
+++ b/pages/config/config.vue
@@ -66,8 +66,11 @@
:key="idx"
@click="selectStock(result)"
>
- {{ result.Ticker }}
- {{ result.Exchange }}
+
+ {{ result.ticker }}
+ {{ result.assetType }}
+
+ {{ result.exchange }}
@@ -134,7 +137,7 @@ const searchStock = async (keyword, stockIndex) => {
// 赋值当前激活的搜索下标
activeSearchIndex.value = stockIndex;
- if (!keyword || keyword.length < 2) {
+ if (!keyword || keyword.length < 1) {
searchResults.value = [];
activeSearchIndex.value = -1;
return;
@@ -160,7 +163,10 @@ const searchStock = async (keyword, stockIndex) => {
const selectStock = (result) => {
const stock = form.value.stocks[result.stockIndex];
if (stock) {
- stock.name = result.Ticker;
+ stock.name = result.ticker;
+ // 可以在这里额外保存资产类型等信息
+ stock.assetType = result.assetType;
+ stock.currency = result.priceCurrency;
}
searchResults.value = [];
activeSearchIndex.value = -1;
@@ -514,12 +520,27 @@ onShow(async () => {
background-color: #F3F4F6;
}
+.item-left {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ gap: 12rpx;
+}
+
.item-ticker {
font-size: 26rpx;
font-weight: 600;
color: #1F2937;
}
+.item-type {
+ font-size: 18rpx;
+ color: #064E3B;
+ background-color: #D1FAE5;
+ padding: 2rpx 8rpx;
+ border-radius: 4rpx;
+}
+
.item-exchange {
font-size: 22rpx;
color: #9CA3AF;