<template>
	<view class="bgMain">
		<view class="nav">
			<u-navbar autoBack placeholder bgColor="" leftIconColor="#FFFFFF">
				<view class="navSlot" slot="center">
					<!-- <u-icon name="arrow-left" size="19"></u-icon> -->
					<view class="title">用户详情</view>
				</view>
			</u-navbar>
			<view class="area">
				<view class="userInfo">
					<view class="uxfelx">
						<view class="left">
							<image class="hreadImg" :src="userInfo.avatarUrl"></image>
						</view>
						<view class="right">
							<view>{{userInfo.nickName || '--'}}</view>
							<view>{{userInfo.phoneNumber |'--'}}</view>
						</view>
					</view>

					<view class="fxflex">
						<view class="left">
							<view class="member" style="text-align: center;">
								{{userInfo.memberName || '--'}}
							</view>
							<view class="grade">
								会员等级
							</view>
						</view>
						<view class="center">
							<view class="member" style="text-align: center;">
								{{userInfo.residualMaturity || 0}}
							</view>
							<view class="grade">
								剩余会员期限
							</view>
						</view>
						<view class="right">
							<view class="member" style="text-align: center;">
								{{userInfo.remainingPoints || 0}}
							</view>
							<view class="grade">
								剩余积分
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="card">
			<view class="xflex">
				<view class="left">
					注册时间
				</view>
				<view class="right">
					{{userInfo.createTime}}
				</view>
			</view>
		</view>
		<view style="display: flex; justify-content: center; margin-top: 597rpx;">
			<view class="historicalOrders" @click="startHistor">历史订单</view>
			<view class="hisGarage" @click="startHisGarage">TA的车库</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				userInfo: ''
			}
		},

		onLoad(op) {
			this.id = op.id
			this.getorderDetails()
		},

		methods: {
			getorderDetails() {
				this.$http.get('/api/store/clientUser/details', {
					userId: this.id
				}).then(res => {
					this.userInfo = res.data
				})
			},



			startHistor() {
				uni.navigateTo({
					url: '/pages/historicalOrders/historicalOrders?id=' + this.id
				})
			},

			startHisGarage() {
				uni.navigateTo({
					url: '/pages/garageList/garageList?id=' + this.id
				})
			}

		}
	}
</script>

<style lang="scss">
	.historicalOrders {
		width: 340rpx;
		height: 100rpx;
		text-align: center;
		background: #FF8A60;
		border-radius: 50rpx 50rpx 50rpx 50rpx;
		font-size: 32rpx;
		color: #FFFFFF;
		font-weight: 800;
		line-height: 100rpx;

	}

	.hisGarage {
		width: 340rpx;
		margin-left: 22rpx;
		text-align: center;
		font-weight: 800;
		font-size: 32rpx;
		line-height: 100rpx;
		color: #FFFFFF;
		height: 100rpx;
		background: linear-gradient(90deg, #FF4502 0%, #FF8903 100%);
		border-radius: 50rpx 50rpx 50rpx 50rpx;
	}

	.bgMain {
		background: #FAF7F6;
		position: absolute;
		width: 100%;
		height: 100vh;
		padding: 0;
	}

	.member {
		font-size: 30rpx;
		color: #333333;
		font-weight: 800;
	}

	.grade {
		margin-top: 10rpx;
		font-family: Microsoft YaHei, Microsoft YaHei;
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
	}

	.area {
		margin: 24rpx;
	}

	.userInfo {
		padding: 24rpx;
		background: #FFFFFF;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
		position: absolute;
		width: 87%;
		z-index: 9;
	}

	.hreadImg {
		width: 120rpx;
		height: 120rpx;
	}

	.navSlot .title {
		color: white !important;
	}

	.nav {
		width: 100%;
		height: 234rpx;
		z-index: 2;
		position: relative;
		background-size: 100%;
		background-image: url('/static/bg/bg_preson.png');
	}

	.card {
		background: white;
		margin-top: 250rpx;
		padding: 40upx 30upx;
	}

	.xflex {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.right {
		padding-left: 10rpx;
	}

	.uxfelx {
		display: flex;
		// align-items: center;
	}

	.fxflex {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20upx;
	}
</style>