|
|
@@ -15,7 +15,7 @@
|
|
|
<ion-tab-button tab="rank" href="/rank">
|
|
|
<img :src="tabIconRank" class="tab-icon" alt="" />
|
|
|
</ion-tab-button>
|
|
|
- <ion-tab-button tab="distribution" href="/distribution">
|
|
|
+ <ion-tab-button tab="distribution" href="/distribution1">
|
|
|
<ion-icon :icon="activeTab === 'distribution' ? tabIconProfitPre : tabIconProfit" />
|
|
|
<ion-label>{{ $t('common.profit') }}</ion-label>
|
|
|
</ion-tab-button>
|
|
|
@@ -27,8 +27,8 @@
|
|
|
</ion-tabs>
|
|
|
</ion-page>
|
|
|
</template>
|
|
|
-<script>
|
|
|
-import { defineComponent, ref } from 'vue'
|
|
|
+<script setup>
|
|
|
+import { ref } from 'vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import tabIconHome from '@/assets/tabbar_icon_home.svg'
|
|
|
import tabIconHomePre from '@/assets/tabbar_icon_home_pre.svg'
|
|
|
@@ -40,55 +40,37 @@ import tabIconProfitPre from '@/assets/tabbar_icon_profit_pre.svg'
|
|
|
import tabIconMine from '@/assets/tabbar_icon_mine.svg'
|
|
|
import tabIconMinePre from '@/assets/tabbar_icon_mine_pre.svg'
|
|
|
|
|
|
-export default defineComponent({
|
|
|
- name: 'TabsPage',
|
|
|
- setup() {
|
|
|
- const route = useRoute()
|
|
|
- const activeTab = ref(null)
|
|
|
- if (route.path === '/home') {
|
|
|
- activeTab.value = 'home'
|
|
|
- } else if (route.path == '/news') {
|
|
|
- activeTab.value = 'news'
|
|
|
- } else if (route.path == '/rank') {
|
|
|
- activeTab.value = 'rank'
|
|
|
- } else if (route.path == '/distribution') {
|
|
|
- activeTab.value = 'distribution'
|
|
|
- } else {
|
|
|
- activeTab.value = 'mine'
|
|
|
- }
|
|
|
- const tabChange = tabInfo => {
|
|
|
- if (tabInfo.tab === 'home') {
|
|
|
- activeTab.value = 'home'
|
|
|
- }
|
|
|
- if (tabInfo.tab === 'news') {
|
|
|
- activeTab.value = 'news'
|
|
|
- }
|
|
|
- if (tabInfo.tab === 'rank') {
|
|
|
- activeTab.value = 'rank'
|
|
|
- }
|
|
|
- if (tabInfo.tab === 'distribution') {
|
|
|
- activeTab.value = 'distribution'
|
|
|
- }
|
|
|
+const route = useRoute()
|
|
|
+const activeTab = ref(null)
|
|
|
+if (route.path === '/home') {
|
|
|
+ activeTab.value = 'home'
|
|
|
+} else if (route.path == '/news') {
|
|
|
+ activeTab.value = 'news'
|
|
|
+} else if (route.path == '/rank') {
|
|
|
+ activeTab.value = 'rank'
|
|
|
+} else if (route.path == '/distribution1') {
|
|
|
+ activeTab.value = 'distribution'
|
|
|
+} else {
|
|
|
+ activeTab.value = 'mine'
|
|
|
+}
|
|
|
+const tabChange = tabInfo => {
|
|
|
+ if (tabInfo.tab === 'home') {
|
|
|
+ activeTab.value = 'home'
|
|
|
+ }
|
|
|
+ if (tabInfo.tab === 'news') {
|
|
|
+ activeTab.value = 'news'
|
|
|
+ }
|
|
|
+ if (tabInfo.tab === 'rank') {
|
|
|
+ activeTab.value = 'rank'
|
|
|
+ }
|
|
|
+ if (tabInfo.tab === 'distribution') {
|
|
|
+ activeTab.value = 'distribution'
|
|
|
+ }
|
|
|
|
|
|
- if (tabInfo.tab === 'mine') {
|
|
|
- activeTab.value = 'mine'
|
|
|
- }
|
|
|
- }
|
|
|
- return {
|
|
|
- tabChange,
|
|
|
- activeTab,
|
|
|
- tabIconHome,
|
|
|
- tabIconHomePre,
|
|
|
- tabIconNews,
|
|
|
- tabIconNewsPre,
|
|
|
- tabIconRank,
|
|
|
- tabIconMine,
|
|
|
- tabIconMinePre,
|
|
|
- tabIconProfit,
|
|
|
- tabIconProfitPre
|
|
|
- }
|
|
|
+ if (tabInfo.tab === 'mine') {
|
|
|
+ activeTab.value = 'mine'
|
|
|
}
|
|
|
-})
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|