<template>
	<view>
		<image style="width: 100%;" :src="info.isGateway | bannerFilter" mode="aspectFit"></image>
		<view class="qiun-title-dot-light">设备信息</view>	
		<uni-list>
			<uni-list-item :show-arrow="false" title="设备ID" :note="info.deviceName"></uni-list-item>
			<uni-list-item :show-arrow="false" title="设备名称" :note="info.deviceNickName"></uni-list-item>
			<uni-list-item :show-arrow="false" title="当前状态" :note="info.deviceStatus | statusFilter "></uni-list-item>
			<uni-list-item :show-arrow="false" title="创建时间" :note="info.deviceAddTime"></uni-list-item>
			<uni-list-item :show-arrow="false" title="激活时间" :note="info.deviceActiveTime"></uni-list-item>
			<uni-list-item :show-arrow="false" title="最后上线时间" :note="info.deviceLastTime"></uni-list-item>
		</uni-list>
	</view>
</template>

<script>
import uniList from '@/components/uni-list/uni-list.vue';
import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
export default {
	components: {
		uniList,
		uniListItem
	},
	filters: {
		bannerFilter(type){
			const typeMap = {
				'1': '../../../static/banner1.png',
				'0': '../../../static/banner2.png'
			};
			return typeMap[type];	
		},
		statusFilter(type) {
			const typeMap = {
				'-1': '未激活',
				'0': '离线',
				'1': '上线'
			};
			return typeMap[type];
		}
	},
	props: {
		info: {
			type: Object,
			default: null
		}
	}
};
</script>

<style></style>
