<template>
    <div class="commission-item">
        <div class="head">
            <ion-thumbnail class="avatar">
                <img :src="detail.junior.avatar" />
            </ion-thumbnail>
            <div class="name">{{ detail.junior.nickname }}</div>
            <div class="num">{{ $t('distribution.commission') }}: +{{ detail.amount }}</div>
        </div>
        <div class="order">
            <ion-thumbnail class="cover">
                <img :src="detail.order.pic[0]" />
            </ion-thumbnail>
            <div class="info">
                <div class="name">{{ detail.order.name }}</div>
                <div class="price">
                    <div class="value">{{ $t('balance.symbol') }}100</div>
                    <div class="num">×1</div>
                </div>
            </div>
        </div>
        <div class="prop">{{ $t('order.id') }}: {{ detail.orderId }}</div>
        <div class="prop">{{ $t('order.createdAt') }}: {{ detail.createdAt }}</div>
    </div>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
const props = defineProps({
    detail: {
        type: Object,
        default: () => {
            return {
                junior: {},
                order: { pic: [] }
            }
        }
    }
})
</script>
<style lang="less" scoped>
.commission-item {
    margin: 0 16px 10px 16px;
    background: var(--ion-color-step-0);
    border-radius: 2px;
    padding: 0 15px 12px 15px;
    .head {
        height: 44px;
        border-bottom: 1px solid var(--ion-color-step-50);
        .f();
        .avatar {
            width: 24px;
            height: 24px;
            --border-radius: 2px;
        }
        .name {
            flex-grow: 1;
            font-size: 14px;
            margin-left: 6px;
        }
        .num {
            font-size: 13px;
            color: #ff7f1f;
            font-weight: bold;
        }
    }
    .order {
        .f();
        margin-top: 14px;
        margin-bottom: 10px;
        .cover {
            width: 50px;
            height: 50px;
            --border-radius: 4px;
        }
        .info {
            margin-left: 10px;
            flex-grow: 1;
            .name {
                font-size: 14px;
                line-height: 20px;
            }
            .price {
                .f();
                margin-top: 5px;
                line-height: 17px;
                font-size: 12px;
                width: 100%;
                .value {
                    flex-grow: 1;
                }
                .num {
                    color: var(--ion-color-step-350);
                }
            }
        }
    }
    .prop {
        font-size: 12px;
        line-height: 17px;
        color: var(--ion-color-step-600);
        margin-top: 5px;
    }
}
</style>
