<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 class="search dis j-s a-c mt-5">
				<u-search v-model="pageRequest.criteria"
					style="box-shadow: 0px 4px 10px 0px #DAE3F4;border-radius: 6px;" @custom="custom" @search="search"
					:shape="shape" :height='68' bg-color="#fff" color="#000" :input-style="{background:'transparent'}"
					placeholder-color="rgba(51,51,51,0.6)" :clearabled="clearabled" :show-action="showAction"
					:input-align="inputAlign" @clear="clear" :action-style="{background:'#fff'}"
					placeholder="请输入工号、姓名、手机号查询"></u-search>
				<!-- <image src="/static/image/car-insure/dropdown.png" mode="" @tap="searchPopup"></image> -->
			</view>
		</view>
		<view style="padding: 160px 16px 50px 16px;">
			<view class="Paging dis f-c " v-for="(item,index) in list" :key="index">
				<view class="pa-title dis a-c j-s">
					<view class="dis a-c ">
						<image src="../../../static/image/addStaff/active.png" mode=""></image>
						<text>未认证</text>
					</view>
					<u-button size="mini" type="primary" :custom-style="{fontSize:'14px'}" :plain="true"
						@click="details(item.id)">查看详情</u-button>
				</view>
				<view class="pa-cent dis f-c mt-2">
					<text style="color: #333;">姓名：{{item.name}}</text>
					<text>工号：{{item.id}}</text>
					<view class="dis j-s a-c">
						<text>手机号：{{item.mobile}}</text>
						<image src="../../../static/image/addStaff/phone.png" mode="" @click="callPhone(item.mobile)">
						</image>
					</view>
				</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',
				list: [],
				pageRequest: { //查询的默认条件
					pageNum: 1,
					pageSize: 20,
					authenticationStatus: '2',
					criteria: "",
				},
			}
		},
		onLoad() {
			this.querylist();
		},
		computed: {
			...mapState(['userInfo', 'sources']),
		},
		methods: {
			async querylist() {
				let res = await this.$http.post('/app/customer/authenticationQuery', this.pageRequest);
				if (res.code == '200') {
					this.list = res.data.content;
				}
			},
			details(id) {
				this.navigate({
					url: '/pages/tools/addStaff/authenticationdetails?id=' + id
				}, "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.querylist();
			},
			//搜索按钮事件
			custom(val) {
				this.querylist();
			},
		}
	}
</script>

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

	.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: 10px;
		box-sizing: border-box;
		margin-bottom: 10px;

		.pa-title {
			padding-bottom: 6px;
			border-bottom: 1px solid #f2f2f2;

			text {
				font-size: 14px;
				color: #0BA7FF;
				font-weight: 700;
				margin-left: 6px;
			}

			image {
				width: 18px;
				height: 18px;
			}
		}

		.pa-cent {
			text {
				font-size: 13px;
				color: rgba(51, 51, 51, 0.8);
				font-weight: 400;
			}

			image {
				width: 20px;
				height: 20px;
			}
		}
	}
</style>