<template>
   <div class='rank-list'>
            <div class='rank-item' v-for='(item,index) in rankList' :key='index'>
                <div :class='["number",`number-${index}`]'>
                    {{index+1}}
                </div>
               <div class='box'>
                    <div class='avatar'>
                        <img src="~imgPath/fissionTask/noOne.png" alt="" class='background' v-if='index===0'>
                        <img src="~imgPath/fissionTask/noTwo.png" alt="" class='background' v-if='index===1'>
                        <img src="~imgPath/fissionTask/noThree.png" alt="" class='background' v-if='index===2'>
                        <img :src="item.avatar" alt="" class='img'>
                    </div>
                    <div class='name'>
                        {{item.nickname}}
                    </div>
               </div>
                <div class='invite'>
                    已成功邀请{{item.upvote}}人
                </div>
            </div>
        </div>
</template>
<script>
export default {
    props:{
        rankList:{
            default:()=>{
                return []
            }
        }
    }
}
</script>
<style scoped lang='scss'>
.rank-list{
    width: 100%;
    padding: 0 0.32rem;
    padding-top:0.24rem;
    box-sizing: border-box;
    .rank-item{
        width:100%;
        // padding: 0 0.32rem 0 0.24rem;
        display: flex;
        height:0.96rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-sizing: border-box;
        .number{
            font-size: 0.32rem;
            width: 0.4rem;
            height:0.4rem;
            display: flex;
            justify-content: center;
            align-items: center;
            box-sizing: border-box;
        }
        .number-0{
            color: #FFBB00;
            border: 0.02rem solid rgba(255, 187, 0, 0.5);
            border-radius:100%;
        }
        .number-1{
            color: rgba(182, 207, 236, 0.5);
           border: 0.01rem solid rgba(182, 207, 236, 0.5);
            border-radius:100%;
        }
        .number-2{
            color: rgba(224, 142, 89, 0.5);
           border: 0.01rem solid rgba(224, 142, 89, 0.5);
            border-radius:100%;
        }
        .box{
            flex:1;
            display: flex;
            align-items: center;
        }
        .avatar{
            margin-left:0.16rem;
            display: flex;
            height: 0.84rem;
            justify-content: flex-end;
            position: relative;
            top:-0.12rem;
            .img{
                width:0.72rem;
                height:0.72rem;
                border-radius: 100%;
                z-index:1;
                position: relative;
                top:0.12rem;
            }
            .background{
                width: 0.72rem;
                height: 0.84rem;
                position: absolute;
                z-index:1
            }
        }
        .name{
            max-width: 1.68rem;
            font-size: 0.24rem;
            font-weight: 400;
            color: #666666;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            margin-left:0.16rem;
        }
        .invite{
            font-size: 0.24rem;
            color: #333333;
        }   
    }
}
</style>