<template>
    <view class="content">
		<mNavbar title="粉丝" :leftClick="leftClick" />
        <view style="background: #f5f5f5; min-height: calc(100vh - 570rpx);">
        	<view class="item-card">
        		<view class="item-line flex flex-sb" v-for="(item ,index) in nodes">
        			<view class="flex">
						<view style="width:80rpx;height:80rpx;margin-right:24rpx;border-radius: 50%;overflow: hidden;" class="test">						
							<image style="width: 100%;height: 100%;"
							:src="item.headImage" mode="aspectFill"></image>
						</view>
						<view>
							<view style="">{{ item.nickName }}</view>
							<view style="color: #909090; font-size: 24rpx">创建时间{{ dataFormat(item.createTime) }}</view>
						</view>
        			</view>
        			<view>
        				<!-- <view style="line-height: 80rpx;color: #fc5341;">下单12单｜佣金￥840</view> -->
        			</view>
        		</view>
        	</view>
        </view>

    </view>
</template>

<script>
import mNavbar from '@/components/base/m-navbar.vue'
export default {
	components: {
		mNavbar,
	},
    data() {
        return {
			queryParams : {
				pageNo : 1,
				pageSize : 10
			},
			nodes : [],
			loading : false,
			finished : false,
        }
    },
    onShow() {
		this.getNodes()
    },
    methods: {
		onLoad(){
			this.queryParams.pageSize += 10
			this.getNodes()
		},
		leftClick() { //返回个人中心
			uni.navigateTo({
				url: '/pages/mine/distribution'
			})
		},
		getNodes(){
			this.$api('getFans' , this.queryParams , res => {
				if(res.code == 200){
					this.nodes = res.result.records || [];
					this.nodes.forEach(n => {
						if(n.defaultId == '1'){
							this.selectAddress = n.id
						}
					})
					if(this.queryParams.pageSize > res.result.total){
						this.finished = true
					}
				}
				this.loading = false
			})
		},
        clickBanner(){ uni.navigateTo({ url: '/pages/login/login' }) },
        clickNotice(){ uni.navigateTo({ url: '/pages/index/notice'}) },
        clickFillin(){ uni.navigateTo({ url: '/pages/index/fillin'}) },
        clickSpring(){ uni.navigateTo({ url: '/pages/spring/vote' }) },
        clickSpRank(){ uni.navigateTo({ url: '/pages/spring/rank' }) },
        clickMore(){ uni.navigateTo({ url: '/pages/index/infor'   }) },
        clickStar(){ uni.navigateTo({ url: '/pages/star/index' }) },
        clickVote(){ uni.switchTab({ url: '/pages/star/vote'   }) },
        clickRank(){ uni.switchTab({ url: '/pages/index/rank'  }) },
        clickInfo(id){ uni.navigateTo({ url: `/pages/index/infod?id=${id}`}) },
		dataFormat(time){
			let backendTime = this.dayjs(time);
			return backendTime.format('YYYY-MM-DD');  
		}
    }
}
</script>

<style>

body{
    background-color: #f5f5f5;
}
.item-card{
	width: calc(710rpx);
	margin: 20rpx;
	font-size: 28rpx;
	font-family: PingFang SC, PingFang SC-Bold;
	font-weight: 700;
	text-align: left;
	color: #333333;
	justify-content: space-between;
}
.item-line{
	align-items: center;
	box-sizing: border-box;
	border-radius: 16rpx;
	background-color: #fff;
	line-height: 40rpx;
	width: calc(100% - 80rpx);
	height: 80rpx;
	padding: 0rpx 20rpx;
	margin-bottom: 20rpx;
	width: 100%;
	height: 140rpx;
}
</style>
