<!--化学品扫码身份验证-->
<template>
	<view class="identityVerify">
		<img v-if="pageType==1" :src="imagesUrl('commonality/icon_kcxq_cg.png')"/>
		<img v-if="pageType==2" :src="imagesUrl('commonality/icon_kcxq_sb.png')"/>
		<view class="tip">{{pageType==1?'身份验证成功':'身份验证失败'}}</view>
	</view>
</template>
<script>
	import {chemicalAioIdentityScanLogin} from '@/pages/api/index.js'
	export default {
		name: "identityVerify",
		props: {
			
		},
		data() {
			return {
				pageType:1,
				// 查询参数
				queryParams: {
				  code:'',
				  subId:'',
				  userId:'',
				},
				
			}
		},
		onLoad(option) {
			this.$set(this.queryParams,'code',option.code);
			this.$set(this.queryParams,'subId',option.subId);
			this.$set(this.queryParams,'userId',uni.setStorageSync('userId'));
			this.chemicalAioIdentityScanLogin();
			
		},
		created() {

		},
		mounted() {
			
		},
		methods: {
			//身份验证
			async chemicalAioIdentityScanLogin(){
				let self = this;
				const {data} = await chemicalAioIdentityScanLogin(this.queryParams);
				if(data.code == 200){
					this.$set(this,'pageType',1)
				}else{
					this.$set(this,'pageType',2)
				}
			}, 
		},
	}
</script>

<style lang="stylus" scoped>
	.identityVerify {
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		>img{
			width: 200rpx;
			height: 200rpx;
			margin: 339rpx 0 48rpx 0;
		}
		.tip{
			font-weight: 400;
			font-size: 30rpx;
			color: #3D3D3D;
			line-height: 60rpx;
			text-align: center;
		}
	}
</style>