<template>
	<view>
		<view class="opewrap">
			<view class="operation" @click="toEdit">修改</view>
		</view>
		<view class="cirtit">负责人</view>
		<view class="peobox">
			<view class="peoinfo" v-for="(item,index) in list" :key="index" v-if="item.roles == 1">
				<image :src="item.img?item.img:BASE_IMG_URL+'headImg.png'" class="peoimg" mode=""></image>
				<view class="peoright">
					<view class="pr_left">
						<view class="name">{{item.name}}</view>
						<!-- <view class="pr_post">{{item.post}} - {{item.name}}</view> -->
						<view class="pr_text">团队角色 负责人</view>
						<view class="pr_text">权限 负责人</view>
					</view>
					<image :src="BASE_IMG_URL+'call.png'" @click="toCall(item)" class="pr_phone" mode="">
				</view>
			</view>
		</view>
		<view class="cirtit">团队成员</view>
		<view class="peobox">
			<view class="peoinfo" v-for="(item,index) in list" :key="index" v-if="item.roles == 2">
				<image :src="item.img?item.img:BASE_IMG_URL+'headImg.png'" class="peoimg" mode=""></image>
				<view class="peoright">
					<view class="pr_left">
						<view class="name">{{item.name}}</view>
						<!-- <view class="pr_post">{{item.post}} - {{item.name}}</view> -->
						<view class="pr_text">团队角色 普通员工</view>
						<view class="pr_text" v-if="item.is_edit == 0">权限 只读</view>
						<view class="pr_text" v-if="item.is_edit == 1">权限 读写</view>
					</view>
					<image :src="BASE_IMG_URL+'call.png'" @click="toCall(item)" class="pr_phone" mode="">
				</view>
			</view>
		</view>
		
		<view style="height:30rpx;"></view>
	</view>
</template>

<script>
	import { BASE_IMG_URL } from '@/util/api.js'
	import { netTeamList } from '@/api/index.js'
	
	export default{
		data() {
			return{
				BASE_IMG_URL:BASE_IMG_URL,
				id:'',
				list:[]
			}
		},
		onLoad(options) {
			this.id = options.id
		},
		onShow() {
			this.getList()
		},
		methods:{
			getList() {
				netTeamList({id:this.id}).then(res=>{
					this.list = res.data
				})
			},
			toCall(item) {
				uni.makePhoneCall({
					phoneNumber:item.mobile
				})
			},
			toEdit() {
				uni.navigateTo({
					url:'/pagesA/circulate/edit?id='+this.id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.opewrap{
		padding:35rpx 35rpx 0;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		.operation{
			font-size:28rpx;
			color:$uni-text-color;
			font-weight: bold;
			margin-left:30rpx;
		}
	}
	.cirtit{
		padding:24rpx 30rpx;
		font-size:28rpx;
		border-bottom:1rpx solid #d2d0d0;
	}
	.peobox{
		.peoinfo{
			padding:24rpx 30rpx;
			display: flex;
			justify-content: flex-start;
			border-bottom:1rpx solid #d2d0d0;
			&:last-child{
				border-bottom:0;
			}
			.peoimg{
				width:100rpx;
				height:100rpx;
				border-radius: 50%;
				flex-shrink: 0;
				margin-right:24rpx;
			}
			.peoright{
				display: flex;
				justify-content: space-between;
				align-items: center;
				flex:1;
				.pr_left{
					.name{
						font-size:28rpx;
						color:#333;
						margin-bottom:15rpx;
					}
					.pr_post{
						font-size:26rpx;
						color:#666;
					}
					.pr_text{
						font-size:26rpx;
						color:#999;
					}
				}
				.pr_phone{
					width:42rpx;
					height:40rpx;
				}
			}
		}
	}
</style>
