<template>
	<view class="page">
		<u-navbar title="订单管理" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
			title-size='36' height='50' id="navbar">
		</u-navbar>
        <view class="toptab">
        	<view class="" @click="show = true">
        		{{zttxt}} <u-icon name="arrow-down-fill" color="#3D3D3D" size="24"></u-icon>
        	</view>
			<!-- <view class="">
				支付方式 <u-icon name="arrow-down-fill" color="#3D3D3D" size="24"></u-icon>
			</view> -->
			<view class="">
				<!-- 时间筛选 <u-icon name="arrow-down-fill" color="#3D3D3D" size="24"></u-icon> -->
				<text class="one" @click="btntime(1)">{{kstime}}</text>--<text class="one" @click="btntime(2)">{{jstime}}</text>
			</view>
        </view>
		<u-select v-model="show" :list="list" @confirm="confirm"></u-select>
		<u-picker mode="time" v-model="showtime" :params="params" @confirm='confirmkstime'></u-picker>
		<view class="list">
			<view class="list_item" v-for="(item,index) in 5" :key="index" @click="btnxq">
				<view class="top">
					<view class="">
						订单编号：1238951464125741
					</view>
					<view class="zt">
						已完成
					</view>
				</view>
				<view class="xinxi">
					店铺名称：福鼎-西湖店
				</view>
				<view class="xinxi">
					房间名称：竹韵包厢
				</view>
				<view class="xinxi">
					<view class="">
						订单时间：2024-12-05 13:45
					</view>
					<view class="price">
						￥20.00
					</view>
				</view>
				<view class="bot">
					<view class="time">
					   <text v-if="false"> 剩余时间：<text>00小时55分39秒</text></text>
					</view>
					<view class="jieshu">
						退款
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
                bgc: {
                	backgroundColor: "#fff",
                },
				zttxt:'订单状态',
				zttxtid:'',
				kstime:'',
				jstime:'',
				num:'',
				params: {
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				},
				showtime: false,
				show: false,
				list: [
					{
						value: '',
						label: '全部'
					},{
						value: '0',
						label: '待支付'
					},{
						value: '1',
						label: '支付中'
					},{
						value: '2',
						label: '待使用'
					},{
						value: '3',
						label: '使用中'
					},{
						value: '4',
						label: '已完成'
					},{
						value: '5',
						label: '超时自动取消'
					},{
						value: '6',
						label: '用户取消订单'
					},{
						value: '7',
						label: '退款中'
					},{
						value: '8',
						label: '已退款'
					}],
					
			}
		},
		onLoad() {
            
		},
		onShow() {
			this.getlist()
		},
		methods: {
			// 点击选择时间
			btntime(num){
				this.showtime = true
				this.num = num
			},
			// 筛选开始时间
			confirmkstime(e){
				if(this.num == 1){
					this.kstime = e.year + '-' + e.month + '-' + e.day
				}else{
					this.jstime = e.year + '-' + e.month + '-' + e.day
				}
			},
			// 点击状态筛选
			confirm(e) {
				this.zttxt = e[0].label
				this.zttxtid = e[0].value
			},
			// 请求订单列表
			 getlist(){
				this.$u.get(`/app/order/orderList`).then(res =>{
					if(res.code == 200){
						
					}
				}) 
			 },
			// 点击跳转到订单详情
			btnxq(){
				uni.navigateTo({
					url:'/page_moban/orderxq'
				})
			}
		}
	}
</script>

<style lang="scss">
	/deep/ .uicon-nav-back,
	/deep/ .u-title{
		padding-bottom: 20rpx;
	}
	/deep/ .uicon-arrow-down-fill{
		margin-left: 16rpx;
	}
	.list{
		width: 100%;
		height: 80vh;
		overflow: scroll;
		.list_item{
			width: 750rpx;
			height: 420rpx;
			background: #FFFFFF;
			margin-top: 20rpx;
			.top{
				display: flex;
				justify-content: space-between;
				height: 94rpx;
				line-height: 94rpx;
				padding: 0 32rpx;
				box-sizing: border-box;
				.zt{
					color: #3D3D3D;
				}
				border-bottom: 1px solid #D8D8D8;
			}
			.xinxi{
				padding: 0 32rpx;
				box-sizing: border-box;
				margin-top: 24rpx;
				font-size: 28rpx;
				color: #3D3D3D;
				display: flex;
				justify-content: space-between;
				.price{
					font-weight: 600;
					font-size: 28rpx;
					color: #48893B;
				}
			}
			.bot{
				padding: 0 32rpx;
				padding-top: 24rpx;
				box-sizing: border-box;
				border-top: 1px solid #D8D8D8;
				margin-top: 28rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				.jieshu{
					width: 194rpx;
					height: 64rpx;
					border-radius: 14rpx 14rpx 14rpx 14rpx;
					border: 2rpx solid #48893B;
					font-weight: 600;
					font-size: 32rpx;
					color: #48893B;
					text-align: center;
					line-height: 64rpx;
				}
				.time{
					text{
						color: #48893B;
					}
				}
			}
		}
	}
	page {
		background: #F6F6F6;
	}
	.toptab{
		width: 100%;
		height: 90rpx;
		line-height: 90rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 50rpx;
		box-sizing: border-box;
		background-color: #fff;
		view{
			display: flex;
			align-items: center;
			.one{
				display: inline-block;
				width: 200rpx;
				height: 50rpx;
				border: 1px solid #ccc;
				border-radius: 10rpx;
				line-height: 50rpx;
				text-align: center;
			}
		}
	}


</style>