10.10综合交易所原始源码_移动端
admin
2026-01-06 42faef34194c466f03e29d75a63ae502e4213044
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) in listTab" :key="item.tabIndex" :name="item.tabIndex" :title="item.title">
            <component v-if="item.tabIndex == tabActive" @changeLetMego="handleChangeLetMego" :index="item.tabIndex" :tabActive="tabActive"
          <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"
              :is="components.get(item.type)" :key="item.tabIndex" ref="tabRefs" />
          </van-tab>
        </van-tabs>
@@ -54,11 +54,13 @@
const thStore = themeStore()
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
const tabActive = ref(8)
const tabActive = ref(0)
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)
@@ -122,11 +124,11 @@
)
const listTab = ref([
  {
    title: t('UsStocks'),
    type: 'UsStock',
    urlMatch: 'stock',
    symbolType: 'US-stocks',
    tabIndex: 3
    title: 'ETF',
    type: 'Etf',
    urlMatch: 'etf',
    symbolType: 'indices',
    tabIndex: 8
  },
  {
    title: t('加密货币'),
@@ -135,13 +137,6 @@
    symbolType: 'cryptos',
    tabIndex: 1
  },
  {
    title: 'ETF',
    type: 'Etf',
    urlMatch: 'etf',
    symbolType: 'indices',
    tabIndex: 8
  },
  // {
  //   title: t('印度股'),
  //   type: 'INDIAStock',
@@ -149,13 +144,20 @@
  //   symbolType: 'INDIA-stocks',
  //   tabIndex: 0
  // },
  // {
  //   title: t('港股'),
  //   type: 'HkStock',
  //   urlMatch: 'HK-stocks',
  //   symbolType: 'HK-stocks',
  //   tabIndex: 4
  // },
  {
    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: 'TWStock',
@@ -273,6 +275,7 @@
  return relUrl;
}
const closeSaveBox = () => {
  setStorage(`${TITLE}addtoClosed`, 1)
  showSave.value = false
@@ -305,23 +308,9 @@
}, 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)