<template>

	<view class="">
		<view class="cu-list menu-avatar">
			<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
			 :key="index" :data-target="'move-box-' + index" @tap="goVideoDetail">
				<view class="cu-avatar round lg" :style="`background-image:url(${item.imgUrl})`" style="opacity:.7"></view>
				<view class="content">
					<view class="">{{item.title}}</view>
				</view>
				<view class="nav-right num">
					<view v-if="item.status=='在线'" class="online" >
						{{item.status}}
						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
					</view>
					<view v-else-if="item.status=='离线'" class="text-gray" >
						{{item.status}}
						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
					</view>
					<view v-else="item.status=='故障'" class="error" >
						{{item.status}}
						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				deviceData: [{
						status: '离线',
						imgUrl: '../../static/video-icon-off.png',
						title: 'C59360332',
						num: 6
					}, {
						status: '在线',
						imgUrl: '../../static/video-icon-on.png',
						title: 'C59360332',
						num: 11
					},
					{
						status: '异常',
						imgUrl: '../../static/video-icon-error.png',
						title: 'C59360332',
						num: 6
					}
				],
				modalName: null,

			};
		},
		methods: {
			goVideoDetail() {
				uni.navigateTo({
					url: '/pages/videoDetail/videoDetail',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},


		}

	}
</script>

<style lang="scss">
	
</style>
