<template>
	<view class="concerns">
		<view class="concerns-container">
			<view v-for="(info, index) in list" :key="index">
				<view class="daren-item" @click="toDetailsPage">
					<image class="head" :src="info.friend_tomavatar"></image>
					<text class="name">{{ info.friend_tomname }}</text>
					<!-- <text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text> -->
					<view class="guanzhu" @click="changeType(info.friend_frommid)" v-if="info.friend_followstate == 1">关注</view>
					<view class="guanzhu action" @click="changeType(info.friend_frommid)" v-else>未关注</view>
				</view>
			</view>
			<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
		</view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			list: []
		}
	},
	onShow() {
		this.attentionMemberList();
	},
	methods: {
		attentionMemberList() {
			this.$u.api.attentionMemberList().then(res => {
				if(res.errCode == 0) {
					this.list = res.data;
				} else {
					this.list = [];
				}
			})
		}
	},
};
</script>
<style lang="scss" scoped>
.concerns {
	.concerns-container {
		padding: 30rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		.daren-item{
			width: 215rpx;
			height: 282rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			background-color: #fff;
			border-radius: 10rpx;
			overflow: hidden;
			.head{
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
				margin-top: 24rpx;
				background-color: #0f0;
			}
			.name{
				font-size: 26rpx;
				color: #333;
				font-weight: 400;
				margin-top: 23rpx;
			}
			.zhuangtai{
				font-size:22rpx;
				color: #999;
				margin-top: 19rpx;
			}
			.guanzhu{
				width: 130rpx;
				height: 50rpx;
				background-color: #FF780F;
				font-size: 26rpx;
				line-height: 50rpx;
				color: #fff;
				text-align: center;
				margin-top: 19rpx;
				border-radius: 25rpx;
			}
			.action{
				background: #f3f3f3;
			}
		}
	}
}
</style>