Prechádzať zdrojové kódy

feat: tab高亮处理

longyang 3 týždňov pred
rodič
commit
7eb64448c6

+ 6 - 2
src/components/NewUserGuide/steps/CouponGuide.vue

@@ -66,8 +66,12 @@ export default {
   },
   methods: {
     handleGoCoupon() {
-      this.$router.push('/myCenter')
-      setTimeout(() => this.$emit('next'), 500)
+      setTab('welfare')
+      // 先跳首页再跳 myCenter,确保组件重新 created 读取 Cookie
+      this.$router.push('/home').then(() => {
+        this.$router.push('/myCenter')
+      })
+      setTimeout(() => this.$emit('next'), 800)
     },
   },
 }

+ 6 - 2
src/components/NewUserGuide/steps/ExchangeGuide.vue

@@ -60,8 +60,12 @@ export default {
   },
   methods: {
     handleGoExchange() {
-      this.$router.push('/myCenter')
-      setTimeout(() => this.$emit('next'), 500)
+      setTab('exchange')
+      // 先跳首页再跳 myCenter,确保组件重新 created 读取 Cookie
+      this.$router.push('/home').then(() => {
+        this.$router.push('/myCenter')
+      })
+      setTimeout(() => this.$emit('next'), 800)
     },
   },
 }

+ 3 - 0
src/components/NewUserGuide/steps/ProfileGuide.vue

@@ -39,6 +39,8 @@
 </template>
 
 <script>
+import { setTab } from '@/utils/auth'
+
 export default {
   name: 'ProfileGuide',
   props: {
@@ -56,6 +58,7 @@ export default {
   },
   methods: {
     handleGoProfile() {
+      setTab('integral')
       this.$router.push('/myCenter')
       setTimeout(() => this.$emit('next'), 500)
     },