<template>
	<view class="bg">
		<view class="top-box flex-between" @click="gotoPath('/subPackages/user/profile')">
			<view>
				<image src="https://static.ticket.sz-trip.com/tourist/user/avatar.png" mode=""></image>
				张三
			</view>
			<view>
				个人中心
				<image src="https://static.ticket.sz-trip.com/tourist/user/rightIcon.png" mode=""></image>
			</view>
		</view>
		
		<view class="order-bg">
			<view class="order-box">
				<view class="order-top flex-between" @click="goTrades()">
					<view>我的订单</view>
					<view>
						全部
						<image src="https://static.ticket.sz-trip.com/tourist/user/rightIcon-gray.png" mode=""></image>
					</view>
				</view>
				
				<view class="order-bottom">
					<view v-for="(item,index) in orderList" :key="index" @click="goTrades(item)">
						<image :src="item.img" mode=""></image>
						<view>{{item.text}}</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="box-bg">
			<view class="box">
				<view v-for="(item,index) in list" :key="index" class="flex-between" @click="gotoPath(item.path)">
					<view style="display: flex;align-items: center;">
						<image :src="item.img" class="item-icon"></image>
						{{item.text}}
					</view>
					<image src="https://static.ticket.sz-trip.com/tourist/user/rightIcon-gray.png" class="item-right"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderList: [
					{
						img: 'https://static.ticket.sz-trip.com/tourist/user/qbdd.png',
						text: '全部订单',
						path: ''
					},
					{
						img: 'https://static.ticket.sz-trip.com/tourist/user/dzf.png',
						text: '待支付',
						path: ''
					},
					{
						img: 'https://static.ticket.sz-trip.com/tourist/user/dcx.png',
						text: '待出行',
						path: ''
					},
					{
						img: 'https://static.ticket.sz-trip.com/tourist/user/tksh.png',
						text: '退款/售后',
						path: ''
					}
				],
				list: [
					{
						img: 'https://static.ticket.sz-trip.com/tourist/user/cxrxx.png',
						text: '出行人信息',
						path: '/subPackages/user/travelerList'
					},
					{
						img: 'https://static.ticket.sz-trip.com/tourist/user/yhxy.png',
						text: '用户协议',
						path: '/subPackages/user/privacyInfo?title=用户协议&id=5'
					},
					{
						img: 'https://static.ticket.sz-trip.com/tourist/user/ysgl.png',
						text: '隐私管理',
						path: '/subPackages/user/privacyInfo?title=隐私政策&id=4'
					}
				],
				userInfo: {}
			}
		},
		onShow() {
			// this.Post({}, '/api/Merchants/get_login_details').then(res => {
			// 	this.userInfo = res.data
			// })
		},
		methods: {
			// 去订单
			goTrades(item) {
				if (item) {
					uni.navigateTo({
						url: "/subPackages/order/trades?type=" + item.text,
					});
				} else {
					uni.navigateTo({
						url: "/subPackages/order/trades",
					});
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.bg {
		min-height: 100vh;
		background: url('https://static.ticket.sz-trip.com/tourist/user/topBg.png') no-repeat;
		background-size: 100% auto;
		background-color: #F7F7F7;
	}
	
	.top-box {
		height: 247rpx;
		padding: 0 28rpx 0 35rpx;
		
		view {
			display: flex;
			align-items: center;
		}
		
		view:first-child {
			font-weight: bold;
			font-size: 40rpx;
			color: #000000;
			
			image {
				width: 106.67rpx;
				height: 106.67rpx;
				margin-right: 30rpx;
			}
		}
		
		view:last-child {
			font-weight: bold;
			font-size: 24rpx;
			color: #96684F;
			
			image {
				width: 20rpx;
				height: 20rpx;
				margin-left: 10rpx;
			}
		}
	}
	
	.order-bg {
		width: 697rpx;
		height: 240rpx;
		border: 1rpx solid #96684F;
		margin: auto;
		position: relative;
	}
	.order-box {
		width: 683rpx;
		height: 253rpx;
		background: #FFFFFF;
		border: 1rpx solid #96684F;
		position: absolute;
		top: -9rpx;
		left: 5rpx;

		.order-top {
			margin-top: 26rpx;
			padding: 0 15rpx 0 19rpx;
			font-weight: bold;
			font-size: 31rpx;
			color: #000000;
			
			view:last-child {
				font-weight: 500;
				font-size: 25rpx;
				color: #999999;
				display: flex;
				align-items: center;
				
				image {
					width: 20rpx;
					height: 20rpx;
					margin-left: 10rpx;
				}
			}
		}
		
		.order-bottom {
			margin-top: 40rpx;
			display: flex;
			
			&>view {
				width: 25%;
				text-align: center;
				font-weight: 500;
				font-size: 24rpx;
				color: #000000;
				
				image {
					width: 60rpx;
					height: 60rpx;
					margin-bottom: 10rpx;
				}
			}
		}
	}
	
	.box-bg {
		width: 697rpx;
		height: 310rpx;
		border: 1rpx solid #96684F;
		position: relative;
		margin: 40rpx auto 0;
	}
	.box {
		width: 683rpx;
		height: 326rpx;
		background: #FFFFFF;
		border: 1rpx solid #96684F;
		position: absolute;
		top: -9rpx;
		left: 5rpx;
		
		&>view {
			height: 33.3%;
			padding: 0 15rpx 0 24rpx;
			font-weight: 500;
			font-size: 28rpx;
			color: #000000;
			
			.item-icon {
				width: 33.33rpx;
				height: 33.33rpx;
				margin-right: 24rpx;
			}
			
			.item-right {
				width: 20rpx;
				height: 20rpx;
			}
		}
		&>view:nth-child(2) {
			border-top: 1rpx solid #D8D8D8;
			border-bottom: 1rpx solid #D8D8D8;
		}
	}
</style>