<template>
	<view class="common-page" style="padding:0">
		<view class="search-area flex-d">
			<view class="flex-a mb-20">
				<text class="font-13 mr-10">开始时间:</text>
				<uni-datetime-picker type="datetime" v-model="searchParams.startTime" placeholder="请选择开始时间" />
			</view>
			<view class="flex-a">
				<text class="font-13 mr-10">结束时间:</text>
				<uni-datetime-picker type="datetime" v-model="searchParams.endTime" placeholder="请选择结束时间" />
			</view>
		</view>
		<view class="footer">
			<u-button type="primary" @click="handleSearch" text="查询" customStyle="width:100%;height:100rpx;margin:0 auto;" />
		</view>
	</view>
</template>

<script setup>
import { ref } from 'vue';

const searchParams = ref({
	startTime: '',
	endTime: ''
})

const handleSearch = () => {
	uni.navigateTo({
		url: `/pages/index/statistic/after-sale-result?startTime=${encodeURIComponent(searchParams.value.startTime)}&endTime=${encodeURIComponent(searchParams.value.endTime)}`
	})
}
</script>

<style lang="scss">
.common-page {
	display: flex;
	flex-direction: column;
	min-height: 90vh;
	padding: 0;
	overflow: hidden;
}

.search-area {
	background-color: #ffffff;
	border-radius: 8rpx;
}

.footer {
	margin-top: auto;
	background-color: #ffffff;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	box-shadow: 0 -2rpx 4rpx rgba(0, 0, 0, 0.1);
}
</style> 