<template>
	<view>
		<view class="wrap">
			<view class="u-tabs-box">
				<u-tabs-swiper activeColor="#0094FE" ref="tabs" :list="list" :current="current" @change="change" :is-scroll="false"
				 swiperWidth="750"></u-tabs-swiper>
			</view>
			<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						<view class="page-box">
							<view class="order" v-for="(res, index) in orderList" :key="res.id">
								<view class="order-one">
								</view>
								<text class="order-one-text">核销金额：￥100000</text>
								<view class="order-one-xian">
								</view>
								<view class="order-two">
									<view class="">
										创建时间
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
								<view class="order-two">
									<view class="">
										核审时间
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
								<view class="order-two">
									<view class="">
										当前状态
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
							</view>
							<!-- <u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> -->
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						<view class="page-box">
							
							<view class="order" v-for="(res, index) in orderList" :key="res.id">
								<view class="order-one">
								</view>
								<text class="order-one-text">核销金额：￥100000</text>
								<view class="order-one-xian">
								</view>
								<view class="order-two">
									<view class="">
										创建时间
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
								<view class="order-two">
									<view class="">
										核审时间
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
								<view class="order-two">
									<view class="">
										当前状态
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						<view class="page-box">
							<view class="order" v-for="(res, index) in orderList" :key="res.id">
								<view class="order-one">
								</view>
								<text class="order-one-text">核销金额：￥100000</text>
								<view class="order-one-xian">
							
								</view>
								<view class="order-two">
									<view class="">
										创建时间
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
								<view class="order-two">
									<view class="">
										核审时间
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
								<view class="order-two">
									<view class="">
										当前状态
									</view>
									<view class="">
										2020-10-28 08:10:42
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>

			</swiper>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderList: [
					[
						
					],
					[],
					[]
					
				],
				list: [{
						name: '待付款'
					},
					{
						name: '待发货'
					},
					{
						name: '待收货'
					},
				],
				current: 0,
				swiperCurrent: 0,
				tabsHeight: 0,
				dx: 0,
				loadStatus: ['loadmore', 'loadmore', 'loadmore', 'loadmore'],
			};
		},
		onLoad() {
			// this.getOrderList(0);
			// this.getOrderList(1);
			// this.getOrderList(3);
		},
		computed: {
			// 价格小数
			priceDecimal() {
				return val => {
					if (val !== parseInt(val)) return val.slice(-2);
					else return '00';
				};
			},
			// 价格整数
			priceInt() {
				return val => {
					if (val !== parseInt(val)) return val.split('.')[0];
					else return val;
				};
			}
		},
		methods: {
		
			// tab栏切换
			change(index) {
				this.swiperCurrent = index;
			},
			transition({
				detail: {
					dx
				}
			}) {
				this.$refs.tabs.setDx(dx);
			},
			animationfinish({
				detail: {
					current
				}
			}) {
				this.$refs.tabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.current = current;
			}
		}
	};
</script>

<style>
	/* #ifndef H5 */
	page {
		height: 100%;
		background-color: #f2f2f2;
	}

	/* #endif */
</style>

<style lang="scss" scoped>
	// 插件代码
	.order {
		width: 710rpx;
		background-color: #ffffff;
		margin: 20rpx auto;
		border-radius: 20rpx;
		box-sizing: border-box;
		padding: 20rpx;
		font-size: 28rpx;

		.top {
			display: flex;
			justify-content: space-between;

			.left {
				display: flex;
				align-items: center;

				.store {
					margin: 0 10rpx;
					font-size: 32rpx;
					font-weight: bold;
				}
			}

			.right {
				color: $u-type-warning-dark;
			}
		}

		.item {
			display: flex;
			margin: 20rpx 0 0;

			.left {
				margin-right: 20rpx;

				image {
					width: 200rpx;
					height: 200rpx;
					border-radius: 10rpx;
				}
			}

			.content {
				.title {
					font-size: 28rpx;
					line-height: 50rpx;
				}

				.type {
					margin: 10rpx 0;
					font-size: 24rpx;
					color: $u-tips-color;
				}

				.delivery-time {
					color: #e5d001;
					font-size: 24rpx;
				}
			}

			.right {
				margin-left: 10rpx;
				padding-top: 20rpx;
				text-align: right;

				.decimal {
					font-size: 24rpx;
					margin-top: 4rpx;
				}

				.number {
					color: $u-tips-color;
					font-size: 24rpx;
				}
			}
		}

		.total {
			margin-top: 20rpx;
			text-align: right;
			font-size: 24rpx;

			.total-price {
				font-size: 32rpx;
			}
		}

		.bottom {
			display: flex;
			margin-top: 40rpx;
			padding: 0 10rpx;
			justify-content: space-between;
			align-items: center;

			.btn {
				line-height: 52rpx;
				width: 160rpx;
				border-radius: 26rpx;
				border: 2rpx solid $u-border-color;
				font-size: 26rpx;
				text-align: center;
				color: $u-type-info-dark;
			}

			.evaluate {
				color: $u-type-warning-dark;
				border-color: $u-type-warning-dark;
			}
		}
	}

	.centre {
		text-align: center;
		margin: 200rpx auto;
		font-size: 32rpx;

		image {
			width: 164rpx;
			height: 164rpx;
			border-radius: 50%;
			margin-bottom: 20rpx;
		}

		.tips {
			font-size: 24rpx;
			color: #999999;
			margin-top: 20rpx;
		}

		.btn {
			margin: 80rpx auto;
			width: 200rpx;
			border-radius: 32rpx;
			line-height: 64rpx;
			color: #ffffff;
			font-size: 26rpx;
			background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
		}
	}

	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - var(--window-top));
		width: 100%;
	}

	.swiper-box {
		flex: 1;
	}

	.swiper-item {
		height: 100%;
	}

	// 手敲代码
	.order-one {
		width: 6rpx;
		height: 30rpx;
		margin-top: 5rpx;
		margin-right: 30rpx;
		background-color: #0292FD;
		float: left;
	}

	.order-two {
		display: flex;
		justify-content: space-between;
		margin-top: 15rpx;
		font-size: 24rpx;
		color: #6A6A6A;
	}

	// 线
	.order-one-xian {
		width: 642rpx;
		height: 1rpx;
		border-bottom: 1rpx solid #E7E8EA;
		margin: 0 auto;
		margin-top: 20rpx;
		margin-bottom: 30rpx;
	}

	.order-one-text {
		font-size: 24rpx;
		font-weight: bold;
		color: #000;
	}
</style>
