1
李凌
5 days ago 349c48e168b9f2580334422228acde7d1b21bede
src/views/cryptos/PerpetualContract/index.vue
@@ -257,7 +257,7 @@
        deep: null /// 深度
      },
      curTab: '', // 当前委托还是持有仓位
      selectIndex: 1, // 当前tab
      selectIndex: 2, // 当前tab(仅AI量化)
      initFutrue: {}, /// 交割合约
      show: false, // popup
      animated1: false,
@@ -397,12 +397,13 @@
        })
      }
    },
    onTopTab(evt) { // 当前tab 永续/交割(页内切换,同步 URL 供底部栏高亮)
      this.syncContractTab(evt, true)
      if (String(this.$route.query.selectIndex) !== String(evt)) {
    onTopTab(evt) { // 仅AI量化
      const tab = Number(evt) === 1 ? 2 : Number(evt)
      this.syncContractTab(tab, true)
      if (String(this.$route.query.selectIndex) !== String(tab)) {
        this.$router.replace({
          path: this.$route.path,
          query: { ...this.$route.query, selectIndex: String(evt) }
          query: { ...this.$route.query, selectIndex: String(tab) }
        }).catch(() => {})
      }
    },
@@ -683,16 +684,10 @@
    }
    if (symbol) {
      next(vm => {
        if (selectIndex) {
          vm.selectIndex = Number(selectIndex)
          if (vm.selectIndex === 2) {
            vm.curTab = 'fetchFutrueHoldList'
          } else {
            vm.curTab = 'fetchOrderListHold'
          }
        } else {
          vm.curTab = 'fetchOrderListHold'
        }
        let idx = selectIndex ? Number(selectIndex) : 2
        if (idx === 1) idx = 2
        vm.selectIndex = idx
        vm.curTab = 'fetchFutrueHoldList'
        vm.symbol = symbol
        vm.init(symbol)
      })
@@ -703,7 +698,8 @@
  beforeRouteUpdate(to, from, next) {
    const selectIndex = to.query.selectIndex
    if (selectIndex !== undefined && selectIndex !== null && selectIndex !== '') {
      const idx = Number(selectIndex)
      let idx = Number(selectIndex)
      if (idx === 1) idx = 2
      if (this.selectIndex !== idx) {
        this.syncContractTab(idx, true)
      }