<template>
  <div class="white-bgc pa-3 pt-3">
    <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f7f8fa">
      <v-tab value="tab_transaction">交易订单</v-tab>
      <v-tab value="tab_recharge">充值订单</v-tab>
      <v-tab value="tab_balance">M豆交易明细</v-tab>
    </v-tabs>
    <Transaction v-if="tab === 'tab_transaction'"></Transaction>
    <Recharge v-if="tab === 'tab_recharge'"></Recharge>
    <Balance v-if="tab === 'tab_balance'"></Balance>
  </div>
</template>

<script setup>
defineOptions({name: 'enterprise-memberCenter-myAccount'})
import { ref } from 'vue'
import { useUserStore } from '@/store/user'
import Transaction from './components/transaction.vue'
import Recharge from './components/recharge.vue'
import Balance from './components/balance.vue'
import { useRouter } from 'vue-router'

const router = useRouter()
const store = useUserStore()
store.getEnterpriseUserAccountInfo()

const tab = ref('tab_transaction')

if (router.currentRoute.value.query.key === 'tab_recharge') tab.value = 'tab_recharge'
</script>

<style lang="scss" scoped>
</style>