page-list.vue 2.23 KB
<template>
	<view class="device-list">
		<view @click="$emit('openDeviceDetail',item)"
			class="list-item" v-for="item in list" :key="item.id">
			<view class="u-flex item">
				<view class="item-text text-clip title-bottom">
					<view>
						<text class="text-span-bold">{{ item.title ? item.title : '' }}</text>
					</view>
				</view>
				<view class="item-text text-clip" v-for="itemChild in item.child">
					<view class="text-container">
						{{$t(itemChild.label)}}:
						<text class="text-span">{{ itemChild.name ? itemChild.name : ''}}</text>
					</view>
				</view>
			</view>
			<view class="item right-item">
				<view class="u-flex" style="margin-top: -6rpx">
					<image class="right-image" :src="item.iconUrl ? item.iconUrl :''" />
					<view>
						<text class="right-text" :style="{ color:item.color ? item.color :'' }">
							{{item.status ? item.status : ''}}
						</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: []
			}
		},
		methods: {
		}
	}
</script>

<style lang="scss" scoped>
	.device-list {
		display: flex;
		flex-direction: column;
		padding-left: 20rpx;
		.list-item:last-child{
			margin-bottom: 40rpx;
		}

		.list-item {
			width: 713rpx;
			// height: 200rpx;
			background-color: #fff;
			margin-top: 24rpx;
			display: flex;
			border-radius: 10px;
			justify-content: space-between;
			position: relative;

			.item {
				margin: 30rpx;
				flex-direction: column;
				justify-content: space-between;

				.item-text {
					width: 480rpx;

					.text-container {
						display: flex;

						.text-span {
							color: #666;
							font-size: 14px;
							display: flex;
							margin-left: 20rpx;
						}
					}



					.text-span-bold {
						color: #333;
						font-size: 15px;
						font-weight: bold;
					}
				}
				.title-bottom{
					margin-bottom: 10rpx;
				}
			}

			.right-item {
				// margin:30rpx 30rpx 30rpx 0 ;
				position: absolute;
				right: 0;
				top: 0;
				.right-image {
					width: 30rpx;
					height: 30rpx;
					margin-top: 5rpx;
					margin-right: 5rpx;
				}

				.right-text {
					color: #377dff;
					font-size: 13px;
					margin-left: 5rpx;
					margin-top: 20rpx;
				}
			}
		}
	}
</style>