<template>
  <a-modal v-model:visible="visible" :footer="null">
    <div class="modal-title">成交订单详细</div>
    <div class="modal-describe">创建订单金额/笔数 = 成交订单金额/笔数 + 未付款订单金额/笔数</div>
    <div class="statistics-list" style="padding-bottom: 55px;">
      <div v-for="(item, index) in props.sucDetailList as any" :key="index" class="item">
        <div v-if="item.type == 'line'" class="line" />
        <div class="title">{{ item.title }}</div>
        <div v-if="item.title" class="amount">
          <a-tooltip>
            <template #title>{{ item.content }}元</template>
            <span class="amount-num">{{ item.content }}</span><span>元</span>
          </a-tooltip>
        </div>
        <div v-if="item.count >= 0" class="detail">
          <span>{{ item.count }}笔</span>
        </div>
      </div>
    </div>
    <div class="close" @click=" visible = false">
      <a-button type="primary">知道了</a-button>
    </div>
  </a-modal>
</template>
<script lang="ts" setup>
import { ref, reactive } from 'vue'
const visible = ref<boolean>(false)

const props = defineProps({
  countDetailList: {type: Array, default: () => []},
  sucDetailList: {type: Array, default: () => []}
})

const showModal = () => visible.value = true

defineExpose({showModal})
</script>
<style scoped lang="less">
.modal-title, .modal-describe{
  text-align: center;
  margin-bottom: 15px;
}
.modal-title {
  margin-bottom: 20px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}
.close {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  border-top: 1px solid #EFEFEF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}
.amount {
  max-width:150px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
</style>