<template>
	<view class="container">
		<view  v-if="emptyType==0">
			<view v-for="item in dataList" class="item" @tap="handleClick(item)">
				<view class="item-left">
					<image :src="item.member.icon?item.member.icon:''" mode="aspectFit"></image>
					<view>
						<view class="item-name">{{item.member.username}}</view>
						<view class="item-tel">{{item.member.mobile}}</view>
					</view>
				</view>
				<image src="http://139.9.103.171:1888/img/image/arrow.png"  class="arrow"></image>
			</view>
		</view>
		<DtNoMore v-if="isNoMore" />
		<DtEmpty :type="emptyType" />
	</view>
</template>

<script>
	import DtNoMore from "../comps/dt_no_more.vue";
	import DtEmpty from '../comps/dt_empty.vue'
	export default {
		components: {
			DtNoMore,
			DtEmpty
		},
		data() {
			return {
				memberId:'',
				dataList:[]
			};
		},
		
		methods:{
			onLoadPage() {
			  this.memberId = this.$auth.getMemberId();
			  this.getData()
			},
			async getData(){
				let resp = await this.$api.distributorGetInvites({
					_isShowLoading: true,
					memberId:this.memberId,
					pageNo:this.pageIndex,
					pageSize:this.pageSize,
				})
				let list = this.getDataList(resp)
				this.dataList = this.dataList.concat(list)
			},
			handleClick(item){
				uni.navigateTo({
					url:"/pagesM/pages/user_invite?title="+item.member.username+'&id='+item.member.id
				})
			}
		},
		onReachBottom() {
		  this.onReachBottomPage()
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		height: 100vh;
		border-top: 2upx solid rgba(238,238,238,1);
		.item{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-left: 16upx;
			padding-left: 24upx;
			padding-right: 40upx;
			height: 108upx;
			background-color: #fff;
			border-bottom: 2upx solid rgba(238,238,238,1);
			.item-left{
				display: flex;
				align-items: center;
				image{
					width:66upx;
					height:66upx;
					border-radius:50%;
					background-color: #f7f7f7;
					margin-right: 21upx;
					display: block;
				}
				.item-name{
					font-size:30upx;
					line-height: 40upx;
					font-family:PingFang SC;
					font-weight:400;
					color:rgba(51,51,51,1);
				}
				.item-tel{
					font-size:24upx;
					font-family:PingFang SC;
					font-weight:400;
					color:rgba(153,153,153,1);
				}
			}
			.arrow{
				width: 10upx;
				height: 18upx;
			}
		}
	}
</style>
