<template>
	<view class="">
		<u-notify ref="uNotify" message=""></u-notify>
		<view class="pwd_view">
			<!-- <view class="cancel">
				<image src="../../static/images/close.png" mode=""></image>
			</view> -->
			<view class="" style="font-size: 30rpx;margin-bottom: 42rpx;">
				密码登录
			</view>
			<u--input placeholder="请输入观看密码" border="none" inputAlign="center" v-model="pwd"
				style="background-color: #F2F2F4;border-radius: 10rpx;font-size: 28rpx;padding: 20rpx 0;">
			</u--input>
			<view class="btn_pwd" @click="sumbit_pwd">
				进入
			</view>
		</view>
	</view>
</template>

<script>
export default {
	
	name: "password_login",
	props: {
		logintype:Object
	},
	data() {
		return {
			pwd:''
		}
	},
	methods:{
		sumbit_pwd(){
			this.$api.roomwatchytypeencryption(this.pwd).then(res=>{
				 if(res.data.code === 200){
				        this.$refs.uNotify.show({
				            top: 30,
				            type: 'success',
				            message: '验证成功',
				            duration: 1000 * 3,
				            fontSize: 20,
				            safeAreaInsetTop:true
				        })
				        setTimeout(() => {
				          location.reload()
				        }, 1000);
				}
				else{
					this.$refs.uNotify.show({
					    top: 30,
					    type: 'error',
					    message: res.data.msg,
					    duration: 1000 * 3,
					    fontSize: 20,
					    safeAreaInsetTop:true
					})
				}
			})
		}
	}
}
	
</script>

<style>
	.pwd_view{
		padding: 45rpx 60rpx;
		text-align: center;
	}
	.btn_pwd{
		margin-top: 80rpx;
		height: 80rpx;
		background: #266FE8;
		line-height: 80rpx;
		color: #fff;
		border-radius: 40rpx;
	}
/* 	.cancel{
		margin-top: -20rpx;
		margin-bottom: 50rpx;
		margin-right: -20rpx;
	}
	.cancel image{
		width: 30rpx;
		float: right;
		height: 30rpx;
	} */
</style>