<template>
    <div class="demo_tabs_box">
        <div class="demo_tabs_boxitem" v-for="(item, index) in ordereData.list" :key="index"
            @click="clickitemboxshow(item)">
            <div class="demo_tabs_boxitem_one">
                <div class="" style="width: 100px; height: 70px;border-radius: 10px; background:rgb(186 200 239); display: flex; justify-content: center; align-items: center;">
                 <div>{{ item.zdNo || "pos" }}</div>
                </div>
                <!-- <el-image style="width: 100px; height: 70px;border-radius: 10px;" :src="item.imgUrl" fit="scale-down" /> -->
                <div class="demo_tabs_boxitem_oneone">
                    <div>
                        {{ dayjs(item.createAt).format(" HH:mm:ss") }}
                    </div>
                    <div style="color: #757575;">
                        {{ dayjs(item.createAt).format("YYYY-MM-DD") }}
                    </div>
                </div>
                <div class="demo_tabs_boxitem_onetow">
                    <div style="font-size: 16px; color: #757575;">{{ item.orderNo }}</div>
                    <div>
                        <span>{{item.names && item.names[0] }} </span>
                        <span style="margin-left: 6px;">等{{ item.names && item.names.length }}项</span>
                    </div>
                </div>
            </div>
            <div class="demo_tabs_boxitem_tow">
                <div>
                    ￥{{ item.orderAmount }}
                </div>
                <div style="color:#ff9e01;">
                    <span v-if="item.status == 'pending'">挂单</span>
                    <span v-if="item.status == 'refund'">退单</span>
                    <span v-if="item.status == 'closed'">订单完成</span>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import { dayjs } from 'element-plus'

const props = defineProps({
    ordereData: {
        type: Object,
        default: {
            list:[{
                names:[]
            }]
        }
    }
})
const emit = defineEmits(["emititemboxshow"])
const clickitemboxshow = (e) => {
    emit('emititemboxshow', e)
}
</script>

<style scoped lang="scss">
.demo_tabs_box {
    width: 100%;
    padding: 10px 20px;
    height: 82%;
    overflow: auto;

    .demo_tabs_boxitem {
        width: 100%;
        padding: 6px 16px;
        border-radius: 6px;
        display: flex;
        justify-content: space-between;
        // background: #eeeeee;
        border-bottom: 1px solid #ccc;

        .demo_tabs_boxitem_one {
            display: flex;
            justify-content: flex-start;
            flex-shrink: 0;

            .demo_tabs_boxitem_oneone {
                display: flex;
                margin-left: 20px;
                flex-direction: column;
                height: 70px;
                justify-content: space-around;
            }

            .demo_tabs_boxitem_onetow {
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                flex: 1;
                margin-left: 20px;
            }
        }
    }

    .demo_tabs_boxitem_tow {
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        height: 70px;
        justify-content: space-around;
        align-items: flex-end;

    }
}
</style>