<template>
	<view class="pages">
		<u-navbar title="合作伙伴列表" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
			title-size='36' height='44'></u-navbar>
		<view class="serch">
			<view class="inp">
				<view class="bor">
					<image src="https://api.ccttiot.com/smartmeter/img/static/uBY0VGovU7BZrSdUi7cn" mode=""></image>
					<input type="text" v-model="keyword" placeholder="搜索" />
				</view>
				<view class="sousuo" @click="btnscreh">
					搜索
				</view>
			</view>
		</view>

		<scroll-view scroll-y="true" @scrolltolower="onScrollToLower" style="height: 1360rpx;" class="order_list">
			<view class="order_item" v-for="(item,index) in wateringList" :key="index" @click="btndetail(item.userId)">
				<view class="tops">
					<view>{{item.realOrUserName == undefined ? '--' : item.realOrUserName}}  {{item.phonenumber == undefined ? '--' : item.phonenumber}}</view>
					<view style="color: #8883F0;"> 查看详情 </view>
				</view>
                 <view class="devixexq">
                 	<view class="xiaoav">
                 		<view class="">创业者</view>
                 		<view class="aa">{{item.investorCount == undefined ? '--' : item.investorCount}}</view>
                 	</view>
                 	<view class="xiaoav">
                 		<view class="">经营场所</view>
                 		<view class="aa">{{item.storeCount == undefined ? '--' : item.storeCount}}</view>
                 	</view>
                 	<view class="xiaoav">
                 		<view class="">设备数</view>
                 		<view class="aa">{{item.deviceCount == undefined ? '--' : item.deviceCount}}</view>
                 	</view>
                 	<view class="xiaoav">
                 		<view class="">订单数</view>
                 		<view class="aa">{{item.billCount == undefined ? '--' : item.billCount}}</view>
                 	</view>
                 </view>
                 <view class="zong">
                 	<view class="xiaoav">
                 		<view class="">订单总额</view>
                 		<view class="shu">¥{{item.billAmount == undefined ? '--' : item.billAmount}}</view>
                 	</view>
                 	<view class="xiaoav">
                 		<view class="">提供分成</view>
                 		<view class="shu">¥{{item.provideBonus == undefined ? '--' : item.provideBonus}}</view>
                 	</view>
                 </view>
				<view class="bot">
					<view>{{item.createTime == undefined ? '--' : item.createTime}}</view>
					<view>可支配分成比例:{{item.point == undefined ? '--' : item.point}}%</view>
				</view>
			</view>
			<view class="" style="width: 100%;text-align: center;color: #ccc;margin-top: 50rpx;">
				-已经到底了-
			</view>
		</scroll-view> 


	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgc: {
					backgroundColor: "#8883f0",
				},
				pagenum: 1,
				wateringList: [],
				pagesize: 10, // 一页多少数据
				total: 0,
				type:2,
				keyword:''
			}
		},
		onLoad() {
            this.getlist()
		},
		// 分享到好友(会话)
		onShareAppMessage: function() {
			return {
				title: '创亿康',
				path: '/pages/index/index'
			}
		},

		// 分享到朋友圈  																																											
		onShareTimeline: function() {
			return {
				title: '创亿康',
				query: '',
				path: '/pages/index/index'
			}
		},
		methods: {
			// 获取合作伙伴列表
			getlist(){
				this.$u.get(`/agent/user/agentList?pageNum=${this.pagenum}&pageSize=${this.pagesize}&keyword=${this.keyword}`).then(res => {
					if(res.code == 200){
						this.total = res.total
						if (res.rows.length > 0) {
							// 有数据,追加到列表  
							this.wateringList = this.wateringList.concat(res.rows)
							this.pagenum++
						}
					}
				})
			},
			// 滚动到底部
			onScrollToLower() {
				if (this.total > this.wateringList.length) {
					this.getlist() // 上拉加载更多  
				} 
			},
			btnscreh(){
				this.wateringList = []
				this.pagenum = 1
				this.getlist()
			},
             // 跳转详情
			 btndetail(userId){
				 uni.navigateTo({
				 	url:'/page_user/dailixq?userId=' + userId
				 })
			 }

		}
	}
</script>

<style lang="scss" scoped>
	/deep/ .u-title {
		padding-bottom: 15rpx;
	}

	/deep/ .u-icon__icon {
		padding-bottom: 15rpx;
	}

	.pages {
		background-color: #F7FAFE !important;
		height: 100vh;
		width: 100%;
        overflow: hidden;
		.order_list {
			padding-bottom: 100rpx;
			box-sizing: border-box;
            // height: 1260rpx;
			// overflow: scroll;
			.order_item {
				width: 672rpx;
				max-height: 458rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 4rpx 22rpx 0rpx rgba(0, 0, 0, 0.07);
				border-radius: 20rpx 20rpx 20rpx 20rpx;
				margin: auto;
				margin-top: 18rpx;
				padding: 24rpx 28rpx;
				box-sizing: border-box;
                .devixexq {
                	display: flex;
                	justify-content: space-between;
                	margin-top: 14rpx;
                	text-align: center;
                
                	.xiaoav {
                		font-size: 28rpx;
                		color: #3D3D3D;
                		view {
                			margin-top: 12rpx;
                		}
						.aa{
							font-size: 24rpx;
							color: #3D3D3D;
							font-weight: 600;
							margin-top: 24rpx;
						}
                	}
                }
				.zong {
					margin-top: 30rpx;
					display: flex;
					justify-content: space-between;
					text-align: center;
					padding: 0 50rpx;
					box-sizing: border-box;
					font-size: 24rpx;
					color: #3D3D3D;
					.xiaoav{
						font-size: 28rpx;
						color: #808080;
					}
				    .shu{
				    	font-weight: 600;
				    	font-size: 40rpx !important;
				    	color: #3D3D3D;
				    }
					view {
						margin-top: 12rpx;
					}
				}
				.bot {
					display: flex;
					justify-content: space-between;
					border-top: 1px solid #D8D8D8;
					padding-top: 22rpx;
					box-sizing: border-box;
					margin-top: 22rpx;
                    font-size: 24rpx;
					view {
						text {
							color: #8883F0;
						}
					}
				}

				.tops {
					display: flex;
					justify-content: space-between;
					width: 100%;
					border-bottom: 1px solid #D8D8D8;
					padding-bottom: 20rpx;
					box-sizing: border-box;

					view {
						display: flex;
						align-items: center;

						text {
							display: inline-block;
							width: 14rpx;
							height: 14rpx;
							border-radius: 50%;
							background-color: #8883F0;
							margin-right: 6rpx;
						}
					}
				}
			}
		}

		.serch {
			width: 750rpx;
			height: 136rpx;
			background: #FFFFFF;
			display: flex;
			padding: 0 36rpx;
			box-sizing: border-box;

			.inp {
				display: flex;
				align-items: center;
				margin-top: 26rpx;
				height: 68rpx;
				border: 2rpx solid #C7C7C7;
				width: 100%;
				border-radius: 20rpx;
				justify-content: space-between;
				// padding-right: 24rpx;
				box-sizing: border-box;

				.sousuo {
					width: 112rpx;
					height: 68rpx;
					border-left: 2rpx solid #C7C7C7;
					text-align: center;
					line-height: 68rpx;
					font-size: 32rpx;
					color: #3D3D3D;
				}

				.bor {
					display: flex;
					align-items: center;
					padding-left: 220rpx;

					image {
						width: 46rpx;
						height: 46rpx;
						margin-right: 12rpx;
					}
				}

			}
		}
	}
</style>