<template>
	<view class="wrap">
		<view class="imgwrap">
			<image src="@/static/SSO/attes.png" mode=""></image>
		</view>
		<view class="title">IDENTITY AUTHENTICATION</view>
		<view class="titletext">统一身份认证平台</view>

		<view>
			<view v-if="firsttype">
				<view class="loading">系统认证中，请耐心等待......</view>
			</view>
			<view v-else>
				<view class="logintitle">用户登录</view>
				<view class="logintext">首次登录，请输入账号密码。</view>
				<view class="account" style="margin-top: 30rpx;">
					<view>账号：</view>
					<input v-model="UPUserName" class="uni-input" focus placeholder="请输入账号" />
				</view>
				<view class="account">
					<view>密码：</view>
					<input v-model="UPPass" class="uni-input" password="" placeholder="请输入密码" />
				</view>
				<view class="btnwrap">
					<button @click="register">登录</button>
				</view>
			</view>
		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataitem: '',
				FName: '',
				appid: '',
				firsttype: true,
				UPUserName: '',
				UPPass: '',
				UPId: '',
				FId: '',
				UserId: ''
			}
		},
		onLoad(data) {
			this.dataitem = JSON.parse(data.item)
			this.FName = this.dataitem.FName;
			this.appid = this.dataitem.appid;
			setTimeout(() => {
				this.gotolist()
			}, 1000)

		},
		methods: {
			gotolist() {
				let _this = this
				const { appid } = this
				// console.log(appid)
				this.HTTP_GET(
					'quanjiang/sso/goto20', {
						appid
					},
					'加载数据时出错'
				).then(res => {
					let option = {
						FInterfaceUrl:res.FInterfaceUrl,
						FName:this.FName
					}
					uni.redirectTo({
						url:`/pages/SSO/MyApp/listview?data=`+ encodeURIComponent(JSON.stringify(option))
					})
				})

			}
		}
	}
</script>

<style lang="less">
	.imgwrap {
		width: 214rpx;
		margin: 0 auto;
		padding-top: 100rpx;
		font-size: 0;
	}

	.imgwrap image {
		width: 214rpx;
		height: 200rpx;
		display: block;
	}

	.title {
		font-size: 24rpx;
		text-align: center;
		margin-top: 40rpx;
		color: gray;
	}

	.titletext {
		font-size: 50rpx;
		text-align: center;
		margin-top: 20rpx;
	}

	.loading {
		font-size: 28rpx;
		text-align: center;
		margin-top: 50rpx;
		color: goldenrod;
	}

	.logintitle {
		font-size: 36rpx;
		text-align: center;
		margin-top: 90rpx;
		color: gray;
	}

	.logintext {
		font-size: 28rpx;
		text-align: center;
		margin-top: 30rpx;
		color: goldenrod;
	}

	.account {
		display: flex;
		align-items: center;
		margin-top: 30rpx;
		justify-content: center;
	}

	.account view {
		font-size: 38rpx;
	}

	.account input {
		border: 1px solid #ccc;
		height: 80rpx;
		font-size: 30rpx;
		width: 450rpx;
		padding-left: 20rpx;
	}

	.btnwrap {}

	.btnwrap button {
		width: 50%;
		line-height: 50px;
		background-color: #0c86d8;
		text-align: center;
		color: #fff;
		border-radius: 4px;
		margin: 40px auto;
		font-size: 40rpx;
	}
</style>
