|
@@ -13,7 +13,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, nextTick, watch, onMounted } from 'vue'
|
|
|
|
|
|
|
+import { shallowRef, nextTick, watch, onMounted,computed } from 'vue'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { versionToNumber } from '@/filters'
|
|
import { versionToNumber } from '@/filters'
|
|
|
import { Tabbar } from '@mobile/components/base/tabbar/types'
|
|
import { Tabbar } from '@mobile/components/base/tabbar/types'
|
|
@@ -31,6 +31,8 @@ const loginStore = useLoginStore()
|
|
|
const cssTransition = shallowRef(true) // 是否使用css动画
|
|
const cssTransition = shallowRef(true) // 是否使用css动画
|
|
|
const currentTab = shallowRef(0)
|
|
const currentTab = shallowRef(0)
|
|
|
|
|
|
|
|
|
|
+const tabIndex = computed(() => tabList.findIndex((e) => e.name === route.name))
|
|
|
|
|
+
|
|
|
const tabList: Tabbar[] = [
|
|
const tabList: Tabbar[] = [
|
|
|
{
|
|
{
|
|
|
name: 'home-index',
|
|
name: 'home-index',
|
|
@@ -86,9 +88,7 @@ const onTabClick = (index: number) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- const { tabIndex } = getGlobalUrlParams()
|
|
|
|
|
- currentTab.value = tabIndex > -1 ? tabIndex : tabList.findIndex((e) => e.name === route.name)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ currentTab.value = tabIndex.value
|
|
|
const os = plus.getSystemInfo('os')
|
|
const os = plus.getSystemInfo('os')
|
|
|
const currentVersion = plus.getSystemInfo('version')
|
|
const currentVersion = plus.getSystemInfo('version')
|
|
|
const currentVersionCode = plus.getSystemInfo('versionCode')
|
|
const currentVersionCode = plus.getSystemInfo('versionCode')
|
|
@@ -151,9 +151,11 @@ onMounted(() => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
watch(() => route.name, () => {
|
|
watch(() => route.name, () => {
|
|
|
- const { tabIndex } = getGlobalUrlParams()
|
|
|
|
|
- if (tabIndex > -1) {
|
|
|
|
|
- onTabClick(tabIndex)
|
|
|
|
|
|
|
+ const params = getGlobalUrlParams()
|
|
|
|
|
+ if (params.tabIndex > -1) {
|
|
|
|
|
+ onTabClick(params.tabIndex)
|
|
|
|
|
+ } else if (tabIndex.value > -1) {
|
|
|
|
|
+ onTabClick(tabIndex.value)
|
|
|
} else {
|
|
} else {
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
cssTransition.value = true
|
|
cssTransition.value = true
|