From 349c48e168b9f2580334422228acde7d1b21bede Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Fri, 05 Jun 2026 11:19:15 +0800
Subject: [PATCH] 1

---
 src/components/Transform/contract-header/index.vue |   36 +++++++++++++++++++++---------------
 1 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/src/components/Transform/contract-header/index.vue b/src/components/Transform/contract-header/index.vue
index 1d305d8..b3c83fe 100644
--- a/src/components/Transform/contract-header/index.vue
+++ b/src/components/Transform/contract-header/index.vue
@@ -22,13 +22,9 @@
                             @click="jump" />
                     </div> -->
         </div>
-        <div class="flex justify-between  pt-34">
-          <button class="tabBtn w-368 h-74 lh-74 border-none  rounded"
-            :class="selectIndex == 1 ? 'select-active' : 'no-select'" @click="changeTab(1)">
-            {{ $t('永续合约') }}</button>
-          <button class="tabBtn w-368 h-74 lh-74 border-none  rounded"
-            :class="selectIndex == 2 ? 'select-one-active' : 'no-select'" @click="changeTab(2)">
-            {{ queryType == 'cryptos' ? $t('交割合约') : $t('期货交易') }}</button>
+        <div class="flex justify-center pt-34">
+          <button class="tabBtn w-368 h-74 lh-74 border-none rounded select-one-active">
+            {{ queryType == 'cryptos' ? $t('AI量化') : $t('期货交易') }}</button>
         </div>
       </div>
     </div>
@@ -66,7 +62,7 @@
                 alt="logo" class="w-24 h-24 rounded-full mr-8" />
               {{ item.name }}
             </div>
-            <div class="text-grey mt-10 font-28">{{ selectIndex == 1 ? $t('永续') : $t('交割') }}</div>
+            <div class="text-grey mt-10 font-28">{{ queryType == 'cryptos' ? $t('AI量化') : $t('交割') }}</div>
           </div>
           <div class="text-right">
             <div class="textColor font-28">{{ item.close }}</div>
@@ -125,7 +121,7 @@
   computed: {
     ...mapGetters({ coinList: 'home/coinList' }),
     title() {
-      return [this.$t('永续'), this.$t('交割')][this.selectIndex - 1]
+      return this.queryType == 'cryptos' ? this.$t('AI量化') : this.$t('期货交易')
     }
   },
   data() {
@@ -155,10 +151,21 @@
   },
   methods: {
     onRoute(item) {
-      if (this.$route.params.symbol !== item.symbol) {
-        this.$router.push(`/cryptos/perpetualContract/${item.symbol}?type=${this.queryType}`)
+      if (this.symbol === item.symbol) {
+        this.show = false
+        return
+      }
+      setStorage('symbol', item.symbol)
+      const selectIndex = 2
+      if (this.$route.name === 'tradeIndex' || this.$route.path.startsWith('/trade/index')) {
+        this.$router.push({
+          path: '/trade/index',
+          query: { ...this.$route.query, selectIndex: String(selectIndex) }
+        })
         this.$emit('update-coin', item.symbol)
-        setStorage('symbol', item.symbol)
+      } else {
+        this.$router.push(`/cryptos/perpetualContract/${item.symbol}?type=${this.queryType}&selectIndex=${selectIndex}`)
+        this.$emit('update-coin', item.symbol)
         this.$forceUpdate()
       }
       this.show = false
@@ -205,9 +212,8 @@
     klineJump() {
       this.$router.push(`/cryptos/trendDetails/${this.symbol}?type=${this.queryType}`)
     },
-    changeTab(index) {
-      this.$emit('tab', index)
-      // this.selectIndex2 = index;
+    changeTab() {
+      this.$emit('tab', 2)
     },
     // onSearch: debounce(function (e) {
     //   console.log("e", this.popupSearch);

--
Gitblit v1.9.3