<template>
	<view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
		<cus-header title='扫码结果'></cus-header>
		<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/ea285d8f-ad96-447e-8f4a-77d495f2fac6.png"></image>
		<p>扫码成功</p>
		<p class="tip">设备已就绪，需添加角色才能使用<br>快去创建角色吧~</p>
		<div class="zt_btn" @tap="addRole">为设备添加角色</div>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				scanParams:''
			}
		},
		onLoad(option) {
			if(option.scanParams) this.scanParams = JSON.parse(option.scanParams);
		},
		methods:{
			addRole(){
				uni.navigateTo({
					url:'/pagesRole/addRole?type=1&scanParams='+JSON.stringify(this.scanParams)
				})
			},
			goBack(){
				uni.reLaunch({
					url:'/pages/home'
				})
			},
		}
	}
</script>

<style scoped lang="less">
	.page{
		background: #FFFFFF;
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 0 60rpx;
		image{
			width: 400rpx;
			height: 430rpx;
			margin-top: 92rpx;
		}
		p{
			font-family: PingFang-SC, PingFang-SC;
			font-weight: bold;
			font-size: 40rpx;
			color: #111111;
			line-height: 40rpx;
			text-align: center;
			margin-top: 35rpx;
			&.tip{
				font-weight: 400;
				font-size: 26rpx;
				color: #7C8592;
				line-height: 41rpx;
				text-align: center;
				margin-top: 29rpx;
			}
		}
		.zt_btn{
			margin-top: 232rpx;
		}
		.qx_btn{
			margin-top: 60rpx;
		}
	}
</style>