<template>
	<view class='container'>
		<view style="background: linear-gradient( 180deg, #D9F5E8 0%, #FFFFFF 100%);padding-bottom: 200rpx;">
			<u-navbar :autoBack="true" placeholder="true" title="历史工单" bgColor="transparent">
			</u-navbar>
		</view>
		<view style="margin-top: -200rpx;">
			<view class="flex mlr-10">
				<view @click="onClick(index)" class="h-150 mlr-10 br-12 flex-column flex-between-center"
					style="flex: 1;background: #FFFFFF;"
					:style="{ color: index==0?'#FF682D':index==1?'#EEA616':index==2?'#1FCA7C':'#23BBEE'}"
					v-for="(item, index) in 4" :key="index">
					<text class="mt-20 fs-36">25</text>
					<text class="mb-20 fs-24">待处理</text>
					<view v-if="index==tabIndex"
						style="background: #27CC81;height: 10rpx;width: 100%;border-radius: 12rpx;">
					</view>
					<view v-else style="background: #FFFFFF;height: 10rpx;width: 100%;border-radius: 12rpx;">
					</view>
				</view>
			</view>
		</view>
		<view class="overflow-y">
			<scroll-view scroll-y style="height: 100%;">
				<view v-for="(item, index) in 8" :key="index" @click="onClick(index)">
					<view class="flex-column br-12 mt-30 mlr-24 pad-20"
						style="box-shadow: 0px 0px 15px 1px rgba(142,142,142,0.16);background: white;">
						<view class="flex vh-center mt-20">
							<image class="h-25 w-25 mr-15" style="background: #1FCA7C;"> </image>
							<text class="fs-32 fw-700" style="flex: 1;">居家报修</text>
							<text>待处理</text>
						</view>
						<text class="fs-28 br-6 pad-20 mtb-20" style="background: #EBF5F0;">待处理</text>
						<scroll-view scroll-x="true" scroll-with-animation="true">
							<view class="flex">
								<view class="w-140 h-140 mr-15" v-for="(itemImg, index2) in 10" :key="index2">
									<image class="w-140 h-140" style="background: #1FCA7C;"></image>
								</view>
							</view>
						</scroll-view>
						<view class="flex vh-center h-60 mt-20 fs-24">
							<text style="flex: 1;color: #000;">2025-03-10 10:01:45</text>
							<text style="color: #EEA616;">去支付</text>
							<text style="color: #27CC81;margin-left: 30rpx;">报修详情</text>
						</view>
					</view>
				</view>
			</scroll-view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 0,
				tabIndex: 0,
			};
		},
		onLoad(e) {
			this.type = e.type
		},
		methods: {
			onClick(index) {
				this.$wskj.to("/pagesMain/pages/bxxq")
			}
		},
	};
</script>

<style scoped>
	.container {
		height: 100vh;
		display: flex;
		flex-direction: column;
		background: #fff;
	}
</style>