<template>
	<view class="device-detail-box">
		<aircondition v-if="type === 'aircondition'" :title="title"></aircondition>
		<lighting v-else-if="type === 'lighting'" :title="title" :space="space"></lighting>
		<meter-show v-else-if="type === 'meter'" :title="title" :space="space"></meter-show>
		<water v-else-if="type === 'water'" :title="title" :space="space"></water>
		<environment v-else-if="type === 'environment'"></environment>
		<control v-else-if="type === 'control'" :title="title"></control>
	</view>
</template>

<script>
	import aircondition from '@/pageIndex/components/device/aircondition';
	import lighting from '@/pageIndex/components/device/lighting';
	import meterShow from '@/pageIndex/components/device/meter';
	import water from '@/pageIndex/components/device/water';
	import environment from '@/pageIndex/components/device/environment';
	import control from '@/pageIndex/components/device/control'
	export default {
		data() {
			return {
				type: '',
				title: '',
				space: ''
			}
		},
		onLoad(body) {
			this.title = body.name;
			this.space = body.space || '';
			uni.setNavigationBarTitle({
				title: body.name
			});
			this.type = body.type
		},
		onPageScroll(e) {
			// 获取页面滚动的垂直距离
			uni.$emit('onPageScroll', e.scrollTop);
		},
		methods: {

		},
		components: {
			aircondition,
			lighting,
			meterShow,
			water,
			environment,
			control
		},
	}
</script>

<style>

</style>