<template>
	<view class="index">
		<view class="header">
			<img src="https://qsfy.qs163.cn/statics/shujuju_applet_static_path/2.png" alt="" class="img">
			<span class="sapn">扫码成功</span>
			<span class="sapnteo">请确认授权登录</span>
		</view>
		<view class="naver" @click="smit">
			授权登录
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:0,//判断是否是登录页面跳转的
				telephone:''
			};
		},
		onLoad(e){
			console.log(e)
			this.type = e.code
			// this.telephone = 15855353281
			this.telephone = uni.getStorageSync('phone')
		},
		onUnload(){
			 uni.switchTab({
			          url: '/pages/tab/about_we',
			        })
		},
			
		methods:{
			smit(){
				var _this =  this
				let object = {
					uuid: _this.type,
					phone: _this.telephone,
					// cardType:'ID_CARD',
				};
				console.log(object)
				this.$http.post("auth/phoneScanLogin",{
					// familyId: this.familyId,
					...object
				}).then(res => {
					console.log(res)
					if(res.code=="200"){
						uni.showToast({
							title: '登录成功',
							duration: 1000,
							icon: 'none'
						});
						setTimeout(() => {
							uni.navigateBack({
								delta:2
							})
						},1000)
					}else {
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});
					}
				})
			}
		}
	}
</script>

<style lang="scss">
.index{
	height: 100vh;
	// background-color: #dbebf8;
	.header{
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-top: 132upx;
		box-sizing: border-box;
		.img{
			width: 142upx;
			height: 142upx;
			margin-bottom: 54upx;
			// width: 400upx;
		}
		span{
			font-size: 35upx;
			color: #666;
			width: 414upx;
			text-align: center;
			line-height: 50upx;
			
		}
		.sapn{
			font-size: 42upx;
			color: #333;
			// width: 414upx;
			font-weight: 700;
			text-align: center;
			line-height: 50upx;
			margin-bottom: 15upx;
			
		}
		.sapnteo{
			font-size: 28upx;
			color: #666;
			// width: 414upx;
			// font-weight: 700;
			text-align: center;
			line-height: 50upx;
		}
	}
	
}
.naver{
	width: 85%;
	height: 90upx;
	font-size: 31upx;
	font-family: PingFang SC;
	font-weight: 400;
	color: #FFFFFF;
	line-height: 90upx;	
	background-color: #1678FF;
	margin-left: 50%;
	transform: translateX(-50%);
	border-radius: 14upx;
	text-align: center;
	margin-top: 150upx;
	}
</style>
