From 03043192ddf00f9a36b7454799a9152cd1b50a0b Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Tue, 06 Jan 2026 11:13:45 +0800
Subject: [PATCH] 1
---
src/views/quotes/List.vue | 63 ++++++++++++++++++-------------
1 files changed, 37 insertions(+), 26 deletions(-)
diff --git a/src/views/quotes/List.vue b/src/views/quotes/List.vue
index 7c203da..e7fc0bd 100644
--- a/src/views/quotes/List.vue
+++ b/src/views/quotes/List.vue
@@ -13,8 +13,8 @@
</header>
<section class="quotes-tab-container">
<van-tabs v-model:active="tabActive" shrink @click-tab="onClickTab">
- <van-tab v-for="(item, index) in listTab" :key="item.tabIndex" :name="item.tabIndex" :title="item.title">
- <component @changeLetMego="handleChangeLetMego" :index="item.tabIndex" :tabActive="tabActive"
+ <van-tab v-for="(item) in listTab" :key="item.tabIndex" :name="item.tabIndex" :title="item.title">
+ <component v-if="item.tabIndex == tabActive" @changeLetMego="handleChangeLetMego" :index="item.tabIndex" :tabActive="tabActive"
:is="components.get(item.type)" :key="item.tabIndex" ref="tabRefs" />
</van-tab>
</van-tabs>
@@ -54,13 +54,11 @@
const thStore = themeStore()
-
const { t } = useI18n()
-
const router = useRouter()
const route = useRoute()
-const tabActive = ref(0)
+const tabActive = ref(8)
const TITLE = import.meta.env.VITE_APP__TITLE
const showSave = ref(false)
const searchSrc = new URL(`../../assets/theme/${thStore.theme}/image/search.png`, import.meta.url)
@@ -124,11 +122,11 @@
)
const listTab = ref([
{
- title: 'ETF',
- type: 'Etf',
- urlMatch: 'etf',
- symbolType: 'indices',
- tabIndex: 8
+ title: t('UsStocks'),
+ type: 'UsStock',
+ urlMatch: 'stock',
+ symbolType: 'US-stocks',
+ tabIndex: 3
},
{
title: t('加密货币'),
@@ -137,6 +135,13 @@
symbolType: 'cryptos',
tabIndex: 1
},
+ {
+ title: 'ETF',
+ type: 'Etf',
+ urlMatch: 'etf',
+ symbolType: 'indices',
+ tabIndex: 8
+ },
// {
// title: t('印度股'),
// type: 'INDIAStock',
@@ -144,20 +149,13 @@
// symbolType: 'INDIA-stocks',
// tabIndex: 0
// },
- {
- title: t('UsStocks'),
- type: 'UsStock',
- urlMatch: 'stock',
- symbolType: 'US-stocks',
- tabIndex: 3
- },
- {
- title: t('港股'),
- type: 'HkStock',
- urlMatch: 'HK-stocks',
- symbolType: 'HK-stocks',
- tabIndex: 4
- },
+ // {
+ // title: t('港股'),
+ // type: 'HkStock',
+ // urlMatch: 'HK-stocks',
+ // symbolType: 'HK-stocks',
+ // tabIndex: 4
+ // },
// {
// title: t('台股'),
// type: 'TWStock',
@@ -275,7 +273,6 @@
return relUrl;
}
-
const closeSaveBox = () => {
setStorage(`${TITLE}addtoClosed`, 1)
showSave.value = false
@@ -308,10 +305,24 @@
}, TIME_OUT)
const onClickTab = ({ name, title }) => {
- console.log('name', name)
+ // console.log('name', name)
if (tabActive.value !== name) {
letMeGo.value = () => { }
}
+ // 如果切换到 name 是 3,停止 timer 轮询
+ if (name === 3) {
+ if (timer) {
+ clearInterval(timer)
+ timer = null
+ }
+ } else {
+ // 如果不是 3 并且 timer 没有轮询,则继续轮询
+ if (!timer) {
+ timer = setInterval(() => {
+ letMeGo.value()
+ }, TIME_OUT)
+ }
+ }
tabActive.value = name
router.push('/quotes/index?tabActive=' + tabActive.value)
};
--
Gitblit v1.9.3