<template>
	<view>
		<!-- 公共组件-每个页面必须引入 -->
		<public-module></public-module>
		<view class="headers " :style="headerStyle">
			<view class="dis a-c j-start ">
				<u-icon name="arrow-left" size="40" @tap="back"></u-icon>
				<text style="margin: auto;">查看详情</text>
			</view>
		</view>
		<view style="padding-top: 100px;">
			<view class="Paging dis f-c ">
				<view class="pag-data dis j-s a-c">
					<text>机构名称：</text>
					<text>{{userData.organization}}</text>
				</view>
				<view class="pag-data dis j-s a-c">
					<text>部门编码：</text>
					<text>{{userData.deptId}}</text>
				</view>
				<view class="pag-data dis j-s a-c">
					<text>部门名称：</text>
					<text>{{userData.deptName}}</text>
				</view>
				<view class="pag-data dis j-s a-c">
					<text>工号：</text>
					<text>{{userData.userId}}</text>
				</view>
				<view class="pag-data dis j-s a-c">
					<text>姓名：</text>
					<text>{{userData.name}}</text>
				</view>
				<view class="pag-data dis j-s a-c">
					<text>联系电话：</text>
					<text>{{userData.phone}}</text>
				</view>
				<view class="pag-data dis j-s a-c">
					<text>状态：</text>
					<text v-if="status==1">已认证</text>
					<text v-else>未认证</text>
				</view>
			</view>
		</view>

	</view>
</template>
<script>
	import {
		mapState
	} from "vuex"
	export default {
		data() {
			return {
				headerStyle: {
					backgroundColor: '',
					backgroundImage: '',
					backgroundSize: '',
					backgroundPosition: '',
					boxShadow: ''
					// 其他样式属性...
				},
				shape: 'square',
				clearabled: true,
				showAction: false,
				inputAlign: 'left',
				pageRequest: { //查询的默认条件
					companyId: "",
					orderNo: "",
					frameNo: "",
					insuredName: "",
					licenseNo: "",
					orderStatus: "",
					userId: "",
					deptId: "",
					endDate: "",
					startDate: "",
					pageNum: 1,
					pageSize: 20,
				},
				userData: {},
				status: "",
			}
		},
		async onLoad(params) {
			if (params.id) {
				this.status = params.status;
				let res = await this.$http.get('/app/customer/' + params.id);
				if (res.code == '200') {
					this.userData = res.data;
				}
			}
		},
		computed: {
			...mapState(['userInfo', 'sources']),
		},
		methods: {
			details() {
				this.navigate({
					url: '/pages/tools/addStaff/authenticationdetails'
				}, "navigateTo", true);
			},
			callPhone(tel) {
				uni.makePhoneCall({
					phoneNumber: tel,
					success: () => {
						console.log("成功拨打电话")
					}
				})
			},
			//页面返回按钮
			back() {
				uni.navigateBack({
					delta: 1, // 返回的页面数，如果是1表示返回上一页
					success: function() {}
				});
			},
			change(index) {
				this.current = index;
			},
			change1(index) {
				this.current1 = index;
			},
			getStaffList(staffType) {
				// 0未认证 1已认证 2全部
				this.navigate({
					url: '/pages/tool-staff-list/tool-staff-list?staffType=' + staffType
				}, "navigateTo", true);
			},
			//回车搜索事件
			search(val) {
				this.getOrdersList();
			},
			//搜索按钮事件
			custom(val) {
				this.getOrdersList();
			},
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #F8FAFE;
		padding: 16px;
	}

	.search {

		image {
			width: 22px;
			height: 22px;
			margin-left: 20px;
		}
	}

	.headers {
		position: fixed;
		top: 0;
		left: 0;
		height: auto;
		width: 100%;
		z-index: 999999;
		padding: 16px;
		padding-top: 50px;
		height: auto;
		background: #F8FAFE;
		background-image: url("/static/image/addStaff/bfg.png");
		background-size: 100% 100%;

		text {
			font-size: 18px;
			font-weight: bold;
			color: #000;
		}
	}

	.Paging {
		width: 100%;
		height: auto;
		background: #FFFFFF;
		box-shadow: 0px 4px 10px 0px #DAE3F4;
		border-radius: 6px;
		padding: 6px;

		.pag-data {
			border-bottom: 1px solid #f2f2f2;
			padding: 6px 0;
		}

		.pag-data:last-child {
			border: none;
		}
	}
</style>