<template>
	<view class="info">
		<view class="grxx">
			<view class="grxxItem">
				<view class="ygxm">
					<text>个人信息</text>
					<text>{{userInfo.createDate}}</text>
				</view>
				<view class="sfzhm">
					<text>姓名</text>
					<text>{{userInfo.name}}</text>
				</view>
				<view class="sfzhm">
					<text>身份证</text>
					<text>{{userInfo.idcard}}</text>
				</view>
				<view class="sfzhm">
					<text>手机号</text>
					<text>{{userInfo.phone}}</text>
				</view>
				<view class="sfzhm">
					<text>单位</text>
					<text>{{userInfo.companyName}}</text>
				</view>
				<view class="sfzhm">
					<text>所属科室</text>
					<text>{{userInfo.officeName}}</text>
				</view>
			</view>
		</view>
		<view class="gnButton">
			<button @click="sh(2)">驳回</button>
			<button @click="sh(1)">通过</button>
		</view>
	</view>
</template>

<script>
	import {
		postRequest,
		getRequest
	} from '../../api/api.js'
	export default {
		data() {
			return {
				userInfo:[],
				businessId:'',
				msgId:''
			}
		},
		onLoad(option) {
			this.businessId=option.businessId
			this.msgId=option.msgId
			this.getInfo()
		},
		methods: {
			getInfo(){
				postRequest('/sysMessage/register/detail',{businessId:this.businessId}).then(res=>{
					if(res.code=='200'){
						this.userInfo=res.data
					}
				})
			},
			sh(approval){
				let data ={
					approval,
					businessId:this.businessId,
					msgId:this.msgId
				}
				postRequest('/thirdUser/approvalUser',data).then(res=>{
					uni.showModal({
						title: '提示',
						showCancel: false,
						content: res.msg,
						success: function(res) {
							
						},
					})
				})
			}
			
		
		}
	}
</script>

<style>
.info{
	padding: 30rpx 20rpx;
}
.grxxTitle {
		padding: 5% 0;
		font-size: 14px;
	}

	.grxxItem {
		border-radius: 5px;
		overflow: hidden;
		box-shadow: 0px 4px 15px 3px rgba(0, 0, 0, 0.1);
	}

	.grxxItem .ygxm {
		padding: 10px;
		background-color: #3297ff;
		color: white;
		display: flex;
		justify-content: space-between;
	}
	.grxxItem .ygxm text:last-of-type{
		font-size: 14px;
		color: #CCCCCC;
	}
	.grxxItem .sfzhm {
		margin: 0 10px;
		border-bottom: 1px solid #CCCCCC;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 10px;
		font-size: 84%;
		color: #999999;
		position: relative;
	}
	.grxxItem .mdd {
		justify-content: left;
	}

	.grxxItem .mdd input {
		width: 70%;
		margin-left: 10px;
	}

	.hxx {
		position: absolute;
		color: red;
		left: 3px;
		top: 25%;
	}

	.grxxItem .sfzhm:last-of-type {
		border: none;
	}
	.gnButton{
		text-align: center;
		margin-top: 10%;
		display: flex;
	}
	.gnButton button{
		width: 30%;
		font-size: 14px;
		background-color: #007affc7;
		color: white;
	}
	.gnButton button:first-of-type{
		background-color: #CCCCCC;
		color: black;
	}
</style>
