index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!-- 钱包 -->
  2. <template>
  3. <app-view class="wallet">
  4. <template #header>
  5. <app-statusbar />
  6. </template>
  7. <Grid :border="false">
  8. <GridItem icon="pending-payment" :text="t('digital.wallet-deposit')" :to="{ name: 'wallet-deposit-currency' }" />
  9. <GridItem icon="paid" :text="t('digital.wallet-withdraw')" :to="{ name: 'wallet-withdraw-currency' }" />
  10. <GridItem icon="peer-pay" :text="t('digital.wallet-transfer')" :to="{ name: 'wallet-transfer' }" />
  11. <GridItem icon="setting-o" :text="t('digital.setting')" :to="{ name: 'setting' }" />
  12. </Grid>
  13. <Tabs v-model:active="currentTabIndex">
  14. <Tab :title="t('tabbar.contract')">
  15. <contract-account @click="navigateToContractDetail" />
  16. </Tab>
  17. <Tab :title="t('tabbar.spot')">
  18. <Search shape="round" :placeholder="t('digital.search')" />
  19. <spot-account @click="navigateToSpotDetail" />
  20. </Tab>
  21. </Tabs>
  22. </app-view>
  23. </template>
  24. <script lang="ts" setup>
  25. import { shallowRef } from 'vue'
  26. import { Tab, Tabs, Grid, GridItem, Search } from 'vant'
  27. import { useNavigation } from '@mobile/router/navigation'
  28. import SpotAccount from './components/spot/index.vue'
  29. import ContractAccount from './components/contract/index.vue'
  30. import { i18n } from '@/stores'
  31. const { router } = useNavigation()
  32. const { global: { t } } = i18n
  33. const currentTabIndex = shallowRef(0)
  34. const navigateToSpotDetail = (currencyId: number) => {
  35. router.push({
  36. name: 'spot-detail',
  37. query: {
  38. id: currencyId
  39. }
  40. })
  41. }
  42. const navigateToContractDetail = (accountId: string) => {
  43. router.push({
  44. name: 'contract-detail',
  45. query: {
  46. id: accountId
  47. }
  48. })
  49. }
  50. </script>