<!-- 删除，单元，修改，添加，管理功能皆未实现 -->
<template>
	<view class="">
		<view  class="data" v-for="(item, index) in list" :key="index">
			<view class="top">
				<view class="left">
					<view class="title">
						<u-icon name="xingming" custom-prefix="custom-icon" size="40" color="#51c75b"></u-icon>
						<text class="padding-left-20">车主姓名：{{item.userName}}</text>
						<text @click.stop="copy(item.userName)" style="text-decoration: underline;" class="text-blue padding-left-20">复制</text>
					</view>
				</view>
			</view>
			<view class="item">
				<view class="left">
					<view style="padding: 0 30rpx;">
						<view class="content flex">
							<u-icon name="chepaihao" custom-prefix="custom-icon" size="40" color="#1296db"></u-icon>
							<text class="text-bold  padding-left-10">车牌号：</text>
							<text>{{item.loginName}}</text>
						</view>
						<view  class="content flex">
							<u-icon name="cheliang" custom-prefix="custom-icon" size="40" color="#fdba4e"></u-icon>
							<text class="text-bold padding-left-10">车辆类型：</text>
							<text class="text-bold" v-text="item.loginPwd?item.loginPwd:'未知'" ></text>
						</view>
						<view  class="content flex">
							<u-icon name="color" custom-prefix="custom-icon" size="40" color="#7fc6ac"></u-icon>
							<text class="text-bold padding-left-10">车身颜色：</text>
							<text  v-text="item.remark?item.remark:'未知'"></text>
						</view>
						<view  class="content flex">
							<u-icon name="shoujihaoma" custom-prefix="custom-icon" size="40" color="#5ca8f0"></u-icon>
							<text class="text-bold padding-left-10">手机号码：</text>
							<text class="text-bold" v-text="item.userMobile" ></text>
						</view>
					</view>
				</view>
			</view>
			<view class="bottom flex" >
				<view @click="edit(item)" class="cu-btn  sm round line-blue" style="margin: 0 10rpx;">
					修改车辆
				</view>
				<view @click="delItem(item)" class="cu-btn  sm round bg-red" style="margin: 0 10rpx;">
					删除车辆
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'card',
	props:{
		list:{
			type:Array,
			default:()=>{
				[]
			}
		}
	},
	data() {
		return {
			loading:false
		};
	},
	created() {
		
	},
	methods:{
		copy(data){
			uni.setClipboardData({
				data:data
			})
		},
		edit(item){
			getApp().globalData.carData=item
			uni.navigateTo({
				url:"/pages/car/add?id="+item.id
			})
		},
		delItem(item){
			this.$emit('delItem',item)
		}
	}
};
</script>

<style lang="scss">
.data {
	width: 710rpx;
	background-color: #ffffff;
	margin: 20rpx auto;
	border-radius: 6rpx;
	box-sizing: border-box;
	padding: 20rpx 10rpx;
	font-size: 28rpx;
	.top {
		display: flex;
		justify-content: space-between;
		padding-bottom: 20rpx;
		border-bottom: 1rpx solid #dedede;
		.left {
			display: flex;
			align-items: center;
			.title {
				margin: 0 10rpx;
				font-size: 30rpx;
			}
		}
		.right{
			margin-right: 10rpx;
		}
	}
	.item {
		margin: 5rpx 0 20rpx 0;
		.content {
			border-bottom: 1rpx dashed #DDDDDD;
			padding: 30rpx 0;
		}
	}
	.bottom {
		display: flex;
		margin-top: 30rpx;
		justify-content: flex-end;
		align-items: center;
	}
}
</style>