<template>
	<view class="page">
		<u-navbar :title="tit" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
			title-size='36' height='50' id="navbar">
		</u-navbar>
		<view class="box">
			<view class="tongji">
				<view class="one" @click="btngundong('section1',0)">
					<view class="kg" v-if="gateSnflag == false">无</view>
					<view class="kg" v-else> <text v-if="gateSnobj.device.powerStatus == 0">关</text> <text
							v-if="gateSnobj.device.powerStatus == 1">开</text> </view>
					<view class="gn">店门</view>
					<image v-if="tabindex == 0" src="https://api.ccttiot.com/smartmeter/img/static/uZNimi3DEsGWsjfJm2Bg"
						mode=""></image>
				</view>
				<view class="xian"></view>
				<view class="one" @click="btngundong('section2',1)">
					<view class="kg">空闲 <text>{{roomobj.idleRoomNum == null ? '--' : roomobj.idleRoomNum}}</text>
					</view>
					<view class="gn">房间</view>
					<image v-if="tabindex == 1" src="https://api.ccttiot.com/smartmeter/img/static/uZNimi3DEsGWsjfJm2Bg"
						mode=""></image>
				</view>
				<view class="xian"></view>
				<view class="one" @click="btngundong('section3',2)">
					<view class="kg">空闲
						<text>{{roomobj.idleEquipmentNum == null ? '--' : roomobj.idleEquipmentNum}}</text> </view>
					<view class="gn">大厅</view>
					<image v-if="tabindex == 2" src="https://api.ccttiot.com/smartmeter/img/static/uZNimi3DEsGWsjfJm2Bg"
						mode=""></image>
				</view>
				<view class="xian"></view>
				<view class="one" @click="btngundong('section4',3)">
					<view class="kg" style="color: #FC902A;">数量
						<text>{{roomobj.toiletNum == null ? '--' : roomobj.toiletNum}}</text></view>
					<view class="gn">卫生间</view>
					<image v-if="tabindex == 3" src="https://api.ccttiot.com/smartmeter/img/static/uZNimi3DEsGWsjfJm2Bg"
						mode=""></image>
				</view>
			</view>
			<view class="damen" id="section1" style="margin-top: 10vh;">
				<view class="name" style="color: #48893B;">
					店门配置
				</view>
				<view class="menbj" @click="btnmendianxq">
					<view class="top">
						<view class="lt">
							<text style="font-weight: 600;font-size: 36rpx;">店门</text> <text
								v-if="gateSnobj.device.onlineStatus == 0" class="lixian">设备离线</text>
						</view>
						<view class="rt" v-if="!gateSnflag">
							<text></text> 未绑定
						</view>
						<view class="rt" v-if="gateSnobj.device.powerStatus == 0">
							<text></text> 已关闭
						</view>
						<view class="rt" style="color: #48893B;" v-if="gateSnobj.device.powerStatus == 1">
							<text style="background-color: #48893B;"></text> 已开启
						</view>
					</view>
					<view class="bot" v-if="gateSnobj.device.sn">
						<view class="lt" style="color: #ccc;font-size: 24rpx;" v-if="gateSnobj.unlockCondition == 1">
							开门条件:有当前订单才能进入门店
						</view>
						<view class="lt" style="color: #ccc;font-size: 24rpx;" v-if="gateSnobj.unlockCondition == 2">
							开门条件:有历史订单才能进入门店
						</view>
						<view class="lt" style="color: #ccc;font-size: 24rpx;" v-if="gateSnobj.unlockCondition == 3">
							开门条件:无条件
						</view>
						<view class="rt">
							<image v-if="gateSnobj.device.powerStatus == 0" @click.stop="btndmkg(1)"
								src="https://api.ccttiot.com/smartmeter/img/static/u4Btme5ARjeAyvvTjgBF" mode="">
							</image>
							<image v-if="gateSnobj.device.powerStatus == 1" @click.stop="btndmkg(0)"
								src="https://api.ccttiot.com/smartmeter/img/static/ua6R9hsgQZTfahcpaA8G" mode="">
							</image>
						</view>
					</view>
				</view>
			</view>
			<!-- 房间 --><!-- 房间 --><!-- 房间 --><!-- 房间 --><!-- 房间 --><!-- 房间 --><!-- 房间 --><!-- 房间 --><!-- 房间 -->
			<view class="" id="section2">
				<view class="namess">
					房间
				</view>
				<view class="" v-if="roomList != ''">
					<view class="damen" v-for="(item,index) in roomList" :key="index" @click="btnroomxq(item)">
						<view class="name">
							{{item.roomName}}
						</view>
						<view class="fjlist">
							<view class="fj_item" v-for="(val,indexs) in item.equipmentList" :key="indexs"
								:id="val.sn == null ? 'active' : ''">
								<view class="lts">
									<view class="name">
										<text>{{val.name}}</text>
										<text v-if="val.device.onlineStatus == 0"
											style="font-size: 28rpx;font-weight: 400;color: #969696;margin-top: 10rpx;">设备离线</text>
									</view>
									<view class="zt" v-if="item.status == 1">
										<text>运营中</text>
									</view>
									<view style="color: #ccc;" class="zt" v-if="item.status == 0">
										<text
											style="background-color: #ccc; display: inline-block; width: 0; height: 0;"></text>
										歇业中
									</view>
									<view style="color: #ccc;" class="zt" v-if="item.status == 8">
										<text
											style="background-color: #ccc; display: inline-block; width: 0; height: 0;"></text>
										下线维护
									</view>
								</view>
								<view class="rts">
									<view class="rt" v-if="!val.device.sn">
										<text></text> 未绑定
									</view>
									<view class="rt" v-if="val.device.powerStatus == 0">
										<text></text> 已关闭
									</view>
									<view class="rt" style="color: #48893B;" v-if="val.device.powerStatus == 1">
										<text style="background-color: #48893B;"></text> 已开启
									</view>
									<image src="https://api.ccttiot.com/smartmeter/img/static/u4Btme5ARjeAyvvTjgBF"
										@click.stop="btnroomkg(1,indexs,item)" mode=""
										v-if="val.device.powerStatus == 0"></image>
									<image src="https://api.ccttiot.com/smartmeter/img/static/ua6R9hsgQZTfahcpaA8G"
										@click.stop="btnroomkg(0,indexs,item)" mode=""
										v-if="val.device.powerStatus == 1"></image>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<!-- 大厅 --> <!-- 大厅 --> <!-- 大厅 --> <!-- 大厅 --> <!-- 大厅 --> <!-- 大厅 --> <!-- 大厅 -->
			<view class="damen" id="section3">
				<view class="shangdt">
					<view class="name" style="color: #48893B;">
						大厅 <text class="stext" @click="btnshow(1)">添加</text>
					</view>
					<view class="quankai" v-if="datingobj.equipmentList">
						<view class="" @click="btndtguan">全关</view>
						<view class="" @click="btndtkai">全开</view>
					</view>
				</view>
				<view class="menbj" v-if="datingobj.equipmentList" v-for="(item,index) in datingobj.equipmentList"
					@click="btndating(item)" :key="index">
					<view class="top">
						<view class="lt">
							<text style="font-weight: 600;">{{item.name}}</text> <text
								v-if="item.device.onlineStatus == 0" class="lixian">设备离线</text>
						</view>
						<view class="rt" v-if="!item.device.sn">
							<text></text> 未绑定
						</view>
						<view class="rt" v-if="item.device.powerStatus == 0">
							<text></text> 已关闭
						</view>
						<view class="rt" style="color: #48893B;" v-if="item.device.powerStatus == 1">
							<text style="background-color: #48893B;"></text> 已开启
						</view>
					</view>
					<view class="bot" v-if="item.device.sn">
						<view class="lt">
							SN:{{item.device.sn}}
						</view>
						<view class="rt">
							<image src="https://api.ccttiot.com/smartmeter/img/static/u4Btme5ARjeAyvvTjgBF"
								@click.stop="btndtkg(1,index,item)" mode="" v-if="item.device.powerStatus == 0"></image>
							<image src="https://api.ccttiot.com/smartmeter/img/static/ua6R9hsgQZTfahcpaA8G"
								@click.stop="btndtkg(0,index,item)" mode="" v-if="item.device.powerStatus == 1"></image>
						</view>
					</view>
				</view>
			</view>
			<!-- 卫生间 --> <!-- 卫生间 --><!-- 卫生间 --><!-- 卫生间 --><!-- 卫生间 --><!-- 卫生间 --><!-- 卫生间 --><!-- 卫生间 -->
			<view class="damen" id="section4">
				<view class="shangdt">
					<view class="name" style="color: #48893B;">
						卫生间配置
					</view>
					<view class="quankai">
						<view class="" @click="btnshow(2)">添加</view>
					</view>
				</view>
				<view class="menbj" v-if="cesuolist != ''" v-for="(item,index) in cesuolist[0].equipmentList"
					@click="btncesuo(item)" :key="index">
					<view class="top">
						<view class="lt">
							<text style="font-weight: 600;">{{item.name}}</text> <text
								v-if="item.device.onlineStatus == 0" class="lixian">设备离线</text>
						</view>
						<view class="rt" v-if="item.device.sn == null">
							<text></text> 未绑定
						</view>
						<view class="rt" v-if="item.device.powerStatus == 0">
							<text></text> 已关闭
						</view>
						<view class="rt" style="color: #48893B;" v-if="item.device.powerStatus == 1">
							<text style="background-color: #48893B;"></text> 已开启
						</view>
					</view>
					<view class="bot" v-if="item.device.sn">
						<view class="lt">
							无条件进入卫生间
						</view>
						<view class="rt">
							<image src="https://api.ccttiot.com/smartmeter/img/static/u4Btme5ARjeAyvvTjgBF"
								@click.stop="btncskg(1,index,item)" mode="" v-if="item.device.powerStatus == 0"></image>
							<image src="https://api.ccttiot.com/smartmeter/img/static/ua6R9hsgQZTfahcpaA8G"
								@click.stop="btncskg(0,index,item)" mode="" v-if="item.device.powerStatus == 1"></image>
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="mask" v-if="xuanzeflag"></view>
		<view class="xuanze" v-if="xuanzeflag">
			<view class="top">
				<view>添加门店配置</view>
				<view @click="xuanzeflag = false">
					<image src="https://api.ccttiot.com/smartmeter/img/static/uAd1csWlbqF423arI5b6" mode=""></image>
				</view>
			</view>
			<view class="changj">
				<!-- <view class="changj_item" @click="btnshop(1)">
					<image src="https://api.ccttiot.com/smartmeter/img/static/uh1K6Blj2rD2ZI12TsP8" mode=""></image>
				</view> -->
				<view class="changj_item" @click="btnshop(2)">
					<image src="https://api.ccttiot.com/smartmeter/img/static/uMeIwTENsMFpPSxGsEox" mode=""></image>
				</view>
				<!-- <view class="changj_item" @click="btnshop(3)">
					<image src="https://api.ccttiot.com/smartmeter/img/static/uay155Dhu3aokS6H6ZC2" mode=""></image>
				</view> -->
				<!-- <view class="changj_item" @click="btnshop(4)">
					<image src="https://api.ccttiot.com/smartmeter/img/static/uq9FKP1ubw5gG5cCPE0S" mode=""></image>
				</view> -->
			</view>
		</view>

		<view class="anniu">
			<view class="xinjian" @click="btnedit">
				编辑
			</view>
			<view class="queren" @click="btnshop(2)">
				新增房间
			</view>
			<!-- <view class="queren" @click="btnroom">
				门店配置
			</view> -->
		</view>

		<view class="mask" style="z-index: 3;" v-if="addmenflag"></view>
		<view class="addmen" v-if="addmenflag">
			<view class="top">
				<view class="cha" @click="addmenflag = false">
					×
				</view>
				<view class="name">
					请选择添加大门方式
				</view>
			</view>
			<view class="one" @click="btnsaoma">
				<view class="lt">
					<view class="saoma">
						扫码添加
					</view>
					<view class="saomas">
						扫描设备上的二维码
					</view>
					<view class="saomas">
						设置大门
					</view>
				</view>
				<view class="rt">
					<image src="https://api.ccttiot.com/smartmeter/img/static/ukzEfdUUjPKUUOxonIgm" mode=""></image>
				</view>
			</view>
			<view class="one" @click="btntouf">
				<view class="lt">
					<view class="saoma">
						未投放设备列表添加
					</view>
					<view class="saomas">
						选择列表中的设备
					</view>
					<view class="saomas">
						设置大门
					</view>
				</view>
				<view class="rt">
					<image src="https://api.ccttiot.com/smartmeter/img/static/ukzEfdUUjPKUUOxonIgm" mode=""></image>
				</view>
			</view>
		</view>

		<view class="mask" style="z-index: 3;" v-if="cesuoflag"></view>
		<view class="addmen" v-if="cesuoflag">
			<view class="top">
				<view class="cha" @click="cesuoflag = false">
					×
				</view>
				<view class="name">
					请选择添加卫生间方式
				</view>
			</view>
			<view class="one" @click="btntoufcesuo">
				<view class="lt">
					<view class="saoma">
						扫码添加
					</view>
					<view class="saomas">
						扫描设备上的二维码
					</view>
					<view class="saomas">
						设置卫生间门
					</view>
				</view>
				<view class="rt">
					<image src="https://api.ccttiot.com/smartmeter/img/static/ukzEfdUUjPKUUOxonIgm" mode=""></image>
				</view>
			</view>
			<view class="one" @click="btntoufcesuo">
				<view class="lt">
					<view class="saoma">
						未投放设备列表添加
					</view>
					<view class="saomas">
						选择列表中的设备
					</view>
					<view class="saomas">
						设置卫生间门
					</view>
				</view>
				<view class="rt">
					<image src="https://api.ccttiot.com/smartmeter/img/static/ukzEfdUUjPKUUOxonIgm" mode=""></image>
				</view>
			</view>
		</view>

		<u-select v-model="dtshow" :list="dtlist" @confirm="dtconfirm"></u-select>
		<view class="boxmask" v-if="dtflag"></view>
		<view class="boxdt" v-if="dtflag">
			<view class="tops">
				添加设施
			</view>
			<view class="name">
				<view class="lt">
					名称
				</view>
				<view class="rt">
					<input type="text" v-model="dtname" placeholder="请输入设施名称" />
					<image src="https://api.ccttiot.com/smartmeter/img/static/uCta8cp7uXd1lGjZS6sc" mode=""></image>
				</view>
			</view>
			<view class="name" style="border: none;">
				<view class="lt">
					类型
				</view>
				<view class="rt" @click="dtshow = true">
					{{leixing}}
					<image src="https://api.ccttiot.com/smartmeter/img/static/uCta8cp7uXd1lGjZS6sc" mode=""></image>
				</view>
			</view>
			<view class="but">
				<view class="quxiao" @click="dtflag = false">
					取消
				</view>
				<view class="queding" @click="btnmd">
					确定
				</view>
			</view>
		</view>

		<view class="boxmask" v-if="dtflags"></view>
		<view class="boxdt" v-if="dtflags">
			<view class="tops">
				添加设施
			</view>
			<view class="name">
				<view class="lt">
					名称
				</view>
				<view class="rt">
					<input type="text" v-model="dtname" placeholder="请输入设施名称" />
					<image src="https://api.ccttiot.com/smartmeter/img/static/uCta8cp7uXd1lGjZS6sc" mode=""></image>
				</view>
			</view>
			<view class="name" style="border: none;">
				<view class="lt">
					类型
				</view>
				<view class="rt">
					卫生间 <image src="https://api.ccttiot.com/smartmeter/img/static/uCta8cp7uXd1lGjZS6sc" mode=""></image>
				</view>
			</view>
			<view class="but">
				<view class="quxiao" @click="dtflags = false">
					取消
				</view>
				<view class="queding" @click="btnmds">
					确定
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgc: {
					backgroundColor: "#fff",
				},
				storeId: '',
				roomList: [],
				datingobj: {},
				cesuolist: [],
				list: [],
				show: false,
				roomId: '',
				xuanzeflag: false,
				addmenflag: false,
				gateSnobj: {},
				gateSnflag: false,
				cesuoflag: false,
				leixing: '请选择类型',
				dtshow: false,
				dtflags: false,
				dtlist: [{
						value: '2',
						label: '麻将桌'
					},
					{
						value: '3',
						label: '台球桌'
					},
				],
				dttype: '',
				dtflag: false,
				dtname: '',
				tabindex: 0,
				roomobj: {},
				tit:''
			}
		},
		onLoad(option) {
			this.storeId = option.storeId
			this.tit = option.tit
		},
		onShow() {
			this.roomList = []
			this.cesuolist = []
			this.gateSnflag = false
			this.getxq()
			this.getmendian()
		},
		methods: {
			// 点击tab进行滚动查找 
			btngundong(section, index) {
				this.tabindex = index
				const query = uni.createSelectorQuery().in(this)
				query.select(`#${section}`).boundingClientRect((rectObj) => {
					if (rectObj) {
						uni.pageScrollTo({
							scrollTop: rectObj.top - 180,
							duration: 300
						})
					} else {
						console.error('页面滚动失败')
					}
				}).exec()
			},


			// 点击大厅全关按钮
			btndtguan() {
				this.$u.post(`/app/device/adminAll/${this.datingobj.roomId}/switch?open=false`).then(res => {
					if (res.code == 200) {
						uni.showToast({
							title: '全部关闭成功',
							icon: 'success',
							duration: 2000
						})
						this.datingobj.equipmentList.forEach(item => {
							item.device.powerStatus = 0
						})
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						})
					}
				})
			},
			// 点击大厅全开按钮
			btndtkai() {
				this.$u.post(`/app/device/adminAll/${this.datingobj.roomId}/switch?open=true`).then(res => {
					if (res.code == 200) {
						uni.showToast({
							title: '全部开启成功',
							icon: 'success',
							duration: 2000
						})
						this.datingobj.equipmentList.forEach(item => {
							item.device.powerStatus = 1
						})
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						})
					}
				})
			},
			// 点击控制卫生间设施大门
			btncskg(num, index, item) {
				let equipmentId = item.equipmentId
				if (num == 0) { //关闭
					this.$u.put(`/app/device/adminMch/${equipmentId}/switch?open=false`).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '关闭成功',
								icon: 'success',
								duration: 2000
							})
							this.cesuolist[0].equipmentList.forEach(item => {
								if (item.equipmentId == equipmentId) {
									item.device.powerStatus = 0
								}
							})
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					})
				} else { //开启
					this.$u.put(`/app/device/adminMch/${equipmentId}/switch?open=true`).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '开启成功',
								icon: 'success',
								duration: 2000
							})
							this.cesuolist[0].equipmentList.forEach(item => {
								if (item.equipmentId == equipmentId) {
									item.device.powerStatus = 1
								}
							})
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					})
				}
			},
			// 点击控制大厅设施
			btndtkg(num, index, item) {
				let equipmentId = item.equipmentId
				if (num == 0) { //关闭
					this.$u.put(`/app/device/adminMch/${equipmentId}/switch?open=false`).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '关闭成功',
								icon: 'success',
								duration: 2000
							})
							this.datingobj.equipmentList.forEach(item => {
								if (item.equipmentId == equipmentId) {
									item.device.powerStatus = 0
								}
							})
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					})
				} else { //开启
					this.$u.put(`/app/device/adminMch/${equipmentId}/switch?open=true`).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '开启成功',
								icon: 'success',
								duration: 2000
							})
							this.datingobj.equipmentList.forEach(item => {
								if (item.equipmentId == equipmentId) {
									item.device.powerStatus = 1
								}
							})
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					})
				}
			},
			// 点击控制房间设施
			btnroomkg(num, index, item) {
				let equipmentId = item.equipmentList[index].equipmentId
				if (num == 0) { //关闭
					this.$u.put(`/app/device/adminMch/${equipmentId}/switch?open=false`).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '关闭成功',
								icon: 'success',
								duration: 2000
							})
							this.roomList.forEach(item => {
								item.equipmentList.forEach(val => {
									if (val.equipmentId == equipmentId) {
										val.device.powerStatus = 0
									}
								})
							})
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					})
				} else { //开启
					this.$u.put(`/app/device/adminMch/${equipmentId}/switch?open=true`).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '开启成功',
								icon: 'success',
								duration: 2000
							})
							this.roomList.forEach(item => {
								item.equipmentList.forEach(val => {
									if (val.equipmentId == equipmentId) {
										val.device.powerStatus = 1
									}
								})
							})
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					})
				}
			},
			// 点击控制大门
			btndmkg(num) {
				if (num == 0) { //关闭
					this.$u.put(`/app/device/admin/${this.gateSnobj.deviceId}/switch?open=false`).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '关闭成功',
								icon: 'success',
								duration: 2000
							})
							this.gateSnobj.device.powerStatus = 0
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					})
				} else { //开启
					this.$u.put(`/app/device/admin/${this.gateSnobj.deviceId}/switch?open=true`).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '开启成功',
								icon: 'success',
								duration: 2000
							})
							this.gateSnobj.device.powerStatus = 1
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					})
				}
			},

			// 确认添加设施类型
			dtconfirm(e) {
				this.type = e[0].value
				this.leixing = e[0].label
			},
			// 点击添加大厅and厕所设施
			btnshow(num) {
				if (num == 1) {
					this.roomId = this.datingobj.roomId
					this.dtflag = true
				} else if (num == 2) {
					// this.roomId = this.cesuolist[0].roomId
					// this.dtflags = true
					uni.navigateTo({
						url: '/page_shanghu/cesuoxq?roomId=' + this.cesuolist[0].roomId
					})
				}
			},
			// 确认添加厕所设施
			btnmds() {
				let data = {
					name: this.dtname,
					roomId: this.roomId,
					type: 5,
					picture: ''
				}
				this.$u.post(`/app/equipment`, data).then(res => {
					if (res.code == 200) {
						uni.showToast({
							title: '添加成功',
							icon: 'success',
							duration: 2000
						})
						this.dtflag = false
						this.roomList = []
						this.cesuolist = []
						this.getxq()
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						})
					}
				})
			},
			// 确认添加大厅设施
			btnmd() {
				let data = {
					name: this.dtname,
					roomId: this.roomId,
					type: this.type,
					picture: ''
				}
				this.$u.post(`/app/equipment`, data).then(res => {
					if (res.code == 200) {
						uni.showToast({
							title: '添加成功',
							icon: 'success',
							duration: 2000
						})
						this.dtflag = false
						this.roomList = []
						this.cesuolist = []
						this.getxq()
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						})
					}
				})
			},
			// 点击跳转到大门详情
			btnmendianxq() {
				uni.navigateTo({
					url: '/page_shanghu/toufsb?storeId=' + this.storeId
				})
			},
			// 点击跳转编辑门店
			btnedit() {
				uni.navigateTo({
					url: '/page_shanghu/editshop?storeId=' + this.storeId
				})
			},
			// 点击大厅跳转到大厅设施详情
			btndating(item) {
				uni.navigateTo({
					url: '/page_moban/datingxq?equipmentId=' + item.equipmentId
				})
			},
			// 点击厕所跳转到厕所设施详情
			btncesuo(item) {
				uni.navigateTo({
					url: '/page_shanghu/cesuoxq?equipmentId=' + item.equipmentId
				})
			},
			// 点击房间跳转到房间详情
			btnroomxq(item) {
				uni.navigateTo({
					url: '/page_shanghu/roomxq?roomId=' + item.roomId + '&storeId=' + this.storeId
				})
			},

			// 检查 deviceList 中是否至少有一个设备的 onlineStatus 为 0
			hasOfflineDevice(deviceList) {
				if (deviceList == !null) {
					return deviceList.some(device => device.onlineStatus == 0)
				}
			},
			// 点击大门 房间等
			btnshop(num) {
				this.xuanzeflag = false
				if (num == 1) {
					this.addmenflag = true
				} else if (num == 2) {
					uni.navigateTo({
						url: '/page_shanghu/addtoom?storeId=' + this.storeId
					})
				} else if (num == 3) {
					uni.navigateTo({
						url: '/page_moban/datingxq?storeId=' + this.storeId
					})
				} else if (num == 4) {
					this.cesuoflag = true
				}
			},
			// 点击未投放厕所
			btntoufcesuo() {
				uni.navigateTo({
					url: '/page_moban/weicousuosb'
				})
			},
			
			
			// 点击门店配置
			btnroom() {
				this.xuanzeflag = true
			},
			// 根据店铺查大门
			getmendian() {
				this.$u.get(`/app/equipment/gateGate?storeId=${this.storeId}`).then(res => {
					if (res.code == 200) {
						this.gateSnobj = res.data
						if (this.gateSnobj.device) {
							this.gateSnflag = true
						} else {
							this.gateSnflag = false
						}
					}
				})
			},
			// 请求门店详情
			getxq() {
				this.$u.get(`app/store/mch/${this.storeId}`).then(res => {
					if (res.code == 200) {
						this.roomobj = res.data
						res.data.roomList.forEach(item => {
							if (item.type2 == 1) {
								this.roomList.push(item)
							} else if (item.type2 == 2) {
								this.datingobj = item
							} else if (item.type2 == 3) {
								this.cesuolist.push(item)
							}
						})
					}
				})
			},

		}
	}
</script>

<style lang="scss">
	/deep/ .u-iconfont,
	/deep/ .u-title {
		padding-bottom: 20rpx;
	}

	.lixian {
		color: #969696 !important;
	}

	.boxmask {
		width: 100%;
		height: 100vh;
		background-color: #000;
		opacity: .3;
		z-index: 2;
		position: fixed;
		top: 0;
		left: 0;
	}

	.boxdt {
		position: fixed;
		z-index: 2;
		top: 500rpx;
		left: 50%;
		transform: translateX(-50%);
		width: 580rpx;
		max-height: 408rpx;
		background: #FFFFFF;
		margin: auto;
		margin-top: 22rpx;
		padding-top: 20rpx;
		box-sizing: border-box;
		border-radius: 20rpx;

		.but {
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-top: 1px solid #D8D8D8;
			font-size: 32rpx;
			font-weight: 600;

			.quxiao {
				border-right: 1px solid #D8D8D8;
			}

			view {
				width: 50%;
				height: 100rpx;
				line-height: 100rpx;
				text-align: center;
			}
		}

		.tops {
			width: 100%;
			text-align: center;
			margin-top: 20rpx;
			margin-bottom: 20rpx;
			font-size: 36rpx;
		}

		.name {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: auto;
			height: 80rpx;
			padding: 0 30rpx;
			margin-bottom: 10rpx;
			box-sizing: border-box;

			.lt {
				font-size: 32rpx;
				color: #3D3D3D;
			}

			.rt {
				display: flex;
				align-items: center;

				input {
					text-align: right;
					width: 200rpx;
				}

				image {
					width: 14rpx;
					height: 42rpx;
					margin-left: 10rpx;
				}
			}
		}
	}

	.namess {
		font-weight: 600;
		font-size: 36rpx;
		color: #48893B;
		text-align: left;
		width: 100%;
		padding: 0 30rpx;
		margin-top: 30rpx;
		box-sizing: border-box;
	}

	.addmen {
		width: 694rpx;
		height: 702rpx;
		background: linear-gradient(180deg, #DEF1DA 0%, #FFFFFF 100%, #FFFFFF 100%);
		border-radius: 36rpx 36rpx 36rpx 36rpx;
		position: fixed;
		top: 464rpx;
		left: 50%;
		transform: translateX(-50%);
		z-index: 3;
		box-shadow: 1px 2px 4px -3px;

		.one {
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: 100%;

			.rt {
				image {
					width: 60rpx;
					height: 60rpx;
				}
			}

			.saoma {
				font-weight: 600;
				font-size: 36rpx;
				color: #48893B;
				margin-top: 10rpx;
			}

			.saomas {
				font-size: 28rpx;
				color: #48893B;
				margin-top: 10rpx;
			}

			width: 584rpx;
			height: 224rpx;
			border: 2rpx solid #48893B;
			border-radius: 20rpx;
			margin: auto;
			margin-top: 48rpx;
			padding: 38rpx 44rpx;
			box-sizing: border-box;
		}

		.top {
			display: flex;
			flex-wrap: wrap;
			padding: 0 26rpx;
			box-sizing: border-box;

			.name {
				font-weight: 600;
				font-size: 44rpx;
				color: #48893B;
				width: 100%;
				text-align: center;
				position: absolute;
				top: 56rpx;
				left: 50%;
				transform: translateX(-50%);
			}

			.cha {
				font-size: 68rpx;
				font-weight: 600;
				width: 100%;
				text-align: right;
			}
		}
	}

	page {
		background: #F6F6F6;
	}

	.box {
		width: 100%;
		// height: 80vh;
		// overflow: scroll;
		padding-bottom: 210rpx;
		box-sizing: border-box;
	}

	.xuanze {
		width: 750rpx;
		height: 494rpx;
		background: #FFFFFF;
		border-radius: 40rpx 40rpx 0 0;
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 1;
		padding: 42rpx 62rpx;
		box-sizing: border-box;

		.changj {
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;

			.changj_item {
				width: 302rpx;
				height: 110rpx;
				background: #F0F0F0;
				border-radius: 6rpx 6rpx 6rpx 6rpx;
				font-weight: 600;
				text-align: center;
				line-height: 110rpx;
				font-size: 36rpx;
				margin-top: 40rpx;
				color: #3D3D3D;
			}
		}

		.top {
			display: flex;
			justify-content: space-between;

			view {
				font-weight: 600;
				font-size: 36rpx;
				color: #3D3D3D;

				image {
					width: 50rpx;
					height: 50rpx;
				}
			}
		}
	}

	.mask {
		width: 100%;
		height: 100vh;
		background-color: #000;
		opacity: .3;
		position: fixed;
		top: 0;
		left: 0;
	}

	.damen {
		padding: 0 30rpx;
		box-sizing: border-box;
		margin-top: 38rpx;

		.shangdt {
			display: flex;
			justify-content: space-between;

			.quankai {
				display: flex;

				view {
					border-radius: 10rpx;
					margin-left: 20rpx;
					width: 100rpx;
					height: 50rpx;
					line-height: 50rpx;
					color: #fff;
					background-color: #48893B;
					text-align: center;
				}
			}
		}

		.fjlist {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;
			margin-top: 16rpx;
			width: 686rpx;
			max-height: 1408rpx;
			background: #FFFFFF;
			padding: 16rpx;
			padding-top: 0;
			box-sizing: border-box;
			border-radius: 20rpx 20rpx 20rpx 20rpx;

			.fj_item {
				margin-top: 16rpx;
				width: 318rpx;
				height: 178rpx;
				background: #F9F9F9;
				padding: 26rpx;
				box-sizing: border-box;
				display: flex;
				justify-content: space-between;

				.rts {
					text-align: right;
					color: #7C7C7C;

					image {
						width: 50rpx;
						height: 50rpx;
						margin-top: 30rpx;
					}

					.rt {
						display: flex;
						align-items: center;

						text {
							background-color: #7C7C7C;
							width: 10rpx;
							height: 10rpx;
							border-radius: 50%;
							margin-right: 10rpx;
						}
					}
				}

				.zt {
					font-size: 28rpx;
					color: #FC902A;
					margin-top: 8rpx;
				}

				.name {

					// display: flex;
					// justify-content: space-between;
					text {
						display: block;
						font-weight: 600;
						font-size: 36rpx;
						color: #3D3D3D;
					}
				}
			}
		}

		.name {
			font-weight: 600;
			font-size: 36rpx;
			color: #3D3D3D;
			text-align: left;

			.stext {
				display: inline-block;
				font-weight: 400;
				width: 120rpx;
				height: 50rpx;
				line-height: 50rpx;
				background-color: #48893B;
				color: #fff;
				margin-left: 20rpx;
				border-radius: 10rpx;
				font-size: 28rpx;
				text-align: center;
			}
		}

		.menbj {
			width: 686rpx;
			max-height: 170rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			padding: 30rpx;
			box-sizing: border-box;
			margin-top: 28rpx;

			.bot {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-top: 20rpx;

				.lt {
					font-size: 28rpx;
					color: #3D3D3D;
				}

				.rt {
					image {
						width: 50rpx;
						height: 50rpx;
					}
				}
			}

			.top {
				display: flex;
				justify-content: space-between;

				.lt {
					text {
						font-size: 28rpx;
						color: #3D3D3D;
						margin-right: 54rpx;
					}
				}

				.rt {
					display: flex;
					align-items: center;
					font-size: 28rpx;
					color: #7C7C7C;
					font-weight: 600;

					text {
						width: 10rpx;
						height: 10rpx;
						background-color: #7C7C7C;
						border-radius: 50%;
						margin-right: 10rpx;
					}
				}
			}
		}
	}

	.tongji {
		width: 750rpx;
		height: 150rpx;
		background: #FFFFFF;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		box-sizing: border-box;
		margin-top: 14rpx;
		display: flex;
		align-items: center;
		position: fixed;
		top: 10vh;

		.one {
			width: 188rpx;
			text-align: center;

			.kg {
				font-weight: 600;
				font-size: 24rpx;
				color: #7C7C7C;

				text {
					color: #48893B;
					margin-left: 4rpx;
				}
			}

			.gn {
				font-weight: 600;
				font-size: 32rpx;
				color: #3D3D3D;
				margin-top: 10rpx;
			}

			image {
				width: 58rpx;
				height: 14rpx;
			}
		}

		.xian {
			width: 1px;
			height: 62rpx;
			background-color: #7C7C7C;
		}
	}

	.list {
		margin-top: 30rpx;
		height: 70vh;
		overflow: scroll;

		.list_item {
			width: 100%;
			height: 200rpx;
			line-height: 100rpx;
			text-align: center;
			border: 1px solid;
		}
	}

	.anniu {
		width: 750rpx;
		height: 152rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 0, 0, 0.3);
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		position: fixed;
		left: 0;
		bottom: 0;
		display: flex;
		justify-content: space-between;
		padding: 0 36rpx;
		box-sizing: border-box;
		padding-top: 24rpx;

		.queren {
			width: 330rpx;
			height: 104rpx;
			background: #48893B;
			text-align: center;
			line-height: 104rpx;
			font-weight: 600;
			font-size: 36rpx;
			color: #FFFFFF;
			border-radius: 20rpx;
		}

		.xinjian {
			width: 330rpx;
			height: 104rpx;
			border: 2rpx solid #48893B;
			border-radius: 20rpx;
			text-align: center;
			line-height: 104rpx;
			font-weight: 600;
			font-size: 36rpx;
			color: #48893B;
		}
	}
</style>