<template>
	<view class="content">
		<view class="" style="height: 1rpx;"></view>
		<empty v-if="loaded === true && list.length === 0"></empty>
		<view v-for="(item, index) in list" :key="index" class="order-item flex">
			<view class="title-box flex_item">
				<view class="title-avatar">
					<image src="../../static/icon/jl-na.png"></image>
				</view>
				<view class="list-tpl">
					<view class="title">
						<view class="title-name clamp">{{ item.name }}</view>
					</view>
					<view class="time">
						<text>{{item.create_time}}</text>
					</view>
				</view>
				<view class="list-right">
					<view class="je">
						金额：{{item.money || '0'}}
					</view>
					<view class="">
						{{item.status == 0?'进行中': (item.status == 1?'待核销':(item.status == 2?'已核销':'失败'))}}
					</view>
				</view>
			</view>
		</view>
		<uni-load-more :status="loadingType"></uni-load-more>
	</view>
</template>

<script>
	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
	import empty from '@/components/empty';
	import {getActionList,getAddList} from '@/api/index.js'
	
	export default {
		components: {
			uniLoadMore,
			empty
		},
		data() {
			return {
				page: 1,
				limit: 10,
				loadingType: 'more',
				loaded: false,
				list: []
			}
		},
		onLoad(opt) {
	
		},
		onShow() {
			this.getList()
		},
		onReachBottom() {

		},
		onReady() {
			
		},
		methods: {
			getList() {
				let that = this
				getAddList({
					page: that.page,
					limit: that.limit
				}).then(res => {
					that.list = res.data
				})
			}
		}
	}
</script>

<style lang="scss">
.order-item {
		padding: 20rpx 30rpx;
		line-height: 1.5;
		background-color: #fff;

		.title-box {
			width: 100%;

			.title-avatar {
				flex-shrink: 0;
				width: 54rpx;
				height: 54rpx;
				margin-right: 25rpx;
				border-radius: 100%;

				image {
					width: 100%;
					height: 100%;
					border-radius: 100%;
				}
			}
			.list-right {
				text-align: right;
				flex-shrink: 0;
				font-size: 22rpx;
				font-weight: 400;
				color: #999999;
				.je {
					font-size: 28rpx;
					font-weight: bold;
					color: #FF4C4C;
				}
			}
			.list-tpl {
				// width: 85%;
				flex-grow: 1;

				.title {
					display: flex;
					justify-content: flex-start;
					font-size: $font-lg;
					color: $font-color-base;
					overflow: hidden; //超出的文本隐藏
					text-overflow: ellipsis; //溢出用省略号显示
					white-space: nowrap;
					line-height: 1;
					text-align: center;

					.title-name {
						max-width: 40%;
					}

					.dl {
						margin-left: 10rpx;
						width: 93rpx;
						height: 32rpx;
						border-radius: 16rpx;

						image {
							width: 93rpx;
							height: 32rpx;
							border-radius: 16rpx;
						}
					}

					.class {
						display: inline-block;
						margin-left: 10rpx;
						padding: 6rpx;
						text-align: center;
						border: 1px solid #2e58ff;
						border-radius: 16rpx;
						font-size: 20rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #2e58ff;
					}
				}

				.time {
					font-size: $font-lg;
					color: $font-color-light;
				}
			}
		}

		.money {
			width: 50%;
			text-align: right;
			color: #db1935;
			font-size: $font-lg;
		}
	}
</style>