<template>
	<view style="width:100vw;height:100vh;" class="column">
		<scroll-view :scroll-y="true" @scroll="scrollHandler" @scrolltoupper="scrollTopHandler" class="col" style="height: 1px;width: 100%;">
			<view class="userStyle" style="min-height:100vh">
				<view class="headStatus" v-if="scrollTop > 50" :style="{
					zIndex: scrollTop < 10 ? 'unset' : 2,
					opacity: scrollTop < 10 ? '100' : scrollTop,
				}">
					<view class="title">{{ pageTitle }}</view>
				</view>
				<view class="userBox">
					<vipUserHeader></vipUserHeader>
					<view class="userMyOrderBox">
						<view style="position: relative;top:-13rpx">
							<view class="userMyOrder">
								<view class="userMyOrderTitle row-sbas-n col">
									<view class="userMyOrderTitL">我的订单</view>
									<view class="userMyOrderTitR row" @click="goUrl('/pages/order/index/index')">
										<text>全部</text>
										<view>
											<u-icon class="userMyOrderTitRIght" name="arrow-up" size="30" color="#B2B3B3"></u-icon>
										</view>
									</view>
								</view>
								<view class="order_bar_list">
									<view class="order_bar_item" @click="goUrl('/pages/order/index/index?status=1')">
										<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638748963970628311.png" style="width: 66rpx; height: auto" mode="widthFix"></image>
										<Text style="margin-top: 10rpx;font-size: 24rpx;">待付款</Text>
										<view class="badge"></view>
									</view>
									<view class="order_bar_item" @click="goUrl('/pages/order/index/index?status=2')">
										<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638748963971941398.png" style="width: 66rpx; height: auto" mode="widthFix"></image>
										<Text style="margin-top: 10rpx;font-size: 24rpx;">未确认</Text>
										<view class="badge"></view>
									</view>
									<view class="order_bar_item" @click="goUrl('/pages/order/index/index?status=3')">
										<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638748963971902348.png" style="width: 66rpx; height: auto" mode="widthFix"></image>
										<Text style="margin-top: 10rpx;font-size: 24rpx;">已完成</Text>
										<view class="badge"></view>
									</view>
									<view class="order_bar_item">
										<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638748964440207840.png" style="width: 66rpx; height: auto" mode="widthFix"></image>
										<Text style="margin-top: 10rpx;font-size: 24rpx;">待处理</Text>
										<view class="badge"></view>
									</view>
								</view>
								<view class="orderProductBox">
									<view class="orderProduct row items-center">
										<view class="orderProductL">
											<image style="width: 91rpx; height: 88rpx;" mode="aspectFill" src="http://imgfile.oytour.com/Upload/WebSite/202501090355546390000000073.jpg"></image>
										</view>
										<view class="orderProductR col column" style="width: 1px;">
											<view class="orderProductR_state">待处理</view>
											<view class="orderProductR_text">(东东一地) 河津樱早樱东京富士山纯 河津樱早樱东京富士山纯</view>
										</view>
									</view>
								</view>
							</view>
							<view style="height: 20rpx;"></view>
							<view class="userMyOrder" style="padding: 12rpx 0 20rpx 0;">
								<view class="order_bar_list">
									<view class="order_bar_item relative" style="margin-top: 0;">
										<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638749519965857485.png" style="width: 70rpx; height: 70rpx" mode="widthFix"></image>
										<Text style="margin-top: 10rpx;font-size: 24rpx;">在线客服</Text>
										<button open-type="contact" style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;z-index: 1;opacity: 0;"></button>
									</view>
									<view class="order_bar_item" style="margin-top: 0;">
										<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638749520007722617.png" style="width: 70rpx; height: 70rpx" mode="widthFix"></image>
										<Text style="margin-top: 10rpx;font-size: 24rpx;">年底大红包</Text>
									</view>
									<view class="order_bar_item" style="margin-top: 0;" @click="goUrl('/pages/index/index')">
										<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638749520286130928.png" style="width: 70rpx; height: 70rpx" mode="widthFix"></image>
										<Text style="margin-top: 10rpx;font-size: 24rpx;">我的旅行社</Text>
									</view>
									<view class="order_bar_item" style="margin-top: 0;" @click="goUrl('/pages/coupon/list/list')">
										<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638749520367368328.png" style="width: 70rpx; height: 70rpx" mode="widthFix"></image>
										<Text style="margin-top: 10rpx;font-size: 24rpx;">领券中心</Text>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
		<auth v-if="showAuth"></auth>
		<tabbars></tabbars>
	</view>
</template>

<script>
	import tabbars from "@/components/tabbar/index";
	import auth from "@/components/auth/index.vue";
	import vipUserHeader from "./components/vipUserHeader.vue";

	export default {
		components: {
			tabbars,
			auth,
			vipUserHeader
		},
		data() {
			return {
				pageTitle: "个人中心",
				scrollTop: 0,
				showAuth: false,
				b2b_user_info: {},
				mall_UserInfo: {}
			};
		},
		onLoad() {
			this.b2b_user_info = uni.getStorageSync('b2b_user');
			this.mall_UserInfo = uni.getStorageSync("mall_UserInfo");
			this.showAuth = !this.mall_UserInfo || !this.b2b_user_info;
		},
		methods: {
			scrollHandler(e) {
				this.scrollTop = e.detail.scrollTop;
			},
			scrollTopHandler() {
				this.scrollTop = 0;
			},
			goUrl(url) {
				uni.navigateTo({ url });
			}
		}
	};
</script>

<style>
	@import url('../../asset/css/flex.css');
	.row-sbas-n {
		justify-content: space-between;
	}
	.relative {
		position: relative;
	}

	.userStyle .userBox {
		display: flex;
		flex-direction: column;
		align-items: center;
		background: #f3f4f6;
		min-height: 100vh;
		padding-bottom: env(safe-area-inset-bottom);
	}

	.order_bar_list {
		padding: 22rpx 55rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.order_bar_item {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 20rpx;
		position: relative;
	}

	.badge {
		position: absolute;
		right: -10rpx;
		top: -10rpx;
		padding: 0 8rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 20rpx;
		background: #FF3166;
		color: #fff;
		min-width: 28rpx;
		height: 28rpx;
		border-radius: 14rpx;
	}

	.headStatus {
		position: fixed;
		width: 140vw;
		padding-right: 40vw;
		padding-bottom: 10px;
		left: 0;
		right: 0;
		top: 0;
		display: flex;
		background-image: linear-gradient(to right, #e6b865, #ebb45e);
	}

	.headStatus .title {
		font-size: 18px;
		color: #fff;
		flex: 1;
		width: 1px;
		line-height: 34px;
		text-align: center;
	}

	.userMyOrderBox {
		padding: 0 31rpx;
	}
	.userMyOrder {
		background: #FFF;
		border-radius: 20rpx;
		padding: 33rpx 0 22rpx 0;
	}
	.userMyOrderTitle {
		padding: 23rpx 31rpx 0 31rpx;
	}
	.userMyOrderTitL {
		font-family: PingFang SC;
		font-weight: 800;
		font-size: 32rpx;
		color: #080A09;
	}
	.userMyOrderTitR {
		font-family: PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		color: #B2B3B3;
		align-items: center;
	}
	.userMyOrderTitRIght {
		margin-left: 11rpx;
		transform: rotate(90deg);
	}

	.orderProductBox {
		padding: 0 20rpx;
	}
	.orderProduct {
		width: 648rpx;
		height: 132rpx;
		background: #F7F7F7;
		border-radius: 18rpx;
		padding: 21rpx 20rpx;
	}
	.orderProductL {
		width: 91rpx;
		height: 88rpx;
		border-radius: 14rpx;
		overflow: hidden;
		margin-right: 18rpx;
	}
	.orderProductR_state {
		font-family: PingFang SC;
		font-weight: 500;
		font-size: 28rpx;
		color: #080A09;
		padding-top: 5rpx;
	}
	.orderProductR_text {
		width: 100%;
		font-family: PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		color: #8C8C8C;
		padding-top: 4rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
</style>