<template>
  <div>
    <el-descriptions class="margin-top" :column="1" border>
      <el-descriptions-item label="用户类型">{{ info.userType ? info.userType === '1' ? '管理员' : '普通用户' : '' }}</el-descriptions-item>
      <el-descriptions-item label="账户积分">{{ info.point }}</el-descriptions-item>
      <el-descriptions-item label="账户余额">{{ info.balance ? (info.balance / 100.0).toFixed(2) : '' }}</el-descriptions-item>
      <el-descriptions-item label="累计支出">{{ info.totalExpense ? (info.totalExpense / 100.0).toFixed(2) : '' }}</el-descriptions-item>
      <el-descriptions-item label="累计充值">{{ info.totalRecharge ? (info.totalRecharge / 100.0).toFixed(2) :'' }}</el-descriptions-item>
      <el-descriptions-item label="冻结金额">{{ info.freezePrice ? (info.freezePrice / 100.0).toFixed(2) : '' }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script setup>
/* 账户详情 */
defineOptions({ name: 'PersonAccount'})
import { PersonInfoApi } from '@/api/menduner/system/person'
import { formatDate } from '@/utils/formatTime'
import { DICT_TYPE } from '@/utils/dict'

const props = defineProps({
  userId: String
})

const info = ref({})
const getInfo = async () => {
  const data = await PersonInfoApi.getPersonAccount(props.userId)
  const res = await PersonInfoApi.getPersonWallet(props.userId)
  info.value = { ...data, ...res }
}
getInfo()
</script>
