<template>
	  <view :id="`zp-id-${order.zp_index}`" :key="order.zp_index" v-for="(order,index) in orderList" class="order-card">
		
		<view class="main-box" :class="index == orderList.length-1 ? '':'bt'">
			<view>
				<u-avatar size="100" :src="order.avatar"></u-avatar>
			</view>
			<view class="right-box">
				<view class="nickname-box">
					<view class="nickname">{{order.nickname}}</view>
					<view class="info">礼物名称：{{order.gift}}×{{order.count}}</view>
					<view class="info">到账金额：{{order.money}}</view>
					<view class="info">心动留言：{{order.msg}}</view>
					<view class="info">
						<text class="weixin">微信：{{order.weixin}}</text>
						<view @tap.stop="onCopy(order.weixin)">
							<u-icon name="outline-copy" custom-prefix="iconfont"></u-icon>
						</view>
					</view>
					<view class="info">订单时间：{{order.createTimeStr}}</view> 
				</view>
				<view class="price-box"> 
					<text class="price">{{order.payMoney}}</text>
				</view>
			</view>
		</view>
		
	  </view>
  
</template>

<script>
	import sheep from '@/sheep';
	export default {
		components: {
			
		},
		props: {
			virtualList: {
				type: Array,
				default: [],
			},
		},
		data() {
			return {
				
			}
		},
		computed: {
			orderList() {
				this.virtualList.forEach((order) => order.createTimeStr = sheep.$helper.timeFormat(order.createTime, 'yyyy-mm-dd hh:MM:ss'));
				return this.virtualList;
			},
		},
		methods: {
			// 复制
			onCopy(text) {
			  sheep.$helper.copyText(text);
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.order-card {
		padding: 0 10px;
		background-color: #fff;
		display: flex;
		flex-direction: column;
		flex: 1;
		
		.no-box {
			display: flex;
			align-items: center;
			justify-content: space-between;
			flex: 1;
			padding-bottom: 10px;
			color: rgb(100, 101, 102);
			
			.order-no {
				
				.number {
					margin-left: 5px;
					font-size: 22rpx;
				}
			}
			
			.status {
				font-size: 22rpx;
			}
		}
		
		.main-box {
			display: flex;
			padding: 10px 0;
			
			.right-box {
				display: flex;
				justify-content: space-between;
				flex: 1;
				align-items: center;
				margin-left: 10px;
				
				.nickname {
					font-size: 12px;
					font-weight: bold;
					margin-bottom: 10px;
				}
				
				.info {
					font-size: 22rpx;
					color: rgb(100, 101, 102);
					line-height: 22rpx;
					margin-bottom: 5px;
					display: flex;
					align-items: center;
					
					.weixin {
						margin-right: 5px;
					}
				}
				
				.price-box {
					font-size: 22rpx;
					color: rgb(100, 101, 102);
					
					.price {
						font-size: 34rpx;
						font-weight: bold;
						color: var(--ui-BG-Main);
					}
				}
			}
		}
		
		.bt {
			border-bottom: 1px solid #fbf0f0;
		}
		
		.bottom-box {
			display: flex;
			justify-content: flex-end;
			
			.btn-box {
				display: flex;
				align-items: center;
			}
			
			.btn {
				background-color: #ddd;
				color: rgb(100, 101, 102);
				font-size: 22rpx;
				border-radius: 40px;
				padding: 5px 10px;
				margin-left: 10px;
				min-width: 140rpx;
				display: flex;
				justify-content: center;
			}
			
			.active {
				background-color: var(--ui-BG-Main);
				color: #fff;
			}
		}
	}
	
</style>