<template>
	<view class="site-wrapper">


		<!-- 站点列表start -->
		<view class="site-items" :style="[{top:CustomBar + 'px'}]">
			<view class="cu-list menu-avatar">
				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in siteListData"
				 :key="index" :data-target="'move-box-' + index">
					<view class="cu-avatar round lg"  v-if="type==1"  style="background-image: url(../../static/site-icon-alarm.png);"></view>
					<view class="cu-avatar round lg" v-else style="background-image: url(../../static/site-icon.png);"></view>
					<view class="content" v-if="type==1" @tap="goAlarmingList">
						<view class="text-grey site-tit">
							{{item.siteName}}
							<text>（共3个未处理告警）</text>
						</view>
						
					</view>
					<view class="content" v-else @tap="goDeviceType">
						<view class="text-grey site-tit">
							{{item.siteName}}
							<text>（共3个设备）</text>

						</view>
						
					</view>
					<view class="nav-right num">
						<view class="text-grey">
							<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
						</view>
					</view>


				</view>
			</view>

		</view>
		<!-- 站点列表end -->


	</view>

</template>

<script>
	import json from '../../data/json.js';

	export default {
		data() {
			return {
				type: '0',

				siteListData: json.siteListData,
				modalName: null,
				listTouchStart: 0,
				listTouchDirection: null,
				CustomBar: this.CustomBar,
			};
		},

		onLoad: function(option) {
			console.log(option.type); //打印出上个页面传递的参数。
			this.type = option.type;
		},
		methods: {



			// 页面跳转
			goAlarmingList() {
				uni.navigateTo({
					url: '/pages/alarmingList/alarmingList',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			goDeviceType() {
				uni.navigateTo({
					url: '/pages/deviceType/deviceType',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},




		}

	}
</script>

<style>

</style>
