|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="home g-flex">
|
|
|
+ <div ref="homeRef" class="home g-flex">
|
|
|
<router-view v-slot="{ Component }">
|
|
|
<RouterTransition :css="cssTransition">
|
|
|
<!-- 缓存所有组件 -->
|
|
|
@@ -14,16 +14,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, nextTick, watch, onMounted ,computed} from 'vue'
|
|
|
+import { shallowRef, nextTick, watch, onMounted, computed } from 'vue'
|
|
|
import { Tabbar } from '@mobile/components/base/tabbar/types'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useLoginStore } from '@/stores'
|
|
|
import AppTabbar from '@mobile/components/base/tabbar/index.vue'
|
|
|
import AppUpdater from '@mobile/components/base/updater/index.vue'
|
|
|
import RouterTransition from '@mobile/components/base/router-transition/index.vue'
|
|
|
+import eventBus from '@/services/bus'
|
|
|
|
|
|
const { route, routerTo } = useNavigation()
|
|
|
const loginStore = useLoginStore()
|
|
|
+const homeRef = shallowRef<HTMLDivElement>()
|
|
|
const cssTransition = shallowRef(true) // 是否使用css动画
|
|
|
const currentTab = shallowRef(0)
|
|
|
|
|
|
@@ -65,6 +67,18 @@ const onTabClick = (index: number) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 接收行情服务连接状态通知
|
|
|
+eventBus.$on('QuoteServerStatusNotify', (status) => {
|
|
|
+ const el = homeRef.value?.querySelector('.app-tabbar__item--home-market .app-iconfont__label') as HTMLSpanElement
|
|
|
+ if (el) {
|
|
|
+ if (status) {
|
|
|
+ el.style.removeProperty('text-decoration')
|
|
|
+ } else {
|
|
|
+ el.style.setProperty('text-decoration', 'underline')
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
watch(() => route.name, () => {
|
|
|
if (tabIndex.value > -1) {
|
|
|
cssTransition.value = false
|