<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="xqtop">
        	<view class="tit">
        		{{obj.userName == undefined ? '--' : obj.userName}}
        	</view>
			<view class="xiao">
				<view class="one">推广人：</view>
				<view class="two">{{obj.referenceName == undefined ? '--' : obj.referenceName}}(<text v-if="obj.referenceType == 2">代理</text><text v-if="obj.referenceType == 3">业务员</text><text v-if="obj.referenceType == 4">投资人</text><text v-if="obj.referenceType == 5">经营场所</text>)</view>
			</view>
			<view class="xiao">
				<view class="one">推广代理：</view>
				<view class="two">{{obj.agentCount == undefined ? '--' : obj.agentCount}}人</view>
			</view>
			<view class="xiao">
				<view class="one">推广业务员：</view>
				<view class="two">{{obj.bizManCount == undefined ? '--' : obj.bizManCount}}人</view>
			</view>
        </view>
		 <!-- 基本信息 -->
		 <view class="jiben">
		 	<view class="tit">
		 		基本信息
		 	</view>
			<view class="xiao">
				<view class="one">手机号：</view>
				<view class="two">{{obj.phonenumber == undefined ? '--' : obj.phonenumber}}</view>
			</view>
			<view class="xiao">
				<view class="one">分成比例：</view>
				<view class="two">{{obj.point}}%</view>
			</view>
			<view class="xiao">
				<view class="one">创建时间：</view>
				<view class="two">{{obj.createTime == undefined ? '--' : obj.createTime}}</view>
			</view>
			<!-- <view class="xiao">
				<view class="one">业务员：</view>
				<view class="two">人</view>
			</view> -->
			<view class="xiao">
				<view class="one">投资人：</view>
				<view class="two">{{obj.investorCount == undefined ? '--' : obj.investorCount}}人</view>
			</view>
			<view class="xiao">
				<view class="one">经营场所：</view>
				<view class="two">{{obj.storeCount == undefined ? '--' : obj.storeCount}}</view>
			</view>
			<view class="xiao">
				<view class="one">设备数：</view>
				<view class="two">{{obj.deviceCount == undefined ? '--' : obj.deviceCount}}</view>
			</view>
			<view class="xiao">
				<view class="one">累计订单：</view>
				<view class="two">{{obj.billCount == undefined ? '--' : obj.billCount}}单</view>
			</view>
		 </view>
		 
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgc: {
					backgroundColor: "#8883f0",
				}, 
				userId:'',
				obj:{}
			}
		},
		onLoad(option) {
            this.userId = option.userId
			this.getxq()
		},
		// 分享到好友（会话）
		onShareAppMessage: function() {
			return {
				title: '创亿康',
				path: '/pages/index/index'
			}
		},

		// 分享到朋友圈  
		onShareTimeline: function() {
			return {
				title: '创亿康',
				query: '',
				path: '/pages/index/index'
			}
		},
		methods: {
            // 查询详情
			getxq(){
				this.$u.get(`/app/user/${this.userId}`).then(res =>{
					if(res.code == 200){
						this.obj = res.data
					}
				})
			}
			

		}
	}
</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%;
	    .xqtop{
			width: 680rpx;
			height: 256rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			margin: auto;
			margin-top: 32rpx;
			padding: 30rpx;
			box-sizing: border-box;
			.tit{
				font-size: 32rpx;
				color: #3D3D3D;
				font-weight: 600;
				padding-bottom: 28rpx;
				border-bottom: 1px solid #D8D8D8;
				padding-left: 8rpx;
				box-sizing: border-box;
			}
			.xiao{
				display: flex;
				justify-content: space-between;
				margin-top: 12rpx;
				.one{
					font-size: 24rpx;
					color: #808080;
				}
				.two{
					font-size: 24rpx;
					color: #3D3D3D;
				}
			}
		}
		.jiben{
			width: 680rpx;
			height: 480rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			margin: auto;
			margin-top: 32rpx;
			padding: 30rpx;
			box-sizing: border-box;
			.tit{
				font-size: 32rpx;
				color: #3D3D3D;
				font-weight: 600;
				padding-bottom: 28rpx;
				border-bottom: 1px solid #D8D8D8;
				padding-left: 8rpx;
				box-sizing: border-box;
			}
			.xiao{
				display: flex;
				justify-content: space-between;
				margin-top: 12rpx;
				.one{
					font-size: 24rpx;
					color: #808080;
				}
				.two{
					font-size: 24rpx;
					color: #3D3D3D;
				}
			}
		}
	}

</style>