<template>
	<div :style="{'background-color': '#FFF','height': '100vh','overflow': 'hidden'}">
		<u-empty v-if="data.list.length == 0" text="暂无内容" mode="list"></u-empty>
		<view style="height: 100%;" v-if="data.list.length > 0">
			<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
				style="height: 100%; padding-bottom: 0px;">
					<matchmaking :navs="data" ></matchmaking>
				<u-loadmore
				  :status="status"
				  :load-text="loadText"
				  :font-size="24"
				  :margin-top="20"
				  :margin-bottom="20"
				  bg-color="#FFF"
				/>
				
			</scroll-view>
		</view>
		
	</div>
</template>

<script>
	import matchmaking from "@/components/matchmaking/index"
	export default {
		components:{
			matchmaking
		},
		data() {
			return {
				mainColor: '',
				active: 0,
				searchKey:"",
				typeList: [],
				msg:{
					pageIndex:1,
					pageSize:20,
					Sex:0,
				},
				loadText: {
					loadmore: "轻轻上拉，加载更多",
					loading: "努力加载中",
					nomore: "没有更多了",
				},
				page_count:1,
				status: "loadmore",
				data:{
					listStyle:-1,
					list:[],
				}
				
			};
		},	
		onLoad(options) {
			if(options && options.listStyle){
				this.data.listStyle = options.listStyle
			}
			if(options && options.Sex){
				this.msg.Sex = options.Sex
			}
			this.init();
		},
		created() {
			this.mainColor = this.$uiConfig.mainColor;
		},
		mounted() {
			uni.setNavigationBarTitle({
				title: '用户列表',
			});
			
		},
		methods: {
			
			init() {
			  this.request2(
			  	{
			  		url: '/api/AppletMiai/GetBaseInfoPageList',
			  		data: this.msg
			  	},
			  	res => {
			  		if(res.resultCode==1){
						this.data.list = this.data.list.concat(res.data.pageData);
						 this.page_count = res.data.pageCount;
						 if (this.page_count == 1) {
						   this.status = "nomore";
					}
			  		}
			  	}
			  );
			},
			lower(e) {

			  if (this.msg.pageIndex < this.page_count) {
			    this.msg.pageIndex++;
				this.status = "loading";
			    this.init();
			  } else {
			    
				this.status = "nomore";
			  }
			},
			changeHandler(i) {
				this.active = i;
				this.msg.BrandClassId = this.typeList[i].ID;
				this.msg.pageIndex = 1;
				this.data.list= [];
				 this.init();
			},
		}
	};
</script>

<style>
	.good_study_two {
		position: relative;
		margin-bottom: 12px;
		border: 1rpx solid transparent;
		border-radius: 10rpx;
		overflow: hidden;
		box-shadow: 0 4px 10px 1px #e6e5e5;
		background-color: #fff;
	}
	
	.good_study_two .tips {
		width: 64rpx;
		height: 64rpx;
		position: absolute;
		top: 0;
		left: 0;
		z-index: 4;
	}
	
	.good_study_two .img-box {
		width: 100%;
		height: 0;
		padding-top: 100%;
		position: relative;
		overflow: hidden;
	}
	
	.good_study_two .img-box .img-show {
		position: absolute;
		left: 0;
		top: 0;
		bottom: 0;
		right: 0;
		width: 100%;
		height: 338rpx;
		overflow: hidden;
	}
	
	.good_study_two .guding {
		position: relative;
	}
	
	.good_study_two .guding .img-box {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		top: 0;
	}
	
	.good_study_two .good-info {
		padding: 15rpx;
		height: 112rpx;
	}
	
	.good_study_two .good-info .good-name {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		margin-bottom: 8px;
		color: #111111;
		font-size: 26rpx;
		font-weight: bold;
	}
	
	.good_study_two .good-info .good-price-info {
		display: flex;
		color: #999999;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		font-size: 22rpx;
	}
	
	.good_study_two .good-info .good-price-info .price {
		color: #999999;
		/* flex: 1; */
		font-size: 11px;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
	}
	
	.good_study_two .good-info .good-price-info .buy {
		width: 24px;
		text-align: right;
	}
</style>
