<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>
		<div class="qx_btn" @tap="goBack">返回首页</div>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				deviceId:''
			}
		},
		onLoad(option) {
			this.deviceId = option.deviceId;
		},
		methods:{
			addRole(){
				uni.navigateTo({
					url:'/pagesRole/addRole?type=1&deviceId='+this.deviceId
				})
			},
			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>