<template>
  <a-drawer
    v-model:visible="vdata.visible"
    :title=" true ? '流水详情' : '' "
    :body-style="{ paddingBottom: '80px' }"
    width="40%"
    @close="onClose"
  >
    <a-row justify="space-between" type="flex">
<!--      <a-col :sm="12">-->
<!--        <a-descriptions>-->
<!--          <a-descriptions-item label="角色名称">-->
<!--            {{ vdata.detailData['infoName'] }}-->
<!--          </a-descriptions-item>-->
<!--        </a-descriptions>-->
<!--      </a-col>-->
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="流水号">
            {{ vdata.detailData['flowNo'] }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="账户类型">
            <span v-if="vdata.detailData['accountType'] == 0">退款账户</span>
            <span v-if="vdata.detailData['accountType'] == 1">营销账户</span>
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="账变类型">
            <template v-if="vdata.detailData['changeType'] === 0">充值</template>
            <template v-if="vdata.detailData['changeType'] === 1">提现</template>
            <template v-if="vdata.detailData['changeType'] === 2">转账</template>
            <template v-if="vdata.detailData['changeType'] === 3">退款</template>
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="时间">
            {{ vdata.detailData['updatedAt'] }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="变动前账户余额">
            ￥{{ vdata.detailData['beforeAmt'] ? (vdata.detailData['beforeAmt']/100).toFixed(2) : 0 }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="变动金额">
            ￥{{ vdata.detailData['changeAmt'] ? (vdata.detailData['changeAmt']/100).toFixed(2) : 0 }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="变动后账户余额">
            ￥{{ vdata.detailData['afterAmt'] ? (vdata.detailData['afterAmt']/100).toFixed(2) : 0 }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="备注">
            {{ vdata.detailData['changeTypeDesc'] }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
    </a-row>
  </a-drawer>
</template>

<script lang="ts" setup>
  import { API_MCH_PAY_DEFINES, req } from '@/api/manage'
  import {defineProps,reactive} from 'vue'

    const props = defineProps({
      callbackFunc: { type: Function,default:null }
  })

    const vdata = reactive({
        btnLoading: false,
        detailData: {}, // 数据对象
        recordId: null, // 更新对象ID
        visible: false, // 是否显示弹层/抽屉
        isvList: [], // 服务商下拉列表
        isvName: '' // 服务商名称
    })

    function show (record) { // 弹层打开事件
        vdata.detailData = record

        vdata.visible = true
      }
      function onClose () {
        vdata.visible = false
      }
defineExpose({
  show //抛出show函数给父组件
})
</script>
