<template>
	<view class="wrap">
		<uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
			@clickLeft="toBack">
			<view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
				<text style="color: white;font-size: 1rem;">{{title}}</text>
			</view>
		</uni-nav-bar>
		<view class="container">
			<view v-for="item in list" :key="item.id">
				<uGroup :title="item.orgName" margin-top="20">
					<uni-table ref="order_table" border stripe type="" emptyText="暂无更多数据">
						<uni-tr>
							<uni-th width="120" align="center"><view style="text-align: center;color: black;">姓名</view></uni-th>
							<uni-th width="120" align="center"><view style="text-align: center;color: black;">角色</view></uni-th>
							<uni-th align="center"><view style="text-align: center;color: black;">联系电话</view></uni-th>
						</uni-tr>
						<uni-tr v-for="person in item.servicePersonVOList" :key="person.id">
							<uni-td>
								<view style="text-align: center;">{{ person.personName }}</view>
							</uni-td>
							<uni-td align="center">
								<view style="text-align: center;">{{ person.roleName }}</view>
							</uni-td>
							<uni-td align="center">
								<view style="text-align: center;">{{ person.contactPhone }}</view>
							</uni-td>
						</uni-tr>
					</uni-table>
				</uGroup>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
	import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
	import uGroup from '@/uni_modules/uni-group/uni-group.vue'
	import uSection from '@/uni_modules/uni-section/uni-section.vue'
	import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
	import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
	import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
	import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
	import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
	import uSegmentedControl from '@/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue'
	import uniTable from '@/uni_modules/uni-table/components/uni-table/uni-table.vue'
	import http from '@/http/api.js';

	export default {
		components: {
			uNavBar,
			uList,
			uListItem,
			uIcons,
			uGroup,
			uPagination,
			uBreadcrumb,
			uSection,
			uDataPicker,
			uSegmentedControl,
			uniTable
		},
		onLoad(option) {
           this.getContact();
		},
		data() {
			return {
				list: [],
				title: '通讯录',
				desc: '',
				orderTableData: [],
				equipmentInspectionTableData: [],
				pageSize: 10,
				// 当前页
				pageCurrent: 1,
				// 数据总量
				total: 0,
				orgId: '',
				projectId: '',
				projectTree: [],
				selectedTreeNode: '',
				searchVal: '',
			}
		},
		computed: {
			getIcon() {
				return path => {
					return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
				}
			},
		},
		onShow() {

		},
		methods: {
			toBack() {
				uni.navigateBack({
					delta: 1
				})
			},
			getContact() {
				var that = this;
				http.request({
					url: '/galaxy-test/project/person/contact',
					method: 'GET',
				}).then(res => {
					if (res.data != null) {
						that.list = res.data;
					}
				}).catch(err => {
					console.log(err)
				})
			},
		}
	}
</script>

<style>

</style>

<style lang="scss" scoped>
	.container {
		padding: 0 0 100rpx;
	}

	.u-cell-icon {
		width: 36rpx;
		height: 36rpx;
		margin-right: 8rpx;
	}

	.slot-box {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
	}

	.slot-image {
		/* #ifndef APP-NVUE */
		display: block;
		/* #endif */
		//margin-right: 10px;
		width: 20px;
		height: 20px;
	}

	.order-title-image {
		/* #ifndef APP-NVUE */
		display: block;
		/* #endif */
		// margin-right: 10px;
		width: 20px;
		height: 20px;
		border-radius: 50%;

	}

	.slot-text {
		flex: 1;
		font-size: 14px;
		color: #4cd964;
		margin-right: 10px;
	}

	.content-box {
		flex: 1;
		/* #ifdef APP-NVUE */
		justify-content: center;
		/* #endif */
		height: 100%;
		line-height: 44px;
		padding: 0 15px;
		position: relative;
		background-color: #fff;
		border-bottom-color: #f5f5f5;
		border-bottom-width: 1px;
		border-bottom-style: solid;
	}

	.content-text {
		font-size: 15px;
	}

	.example-body {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		justify-content: center;
		padding: 10px 0;
		background-color: #fff;
	}

	.button {
		border-color: #e5e5e5;
		border-style: solid;
		border-width: 1px;
		padding: 4px 8px;
		border-radius: 4px;
	}

	.button-text {
		font-size: 15px;
	}

	.slot-button {
		/* #ifndef APP-NVUE */
		display: flex;
		height: 100%;
		/* #endif */
		flex: 1;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		padding: 0 20px;
		background-color: #ff5a5f;
	}

	.slot-button-text {
		color: #ffffff;
		font-size: 14px;
	}
</style>
