<template>
	<view class="cust_detail">
		
		<view class="cust_item">
			<view class="cline_li" v-for="(item,index) in subord_list" :key="index">
				<view class="clineInfo" @click="toDetail(item)">
					<view class="info_head">
						<view>{{item.name}}</view>
					</view>
					<view class="info_main">
						<view class="main_left">
							<view class="left_followUp">下次跟进时间：{{item.next_time}}</view>
							<view class="left_star">
								<view style="float: left;">客户星级：</view>
								<view>
									<u-rate :count="5" v-model="item.level" disabled active-color="#FFD049" inactive-color="#b2b2b2" :size="30" :gutter="10"></u-rate>
								</view>
							</view>
							<view class="left_foot">
								<view class="l_box">
									<span>{{item.follow}}</span>
								</view>
							</view>
						</view>
						<view class="main_right">
							<image :src="item.owner_staff.img ? item.owner_staff.img : BASE_IMG_URL+'headImg.png'" mode="scaleToFill"></image>
							<view>{{item.owner_staff.name}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view style="height: 200rpx;"></view>
		<u-empty v-if="subord_list.length == 0" text="暂无更多"></u-empty>
	<view class="icon_creat" v-if="type == 1" @click="toCreatCustomer">
		<image :src="BASE_IMG_URL+'1.png'" mode="scaleToFill"></image>
	</view>
	</view>
</template>

<script>
	import {
		netSubordList
	} from '@/api/kehu.js'
	import {
		netGetSignList
	} from '@/api/index.js'
	import {
		BASE_IMG_URL
	} from '@/util/api.js'
	
	export default {
		data() {
			return {
				BASE_IMG_URL: BASE_IMG_URL,
				subord_list: [], //下级 客户列表
				kehuid: '',
				type:1,   //1普通客户  2公海客户
				lists:[]
			}
		},
		onLoad(options) {
			this.kehuid = options.id
			this.type = options.type
		},
		onShow() {
			//下级 客户 列表
			this.getSubordlist()
		},
		methods: {
			//下级 客户 列表
			getSubordlist() {
				netSubordList({
					id: this.kehuid
				}).then(res => {
					this.subord_list = res.data
				})
			},
			//新建  下级客户
			toCreatCustomer() {
				uni.navigateTo({
					url: '/pagesA/crm/createCustomer/createCustomer?id=' + this.kehuid
				})
			},
			//客户详情
			toDetail(item,type) {
				uni.navigateTo({
					url: '/pages/index/groupCompany/groupCompany?id=' + item.id +"&type=" + this.type
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	
	.icon_creat {
		position: fixed;
		z-index: 1;
		bottom: 180rpx;
		right: 80rpx;
	
		image {
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
		}
	}
.cust_detail{
	.cust_item{
		.cline_li{
			margin-top: 20rpx;
			background: #fff;
			.clineInfo{
				.info_head{
					font-size: 34rpx;
					color: #333;
					padding: 30rpx 50rpx;
				}
				.info_main{
					display: flex;
					justify-content: space-between;
					margin-left: 50rpx;
					margin-right: 60rpx;
					.main_left{
						padding-bottom: 20rpx;
						.left_followUp{
							font-size: 30rpx;
							color: #666;
							margin-bottom: 30rpx;
						}
						.left_star{
							
						}
						.left_foot {
							padding-bottom: 20rpx;
							margin-top: 20rpx;
							.l_box {
								margin-right: 35rpx;
								float: left;
						
								span {
									background: $uni-text-color-opcity;
									padding: 5rpx 12rpx;
									font-size: 26rpx;
									color: $uni-text-color;
									border-radius: 5rpx;
								}
							}
						}
					}
					.main_right{
						text-align: center;
						image{
							width: 100rpx;
							height: 100rpx;
							border-radius: 50%;
						}
					}
				}
			}
		}
	}
	#btn {
		font-size: 26rpx;
		color: #fff;
		text-align: center;
		line-height: 88rpx;
		width: 500rpx;
		height: 88rpx;
		background: $uni-text-color;
		border-radius: 29rpx;
		margin: 30rpx auto;
		display: flex;
		bottom: 20rpx;
	}
}
</style>
