<template>
	<view>
		<!-- 状态栏高度 -->
		<view :style="{ height: `${statusBarHeight}px`, backgroundColor: '#FF6702' }"></view>

		<!-- 导航栏 -->
		<view :style="{ height: `${navigationBarHeight}rpx`,lineHeight: `${navigationBarHeight}rpx`}" class="order-nav">
			<!-- <view class="back-button" @tap="handBack()"></view> -->
			接单
		</view>
		<scroll-view scroll-y="true">
			<view v-for="item in riderData" :key="item.id" style="margin: 10rpx 0;">
				<rider-order :orderInfo="item"></rider-order>
			</view>
		</scroll-view>

		<!-- 底部导航 -->
		<view class="page-footer">
			<view class="foot-item" :class="item.pagePath == activeRouter?'active':''" v-for="(item,index) in footerList" :key="index"
			 @click="goRouter(item)">
				<block v-if="item.pagePath == activeRouter">
					<image :src="item.selectedIconPath"></image>
					<view class="txt">{{item.text}}</view>
				</block>
				<block v-else>
					<image :src="item.iconPath"></image>
					<view class="txt">{{item.text}}</view>
				</block>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		registerVerify,
	} from '@/api/api.js';
	import {
		Debounce
	} from '@/utils/validate.js'
	import riderOrder from "@/components/riderOrder/index.vue";
	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
	let app = getApp();
	export default {
		components: {
			riderOrder,
		},
		data() {
			return {
				statusBarHeight: app.globalData.statusBarHeight,
				navigationBarHeight: 112,
				// footerList: [{
				// 		pagePath: "/pages/goods/order_confirm/index",
				// 		iconPath: require("./static/ddh.png"),
				// 		selectedIconPath: require("./static/ddl.png"),
				// 		text: "订单",
				// 		role: '0'
				// 	},
				// 	{
				// 		pagePath: "/pages/admin/order/index",
				// 		iconPath: require("./static/wdh.png"),
				// 		selectedIconPath: require("./static/wdl.png"),
				// 		text: "我的",
				// 		role: '1'
				// 	}
				// ],
				riderData: [{
						cost: '2.00',
						time: '12:00',
						shopName: '吉啊婆麻辣烫',
						shopDistance: 500,
						shopAddress: '梨园2楼7号橱窗',
						userAddress: '雅苑3栋209b1001室',
						userDistance: 0,
						userRemarks: '老板，多放点辣椒！辣死我',
					},
					{
						cost: '2.00',
						time: '12:00',
						shopName: '吉啊婆麻辣烫',
						shopDistance: 500,
						shopAddress: '梨园2楼7号橱窗',
						userAddress: '雅苑3栋209b1001室',
						userDistance: 0,
						userRemarks: '老板，多放点辣椒！辣死我',
					},
					{
						cost: '2.00',
						time: '12:00',
						shopName: '吉啊婆麻辣烫',
						shopDistance: 500,
						shopAddress: '梨园2楼7号橱窗',
						userAddress: '雅苑3栋209b1001室',
						userDistance: 0,
						userRemarks: '老板，多放点辣椒！辣死我',
					},
					{
						cost: '2.00',
						time: '12:00',
						shopName: '吉啊婆麻辣烫',
						shopDistance: 500,
						shopAddress: '梨园2楼7号橱窗',
						userAddress: '雅苑3栋209b1001室',
						userDistance: 0,
						userRemarks: '老板，多放点辣椒！辣死我',
					}
				]
			}
		},
		methods: {

		},
		onLoad(options) {},
		mounted() {

		},
	}
</script>

<style scoped lang="scss">
	.order-nav {
		font-weight: 500;
		font-size: 35rpx;
		color: #FFFFFF;
		position: relative;
		background-color: #FF6702;
		display: flex;
		align-items: center;
		justify-content: center;

		.back-button {
			position: absolute;
			left: 20rpx;
		}
	}

	.page-footer {
		position: fixed;
		bottom: 0;
		z-index: 9;
		display: flex;
		align-items: center;
		justify-content: space-around;
		width: 100%;
		height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		box-sizing: border-box;
		border-top: solid 1rpx #F3F3F3;
		background-color: #fff;
		// box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
		padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
		padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/

		.foot-item {
			display: flex;
			width: max-content;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			position: relative;
			padding: 0 20rpx;
			margin-top: 18rpx;

			&.active {
				color: $bg-color-primary
			}
		}

		.foot-item image {
			height: 50rpx;
			width: 50rpx;
			text-align: center;
			margin: 0 auto;
		}

		.foot-item .txt {
			font-size: 27rpx;
			margin-top: 8rpx;
		}
	}
</style>
