<template>
	<view class="content">
		<view class="content_item" v-for="(item,index) in list" :key="index" @click="clickoange(item)">
			<view class="content_item_top flex-between">
				<view class="content_item_topone flex-start">
					<image src="@/static/sz.png" mode="aspectFill"></image>
					<text>{{item.createtime}}</text>
				</view>
				<view class="content_item_toptow flex-start">
					<text class="content_item_toptowtext">¥{{item.price}}</text>
					<u-icon name="arrow-right" color="#9d9d9d" size="10"></u-icon>
				</view>
			</view>
			<view class="content_item_bottom" style="background: #318AFE;" v-if="item.status == 0">
				客户未提交信息
			</view>
			<view class="content_item_bottom" style="background:#8B8B8B ;" v-if="item.status == 1">
				开票中
			</view>
			<view class="content_item_bottom" v-if="item.status == 2">
				已开票
			</view>
			<view class="content_item_bottom" style="background:#FD482C;" v-if="item.status == 3">
				开票失败
			</view>
			<view class="content_item_bottom" style="background: #ffbb76;" v-if="item.status == 4">
				已作废
			</view>
		</view>
		<view class="empty-wrap">
			<view class="empty" v-if="!list.length"><u-empty text="暂无数据"
					:icon="require('@/static/icon_empty.png')"></u-empty></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			};
		},

		onShow() {
			this.storeinvoicelist()
		},
		methods: {
			clickoange(e) {
				if (e.status == 2 || e.status == 4 || e.status == 3) {
					uni.pro.navigateTo('index/orderinfo', {
						id: e.id,
						status: e.status
					});
				}
				if (e.status == 0) {
					uni.pro.navigateTo('index/orderinfos', {
						id: e.id,
						status: e.status
					});
				}
			},
			async storeinvoicelist() {
				let res = await this.api.storeinvoicelist({
					store_id: uni.getStorageSync('userId')
				})
				this.list = res.data
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #F9F9F9;
	}

	.content {
		padding: 6px 28rpx;

		.content_item {
			margin-top: 32rpx;
			width: 100%;
			background: #FFFFFF;
			border-radius: 30rpx 30rpx 30rpx 30rpx;

			.content_item_top {
				padding: 34rpx 16rpx 30rpx 42rpx;

				.content_item_topone {
					image {
						width: 37.11rpx;
						height: 37.11rpx;
					}

					text {
						margin-left: 28rpx;
						font-family: Source Han Sans CN, Source Han Sans CN;
						font-weight: 400;
						font-size: 28rpx;
						color: #666666;
						text-align: center;
						font-style: normal;
						text-transform: none;
					}
				}

				.content_item_toptow {
					.content_item_toptowtext {
						font-family: Source Han Sans CN, Source Han Sans CN;
						font-weight: 500;
						font-size: 32rpx;
						color: #666666;
						text-align: center;
						font-style: normal;
						text-transform: none;
					}
				}
			}

			.content_item_bottom {
				padding: 16rpx 0 16rpx 108rpx;
				background: rgba(85, 159, 255, 0.74);
				box-shadow: 0px 3rpx 6rpx 1px rgba(0, 0, 0, 0.16);
				border-radius: 0rpx 0rpx 30rpx 30rpx;
				font-family: Source Han Sans CN, Source Han Sans CN;
				font-weight: 500;
				font-size: 32rpx;
				color: #FFFFFF;
				font-style: normal;
				text-transform: none;
			}
		}
	}
</style>