<template>
	<view class="container">
		<!-- 图片区域 -->
		<img src="../../static/my/shopImg3.png" />

		<!-- 账户信息区域 -->
		<view class="box">
			<view class="box_title">账户信息</view>
			<view class="box_hotel">
				<view class="totel_left">民宿名称</view>
				<view class="">{{ data.hotelName || '超级管理员' }}</view>
			</view>
			<view class="box_name">
				<view class="name_left">用户名</view>
				<view class="">{{ data.adminName }}</view>
			</view>
			<view class="box_btn">
				<view class="btn_item type" @click="handleUnbind">去解绑</view>
				<view class="btn_item type2" @click="handleAgain">重新绑定</view>
			</view>
		</view>

		<view class="msg" v-if="type === '2'" @click="handleGoMsg">
			点击查看
			<text>数据中台</text>
			<img src="../../static/index/right.png" />
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			data: {},
			type: ''
		}
	},
	onLoad(options) {
		this.data = JSON.parse(options.data)
		this.type = options.type
		if (options.type === '2') {
			uni.setNavigationBarTitle({
				title: '我是业主'
			})
		}
	},
	methods: {
		// 去解绑按钮回调
		handleUnbind() {
			uni.navigateTo({
				url: `/pages/binding/binding?type=2&status=${this.type}`
			})
		},
		// 重新绑定按钮回调
		handleAgain() {
			uni.navigateTo({
				url: `/pages/binding/binding?status=${this.type}`
			})
		},
		handleGoMsg() {
			let url = 'https://chtech.ncjti.edu.cn/hotelReservation/pc4/'
			uni.navigateTo({
				url: `/pages/web/web?url=${url}`
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.container {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100vh;
	background-color: #fff;

	img {
		margin-top: 31rpx;
		width: 390rpx;
		height: 390rpx;
	}

	.box {
		box-sizing: border-box;
		padding: 0 30rpx;
		margin-top: 20rpx;
		width: 690rpx;
		height: 548rpx;
		border-radius: 23rpx;
		box-shadow: 0px 0px 9px rgba(0, 0, 0, 0.25);

		.box_title {
			line-height: 113rpx;
			font-size: 32rpx;
			font-weight: bold;
		}

		.box_hotel {
			display: flex;
			height: 75rpx;
			font-size: 28rpx;
			border-bottom: 1rpx solid #e6e6e6;

			.totel_left {
				margin-right: 34rpx;
				color: #808080;
			}
		}

		.box_name {
			display: flex;
			align-items: center;
			height: 107rpx;
			font-size: 28rpx;
			border-bottom: 1rpx solid #e6e6e6;

			.name_left {
				margin-right: 62rpx;
				color: #808080;
			}
		}

		.box_btn {
			display: flex;
			justify-content: space-between;
			margin-top: 102rpx;
			height: 96rpx;

			.btn_item {
				display: flex;
				justify-content: center;
				align-items: center;
				width: 300rpx;
				height: 96rpx;
				font-size: 32rpx;
				border-radius: 64rpx;
			}

			.type {
				color: #096562;
				background-color: #fff;
				border: 1rpx solid #096562;
			}

			.type2 {
				color: #fff;
				background-color: #096562;
			}
		}
	}

	.msg {
		margin-top: 33rpx;
		font-size: 28rpx;

		text {
			margin: 0 10rpx;
			color: #096562;
		}

		img {
			width: 13rpx;
			height: 20rpx;
		}
	}
}
</style>
