<template>
	<view class="rank-item">
		<view class="rank-left">
			<!-- <image src="@/pages_order/static/top/4.png" class="rank-icon" /> -->
			
			<view class="rank-icon">
				{{ index }}
			</view>
			
			<image src="@/pages_order/static/book/dj.png" class="rank-num-img" />
			<image class="avatar" :src="item.hanHaiMember
					&& item.hanHaiMember.headImage" mode="aspectFill" />
			<view class="name">{{
				
				item.hanHaiMember
						&& item.hanHaiMember.nickName
				
			}}</view>
		</view>
		<view class="rank-right">
			<view class="score">
				{{
					item.hanHaiMember
							&& item.num
				}}
				
				亲密值</view>
			<view class="level">
				{{
					item.commonBookAchievement
							&& (item.commonBookAchievement.oldName || item.commonBookAchievement.title)
				}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'RankListItem',
		props: {
			index : {
			},
			item : {
				default : {}
			}
		},
	}
</script>

<style lang="scss" scoped>
	.rank-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: linear-gradient(to bottom, #FBEBC5, #FDF9DD);
		border-radius: 16rpx;
		margin-bottom: 18rpx;
		box-shadow: 0 2rpx 8rpx 0 rgba(184, 110, 59, 0.06);
		padding: 24rpx;

		.rank-left {
			display: flex;
			align-items: center;

			.rank-icon,
			.rank-num-img {
				width: 60rpx;
				height: 60rpx;
				margin-right: 10rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				font-size: 34rpx;
				font-weight: 900;
				color: #684427;
			}

			.avatar {
				width: 60rpx;
				height: 60rpx;
				border-radius: 50%;
				margin-right: 14rpx;
				object-fit: cover;
			}

			.name {
				font-size: 26rpx;
				color: #222;
				font-weight: 500;
			}
		}

		.rank-right {
			display: flex;
			flex-direction: column;
			align-items: flex-end;
            gap: 10rpx;

			.score {
				font-size: 22rpx;
				color: #684427;
			}

			.level {
				font-size: 20rpx;
				color: #C28E00;
				background: #FFE8A8;
				border-radius: 8rpx;
				padding: 2rpx 10rpx;
				margin-top: 6rpx;
				font-weight: 500;
			}
		}
	}
</style>