<template>
	<view class="browse">
		<view class="title">浏览记录</view>
		<view class="list">
			<view class="item" v-for="(item,index) in browse" :key="index">
				<view class="img">
					<view v-if="item.img == '' || item.img == 'none'">
						<image :src="item.img" mode=""></image>
					</view>
					<view v-else>
						<view class="img_tip" :style="{backgroundColor:bgColor[index]}">
							{{item.name.split('').pop()}}
						</view>
					</view>
				</view>
				<view class="name">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:[
			"browse",
			"bgColor"
		],
		
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="scss">
	.browse{
		margin-top: 20px;
		margin-bottom: 40px;
		.title {
			line-height: 30px;
			border-left: 4px solid #009FE8;
			border-radius: 4px;
			padding-left: 10px;
			margin-bottom: 10px;
		}
		.list{
			overflow: hidden;
			.item{
				float: left;
				width: 140rpx;
				text-align: center;
				margin-bottom: 10px;
				.img{
					margin: 0 auto;
					margin-bottom: 5px;
					width: 120rpx;
					height: 120rpx;
					border-radius: 50%;
					overflow: hidden;
					
					image{
						width: 120rpx;
						height: 120rpx;
					}
					
					.img_tip{
						width: 120rpx;
						height: 120rpx;
						// background-color: skyblue;
						
						text-align: center;
						line-height: 120rpx;
						color: #FFFFFF;
					}
				}
				.name{
					width: 140rpx;
					
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}
			}
		}
	}
</style>
