<!-- 空调 -->
<template>
	<view class="airConditioning">
		<view class="null-box" @click="backPage()"></view>
		<!-- 空调按钮 -->
		<view class="panel">
			<view class="panel-t">
				<view>{{switchStatus==0?'空调未开启':'空调已开启'}}</view>
				<view @click="switchFun()" :class="switchStatus==0?'color-A':'color-B'">{{switchStatus==0?'开启':'关闭'}}</view>
			</view>
			<view class="panel-m" >
				<view @click="temperatureFun(index)" :class="keystrokeIndex==index?'color-C':''" v-for="(item,index) in keystrokeData">{{item}}</view>
			</view>
			<view class="panel-b">
				<view @click="subtract">-</view>
				<view>{{result}}℃</view>
				<view @click="add">+</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {} from '@/api/basicsModules/index.js'
	import { config } from '@/api/request/config.js'
	export default {
		name: "airConditioning",
		props: {
			subjectData: {},
		},
		data() {
			return {
				baseUrl:config.base_url,
				//开关状态
				switchStatus:0,
				keystrokeData:['制热	','制冷','送风'],
				keystrokeIndex:0,
				num1: 0,	
			}
		},
		computed: {
		    result() {
		      return this.num1;
		    },
		},
		created() {

		},
		mounted() {
			
		},
		methods: {
			// 返回按钮
			backPage(){
			  this.$parent.buttonClick('conditioningClose','');
			},
			switchFun(){
				if(this.switchStatus==0){
					this.$set(this, 'switchStatus',1);
				}else{
					this.$set(this, 'switchStatus',0);
				}
			},
			temperatureFun(index){
				this.$set(this, 'keystrokeIndex',index);
			},
			add() {
			  this.num1 += 1;
			},
			subtract() {
			  this.num1 -= 1;
			},	  
			
			
		},
	}
</script>

<style lang="stylus" scoped>
	.airConditioning{
		height: 100%;
		width: 100%;
		position: fixed;
		top: 0;
		display: flex;
		flex-direction: column;
		z-index: 10;
		background: rgba(0, 0, 0, 0.2);
		.null-box {
		  flex: 1;
		}
		/* 空调面板 */
		.panel{
			width: 710rpx;
			height: 430rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			padding:34rpx 30rpx 0rpx;
			box-sizing: border-box;
			position: absolute;
			top: 320rpx;
			left:20rpx;
			.panel-t{
				display: flex;
				justify-content: flex-start;
				align-items: center;
				>view:nth-of-type(1){
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 32rpx;
					color: #333333;
					line-height: 30rpx;
					margin-right: 16rpx;
				}
				.color-A{
					width: 100rpx;
					height: 50rpx;
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 30rpx;
					color: #FFFFFF;
					line-height: 50rpx;
					text-align: center;
					background: #0183FA;
					border-radius: 25rpx;
				}
				.color-B{
					width: 100rpx;
					height: 50rpx;
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 30rpx;
					color: #666666;
					line-height: 50rpx;
					text-align: center;
					background: #E0E0E0;
					border-radius: 25rpx;
				}
			}
			.panel-m{
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-top: 48rpx;
				>view{
					width: 200rpx;
					height: 80rpx;
					border-radius: 10rpx;
					border: 1px solid #E0E0E0;
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 32rpx;
					color: #333333;
					line-height: 80rpx;
					text-align: center;
				}
				.color-C{
					width: 200rpx;
					height: 80rpx;
					border-radius: 10rpx;
					border: 1px solid #E0E0E0;
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 32rpx;
					color: #FFFFFF;
					line-height: 80rpx;
					text-align: center;
					background: #0183FA;
				}
			}
			.panel-b{
				display: flex;
				justify-content: space-between;
				align-items: center;
				width: 650rpx;
				height: 100rpx;
				border-radius: 10rpx;
				border: 1px solid #E0E0E0;
				margin-top: 40rpx;
				>view:nth-of-type(1){
					font-weight: 500;
					font-size: 32rpx;
					color: #333333;
					line-height: 100rpx;
					width: 120rpx;
					text-align: center;
				}
				>view:nth-of-type(2){
					font-weight: 500;
					font-size: 32rpx;
					color: #333333;
					line-height: 30rpx;
				}
				>view:nth-of-type(3){
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 32rpx;
					color: #333333;
					line-height: 100rpx;
					width: 120rpx;
					text-align: center;
				}
			}
		}
		
		
	}
</style>