<template>
    <view class="car-info-wrap">
        <view class="car-info">
            <view class="car-title">车辆过户次数</view>
            <view class="car-num">{{ transferTimes[status] }}</view>
            <!-- <view class="explanation">
                <view class="explanation-text">解释说明: 机动车状态无异常显示正常，反之为异常。</view>
            </view> -->
        </view>
    </view>
</template>

<script setup>
import { defineProps, computed } from "vue";

// 接收父组件传递的数据
const props = defineProps({
    data: Object,
});

// 提取数据中的状态
const status = computed(() => props.data?.status);

// 过户次数映射
const transferTimes = {
    0: "过户0次",
    1: "过户1-2次",
    2: "过户3-5次",
    3: "过户5次以上",
};
</script>

<style scoped>
.car-info-wrap {
    width: 100vw;
}

.car-info {
    margin: 8px 20px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0px 0px 1px #d0d0d0;
    text-align: center;
}

.car-num {
    font-size: 38px;
    color: green;
    font-weight: bold;
}

.car-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.explanation-text {
    font-size: 16px;
    color: #999;
}

.tags {
    display: flex;
    flex-wrap: wrap;
}

.tag {
    background-color: #e0e0e0;
    border-radius: 3px;
    padding: 5px 10px;
    margin: 5px;
    font-size: 14px;
}
</style>
