<template>
  <PageLayout>
    <template #header-right>
      <q-btn flat dense to="/wallet/fund" label="账户明细" />
    </template>
    <div class="bg-primary q-px-md q-py-xl text-white">
      <div class="text-caption">当前余额（元）</div>
      <div class="text-h4 q-pt-sm">{{ formatMoney(store.shop.balance) }}</div>
    </div>
    <q-list separator class="bg-white">
      <q-item to="/wallet/recharge">
        <q-item-section side>
          <q-icon name="credit_card" color="deep-orange" />
        </q-item-section>
        <q-item-section>充值</q-item-section>
        <q-item-section side>
          <q-icon name="keyboard_arrow_right" size="14px" />
        </q-item-section>
      </q-item>
      <q-item to="/wallet/draw" v-if="store.user.level==1">
        <q-item-section side>
          <q-icon name="account_balance_wallet" color="teal" />
        </q-item-section>
        <q-item-section>提现</q-item-section>
        <q-item-section side>
          <span>
            当前可提现{{formatMoney(store.shop.balance_withdraw)}}元
            <q-icon name="keyboard_arrow_right" size="14px" />
          </span>
        </q-item-section>
      </q-item>
    </q-list>
  </PageLayout>
</template>
<script setup>
import { useSelfStore } from "stores/self";
import { formatMoney } from 'src/utils/tools'
const store = useSelfStore();
</script>
