<script setup lang="ts" name="TripCloseListItem">
import { ref, reactive, computed, onMounted } from 'vue'

const emit = defineEmits<{
  'on-detail': [item: any]
}>()
const props = defineProps<{
  list: any
}>()

function onClickItem(item) {
  emit('on-detail', item)
}
</script>

<template>
  <div class="list">
    <template v-for="(item, index) in props.list" :key="index">
      <div class="list-item" @click="onClickItem(item)">
        <div class="list-item-title">
          <div class="list-item-title-label">申请时间：</div>
          <div class="list-item-title-value">{{ item.applyTime }}</div>
        </div>
        <div class="list-item-title">
          <div class="list-item-title-label">关闭时间：</div>
          <div class="list-item-title-value">{{ item.backTime }}</div>
        </div>
        <div class="list-item-remark">
          <div class="list-item-remark-label">备注：</div>
          <div class="list-item-remark-content">{{ item.remark }}</div>
        </div>
      </div>
    </template>
    <van-empty v-if="!props.list?.length" description="暂无数据" />
  </div>
</template>

<style lang="less" scoped>
.list {
  padding: var(--container-pd);
  &-item {
    padding: var(--container-pd);
    border-radius: 24rpx;
    box-shadow: 0 4rpx 40rpx  rgba(64, 103, 251, 0.14);
    &-title {
      display: flex;
      align-items: center;
      margin-bottom: 0.6rem;
      &-label {
        width: 7rem;
        text-align: right;
      }
      &-value {
        color: var(--van-gray-7);
      }
    }
    &-remark {
      display: flex;
      justify-content: space-between;
      &-label {
        width: 7rem;
        text-align: right;
      }
      &-content {
        flex: 1;
        overflow: hidden;
        color: var(--van-gray-7);
      }
    }
  }
}
</style>
