<template>
	<view class="container">
		<view class="info-box" v-for="(item,index) in listData" :key="index">
		<view class="info">
			<view class="label">公司名称：</view>
			<view class="value">{{item.companyName}}</view>
		</view>
		<view class="info">
			<view class="label">用户名：</view>
			<view class="value">{{item.userName}}</view>
		</view>
		<view class="info">
			<view class="label">密码：</view>
			<view class="value">{{item.password}}</view>
		</view>
		<view class="info">
			<view class="label">有效时间：</view>
			<view class="value">{{item.startDate}}~{{item.endDate}}</view>
		</view>
		<view class="info">
			<view class="label">联系人：</view>
			<view class="value">{{item.linkPerson}}</view>
		</view>
		<view class="info">
			<view class="label">电话：</view>
			<view class="value">{{item.mobile}}</view>
		</view>
		<view class="info" style="margin-bottom:0">
			<view class="label">备注：</view>
			<view class="value">{{item.remark}}</view>
		</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				pageNo: 1,
				pageSize: 10,
				loadDone: false,
				listData: []
			};
		},
		onLoad(options) {
			let id = options.id
			this.getData(id)
		},
		onShow() {
		
		},
		methods: {
			getData(id){
				let body = {
					houseId:id,
					pageNo:this.pageNo,
					pageSize:this.pageSize
				}
				this.$u.api.findNetWork({body:body}).then((res)=>{
					// console.log(res)
					if(res.result&&res.result.length){
						if(this.pageNo==1){
							this.listData = res.result
						}else{
							this.listData = [...this.listData, ...res.result];
						}
						if(res.result.length<this.pageSize){
							this.loadDone = true;
							return ;
						}
						this.pageNo += 1;
						this.loadDone = false
					}else{
						this.loadDone = true;
						if(this.pageNo==1){
							this.listData = []
						}
					}
				})
			}
		},

	};
</script>

<style lang="scss" scoped>
.container{
	width: 750rpx;
	min-height: 100vh;
	background: #F8F8F8;
	padding-top: 20rpx;
	.info-box{
		background-color: #fff;
		padding: 30rpx;
		margin-bottom: 20rpx;
	}
	.info{
		display: flex;
		align-items: center;
		height: 40rpx;
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #666666;
		margin-bottom: 24rpx;
		.label{
			width: 140rpx;
			margin-right: 30rpx;
		}
		.value{
			font-weight: 400;
			color: #333333;
		}

	}
}
</style>
