<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: #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) {
					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
					});
				}
				// uni.pro.navigateTo('index/merchant/orderinfo');
			},
			storeinvoicelist() {
				uni.request({
					url:  uni.conf.baseUrl + 'store/invoicelist',
					// url:'http://192.168.1.117:8084/merchant/sz/merchant/authPay',
					data: {
						store_id: uni.getStorageSync('userId'),
					},
					method: 'POST', //请求方式，必须为大写
					success: res => {
						this.list = res.data.data
						console.log('接口返回------', res);
					}
				});
			},
		}
	}
</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>