<template>
	<view>
		<navigation-bar title="订单列表" background-color="#0081ff" front-color="#ffffff" :left-button="null" />
		<u-tabs lineWidth="50" :list="list" itemStyle="height:90rpx;width: 100rpx;" :is-scroll="false"
			:current="current" @change="change"></u-tabs>
		<u-list style="margin-top: 10rpx;padding: 15rpx;" @scrolltolower="scrolltolower">
			<u-list-item v-for="(item, index) in orderList" :key="index">
				<view class="item-box">
					<view class="goods-item">
						<view class="good-row">
							<view>
								<view class="shop">
									<!-- background-color: #eaf1fe; -->
									<view class="shop-icon">
										<uni-icons type="shop" color="#0081ff" size="26"></uni-icons>
									</view>

									<text style="font-size: 35rpx; margin-left: 8rpx;">{{item.shopName}}</text>
								</view>
							</view>
							<view class="status" v-if="item.finishStatus">
								<text style="color: #D3D3D3;">已完成</text>
							</view>
							<view class="status" v-else-if="item.resaleStatus">
								<text style="color: #0e87ff;">组员确认中</text>
							</view>
							<view class="status" v-else-if="item.resaleStatus">
								<text style="color: #0e87ff;">进境确认中</text>
							</view>
							<view class="status" v-else-if="item.resaleStatus">
								<text style="color: #0e87ff;">进境申报中</text>
							</view>
							<view class="status" v-else-if="item.resaleStatus">
								<text style="color: #00FF7F;">已进口</text>
							</view>
							<view class="status" v-else>
								<text style="color: #ff660d;">商家未确认</text>
							</view>
						</view>
					</view>
					<view class="goods-item">
						<view class="good-row">
							<view>
								<u--image radius="10" :showLoading="true" src="" width="250rpx"
									height="210rpx"></u--image>
							</view>
							<view class="des">
								<view style="font-size: 34rpx; height: 100rpx;">{{item.goodsNames}}</view>
								<!-- <view style="font-size: 34rpx;">[老板力荐]鲜活小龙虾(帮剪头去虾线)约250g/份</view> -->
								<view class="subtit">
									<text style="margin-right: 20rpx;">{{item.totalWeight}}吨</text>
									<text>{{item.tradeAreaName}}</text>
								</view>
								<view class="subtit">
									{{item.tradeTime}}
									<!-- 2023-08-03 16:41 -->
								</view>
							</view>
						</view>
					</view>
					<view class="goods-item">
						<view class="footer-item">
							<view class="price">￥{{item.totalPrice}}</view>
						</view>
						<view class="footer-item">
							<view style="margin: 15rpx 0rpx;"><button type="error" size="mini" :plain="true">查看详情</button></view>
						</view>
					</view>
				</view>
			</u-list-item>
		</u-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '全部'
				}, {
					name: '待确认'
				}, {
					name: '申报中'
				}, {
					name: '已完成'
				}, {
					name: '转售中'
				}, {
					name: '已取消'
				}],
				current: 0,
				orderList: [],
				status: 0
			}
		},
		onLoad() {
			this.getOrderList()
		},
		methods: {
			change(item) {
				this.current = item.index
			},
			getOrderList() {
				this.http.request({
					url: '/level-one-server/app/TbOrder/getList',
					success: res => {
						this.orderList = res.data.data;
					}
				});
			},
			scrolltolower() {
				this.getCartList()
			}
		}
	}
</script>

<style lang="scss">
	// page{
	// 	padding: 15rpx;
	// }

	.goods-item {
		margin-bottom: 15rpx;
	}

	.good-row {
		display: flex;
		align-items: center;
	}

	.shop {
		display: flex;
		align-items: center;
		width: 480rpx;
	}

	.shop-icon {
		width: 60rpx;
		height: 60rpx;
		border-radius: 30rpx;
		background-color: #eaf1fe;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.status {
		width: 200rpx;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}

	.des {
		margin-left: 20rpx;
		position: relative;
		top: 1rpx;
		height: 200rpx;
	}

	.subtit {
		font-size: 28rpx;
		color: #9C9C9C;
		margin: 10rpx;
	}

	.footer-item {
		display: flex;
		justify-content: flex-end;
		margin-top: -15rpx;
		margin-bottom: 5rpx;
	}
	
	.price{
		font-size: 30rpx;
	}

	.item-box {
		height: 370rpx;
		width: 85%;
		padding: 30rpx;
		border: 1rpx #888 solid;
		margin: 10rpx 15rpx;
		border-radius: 10rpx;
	}
</style>