<template>
	<view class="content">
		<view class="background">
			<image src="../../static/merchant/vipbackground.png" mode=""></image>
			<view class="title">
				{{number}}
				<text class="ren">人</text>
			</view>
		</view>
		<scroll-view scroll-y="true" class="scroll-wrapper" :style="{'height': height}">
			<!-- 空白页 -->
			<empty v-if=" loaded && vipList.length == 0"></empty>
			<view class="vip-wrapper">
				<view class="vip" v-for="item in vipList">
					<view class="img">
						<image :src="item.image" mode=""></image>
					</view>
					<view class="vip-content">
						<view class="left">
							<view class="top">
								<view class="name">
									{{item.name}}
								</view>
								<view class="nameplate">
								</view>
							</view>
							<view class="bottom">
								{{item.phone}}
							</view>
						</view>
						<view class="right">
							消费:￥{{item.money}}
						</view>
					</view>
				</view>
			</view>
			
			<uni-load-more :status="loadingType"></uni-load-more>
		</scroll-view>
		<!-- <view class="vip-box">
			
		</view> -->
	</view>
</template>

<script>
	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
	import empty from '@/components/empty';
	export default {
		components: {
			empty,
			uniLoadMore
		},
		data() {
			return {
				loadingType: 'more',
				loaded: true,
				height: '',
				number: 199, //人数
				vipList: [
					{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				},
				{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				},
				{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				},
				{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				},
				{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				},
				{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				},
				{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				},
				{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				},
				{
					image: "../../static/error/missing-face.png",
					name: "强爹",
					phone: 19211111111,
					money: 1200
				}
				]
			};
		},
		onReady(res) {
			var _this = this;
			uni.getSystemInfo({
				success: resu => {
					const query = uni.createSelectorQuery();
					query.select('.scroll-wrapper').boundingClientRect();
					query.exec(function(res) {
						console.log(res, 'ddddddddddddd');
						_this.height = resu.windowHeight - res[0].top + 'px';
						console.log('打印页面的剩余高度', _this.height);
					});
				},
				fail: res => {}
			});
		},
	}
</script>

<style lang="scss">
	.background {
		display: flex;
		justify-content: center;
		position: relative;
		width: 100%;
		height: 360rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.title {
		position: absolute;
		text-align: center;
		line-height: 360rpx;
		font-size: 72rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FFFFFF;

		.ren {
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
			line-height: 43rpx;
		}
	}
	.scroll-wrapper {
		
	}
	.vip-wrapper {
		padding: 0 26rpx 0 23rpx;
		background-color: #fff;
	}
	.vip {
		border-top: 1rpx solid #E3E3E3;
		display: flex;
		align-items: center;
		
		.img {
			margin: 0 20rpx;
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
	
			image {
				width: 100%;
				height: 100%;
			}
		}
	
		.vip-content {
			margin: 30rpx 0;
			display: flex;
			justify-content: space-between;
			width: 580rpx;
			display: flex;
			align-items: center;
	
			.left {
				display: flex;
				flex-direction: column;
	
				.top {
					display: flex;
	
					.name {
						font-size: 30rpx;
						font-family: PingFangSC;
						font-weight: 500;
						color: #3F454B;
					}
	
					.nameplate {}
				}
	
				.bottom {
	
					font-size: 22rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #999999;
				}
			}
	
			.right {
	
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #FF6F0F;
			}
	
		}
	}
</style>
