<template>
	<view style="background-color: #fff;min-height: 100vh;">
		<view class="default">
			<image src="/static/common/empty.png"></image>
			<view style="font-size: 26rpx;">
				<text style="color: #909090;">{{msg}}</text>
			</view>
			<navigator :url="url" class="cu-btn sm  margin-top-50"
				style="padding: 35rpx 65rpx;margin-left: 8rpx;background-color: #FFFFFF;border: 1rpx solid #d0d0d0;color: #606266;font-size: 26rpx;">
				{{btnName}}
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				msg: "您还未完成注册认证",
				btnName: "去注册认证",
				url: "../register/register"
			};
		},
		onLoad(options) {
			if (options.type == 2) {
				this.getHouseUser()
				this.initData()
			}
		},
		methods: {
			initData() {
				//导航栏标题
				uni.setNavigationBarTitle({
					title: "房屋认证"
				})
				//去认证
				this.msg = "您还未完成房屋认证"
				this.btnName = "去认证"
			},
			async getHouseUser() {
				let member = getApp().globalData.member
				if (this.$isEmpty(member)) {
					this.url = "../auth/auth"
					return
				}
				let params = {
					name: member.name,
					phone: member.tel
				}
				let res = await this.$http.getHouseUserCondition(params)
				let list = res.data.data
				if (this.$isEmpty(list)) {
					this.url = "../auth/auth"
					return
				}
				uni.setStorageSync('houseList', list)
				this.url = "../bindRoom/bindRoom"
			}
		}
	};
</script>

<style lang="scss" scoped>
	.default {
		text-align: center;
		position: fixed;
		left: 50%;
		top: 40%;
		transform: translate(-50%, -70%);
	}

	.default text {
		color: #AAAAAA;
	}

	.default image {
		height: 180rpx;
		width: 180rpx;
		display: inline-block;
	}
</style>
