<template>
    <div class="orderInfo">
        <div class="top">
            <!-- <div class="label">一级分销</div> -->
            <div class="value">预计佣金：+{{ info.commission }}</div>
        </div>
        <div class="center">
            <van-image class="suk-img" width="50" height="50" fit="fill" :src="info.pic" />

            <div class="right">
                <div class="text1">{{ info.name }}</div>
                <div class="text2">¥{{ info.price }}</div>
            </div>
            <div class="num">×1</div>
        </div>

        <div class="order-info">
            <div class="order-item">订单编号：{{ info.orderId }}</div>
            <div class="order-item">下单时间：{{ info.createdAt }}</div>
        </div>
    </div>
</template>
<script>
import { mapState } from 'pinia';
import { useUserStore } from '@/stores/user';
export default {
    name: 'orderInfo',
    props: {
        info: {
            type: Object,
            default: () => {
                return {};
            }
        }
    },
    data() {
        return {};
    },
    computed: {
        ...mapState(userUserStore, ['user'])
    }
};
</script>
<style lang="less" scoped>
.orderInfo {
    background: rgba(255, 255, 255, 1);
    border-radius: 2px;
    padding: 0 15px 15px;
    margin-bottom: 10px;
}

.top {
    position: relative;
    height: 44px;
    text-align: right;
    border-bottom: 1px solid #f2f4f5;
    .label {
        width: 70px;
        height: 24px;
        background: rgba(255, 143, 0, 1);
        border-radius: 0px 100px 100px 0px;
        font-size: 12px;
        color: rgba(255, 255, 255, 1);
        line-height: 24px;
        text-align: center;
        position: absolute;
        left: 0;
        top: 10px;
    }

    .value {
        font-size: 13px;
        font-weight: bold;
        color: rgba(255, 143, 0, 1);
        line-height: 44px;
    }
}
.center {
    display: flex;
    // align-items: center;
    padding: 15px 0 0;
    .right {
        flex-grow: 1;
        margin-left: 10px;
        .text1 {
            font-size: 14px;
            color: rgba(var(--ion-color-light-contrast-rgb), 1);
            line-height: 20px;
        }
        .text2 {
            font-size: 12px;
            color: rgba(var(--ion-color-light-contrast-rgb), 1);
            line-height: 17px;
            margin-top: 5px;
        }
    }

    .num {
        font-size: 14px;
        color: rgba(170, 172, 173, 1);
        line-height: 20px;
        align-self: flex-end;
    }
}

.order-info {
    margin-top: 10px;
    .order-item {
        font-size: 12px;
        color: rgba(102, 102, 102, 1);
        line-height: 17px;
        &:not(:last-child) {
            margin-bottom: 5px;
        }
    }
}
</style>
