From f1aaecc9dc0a3d680f2f693ee963d5d060e75734 Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Fri, 09 Jan 2026 16:18:43 +0800
Subject: [PATCH] 1
---
src/page/home/Subscription.vue | 60 ++++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/src/page/home/Subscription.vue b/src/page/home/Subscription.vue
index 0e62fa3..f218d4d 100644
--- a/src/page/home/Subscription.vue
+++ b/src/page/home/Subscription.vue
@@ -7,23 +7,23 @@
title-inactive-color="#ffffff" title-active-color="#ffffff"
background="transparent">
<van-tab :title="$t('hj45')" name="1"></van-tab>
- <van-tab :title="$t('jy189')" name="2"></van-tab>
- <van-tab :title="$t('jy187')" name="3"></van-tab>
+ <!-- <van-tab :title="$t('jy189')" name="2"></van-tab> -->
+ <!-- <van-tab :title="$t('jy187')" name="3"></van-tab> -->
<!-- <van-tab title="新债配售" name="4"></van-tab> -->
- <van-tab :title="$t('jy86')" name="4"></van-tab>
- <van-tab :title="$t('jy188')" name="5"></van-tab>
+ <van-tab v-if="isdisplay" :title="$t('jy86')" name="4"></van-tab>
+ <!-- <van-tab :title="$t('jy188')" name="5"></van-tab> -->
</van-tabs>
</div>
<div class="suo" @click="getsearch"><a class="tr"></a></div>
</div>
<div>
<div class="xuanhze">
- <xingusg v-if="tabactive == 1"></xingusg>
- <xinguqc v-if="tabactive == 2"></xinguqc>
- <xinzhaisg v-if="tabactive == 3"></xinzhaisg>
- <!-- <xinzhaips v-if="tabactive == 4"></xinzhaips> -->
- <dazongjiaoyi v-if="(tabactive == 4)"></dazongjiaoyi>
- <vipqiangchou v-if="(tabactive == 5)"></vipqiangchou>
+ <xingusg v-if="tabactive == '1'"></xingusg>
+ <xinguqc v-if="tabactive == '2'"></xinguqc>
+ <xinzhaisg v-if="tabactive == '3'"></xinzhaisg>
+ <!-- <xinzhaips v-if="tabactive == '4'"></xinzhaips> -->
+ <dazongjiaoyi v-if="tabactive == '4'"></dazongjiaoyi>
+ <vipqiangchou v-if="tabactive == '5'"></vipqiangchou>
</div>
</div>
</div>
@@ -48,13 +48,49 @@
props: {},
data() {
return {
- tabactive: 1,
+ tabactive: "1",
+ isdisplay: false,
+
}
},
mounted() {
- this.tabactive = this.$route.query.idx
+ this.initTab();
+ this.getstockDzDisplay();
+ },
+ watch: {
+ '$route'(to, from) {
+ this.initTab();
+ },
+ 'isdisplay'(newVal) {
+ // 当 isdisplay 变为 true 后,如果当前 tabactive 是 4,需要重新设置以确保正确选中
+ if (newVal) {
+ this.$nextTick(() => {
+ const idx = this.$route.query.idx;
+ if (idx) {
+ this.tabactive = String(idx);
+ }
+ });
+ }
+ }
},
methods: {
+ initTab() {
+ const idx = this.$route.query.idx;
+ this.tabactive = idx ? String(idx) : "1";
+ },
+ async getstockDzDisplay(){
+ let data = await api.stockDzDisplay();
+ this.isdisplay = data.data;
+ // 接口返回后,使用 nextTick 确保 DOM 更新完成后再设置 tabactive
+ if (this.isdisplay) {
+ this.$nextTick(() => {
+ const idx = this.$route.query.idx;
+ if (idx) {
+ this.tabactive = String(idx);
+ }
+ });
+ }
+ },
getNewsList() {
},
--
Gitblit v1.9.3