<template>
	<view class="container">
		<view class="position-relative">
			<view class="bg"></view>
		</view>

		<view class="bg-white">
			<view style="padding: 0 30rpx;">
				<view class="d-flex flex-column bg-white user-box">
					<view class="d-flex align-items-center">
						<view class="avatar">
							<image :src="isLogin ? member.avatar  : '/static/images/mine/default.png'"></image>
							<view class="badge">
								<image src="/static/images/mine/level.png"></image>
								<view>{{vipName}}</view>
							</view>
						</view>
						<view class="d-flex flex-column flex-fill overflow-hidden" style="margin-top: 20rpx;">
							<view v-if="isLogin"
								class="font-size-lg font-weight-bold d-flex justify-content-start align-items-center"
								@tap="userinfo">
								<view class="text-truncate">{{ member.nickname }}</view>
								<view class="iconfont iconarrow-right line-height-100"></view>
							</view>
							<view v-else class="font-size-lg font-weight-bold" @tap="login">请点击授权登录</view>

							<!-- <view class="flex-row-start-col-center">
								<view class="font-size-sm text-color-assist">
									当前积分{{ isLogin ? member.value : 0 }}
								</view>
							</view> -->

							<!-- <view class="w-100">
								<progress percent="0" activeColor="#ADB838" height="8rpx" :percent="growthValue"
									border-radius="8rpx" />
							</view> -->
						</view>
					</view>
					<view class="user-info">
						<view class="user-info-item">
							<view class="user-info-label">积分：</view>
							<view class="user-info-value">{{ isLogin ? member.value : '***' }}</view>
						</view>
						<view v-if="showVip" class="user-info-item">
							<view class="user-info-label">到期时间：</view>
							<view class="user-info-value">{{ member.vipTime }}</view>
						</view>
					</view>
					<!-- <view class="w-100 d-flex align-items-center just-content-center">
						<view class="user-grid">
							<view class="value font-size-extra-lg font-weight-bold text-color-base">
								{{ isLogin ? member.value : '***' }}
							</view>
							<view class="font-size-sm text-color-assist">积分</view>
						</view>
						<view class="user-grid">
							<view class="value font-size-extra-lg font-weight-bold text-color-base">
								{{ showVip ? member.vipTime : '***' }}
							</view>
							<view class="font-size-sm text-color-assist">到期时间</view>
						</view>
					</view> -->
				</view>
			</view>
			<view class="service-box">
				<view class="font-size-lg text-color-base font-weight-bold" style="margin-bottom: 20rpx;">我的服务</view>
				<view class="row">
					<view class="grid" @tap="attendance">
						<view class="image">
							<image src="/static/images/mine/jfqd.png"></image>
						</view>
						<view>福利签到</view>
					</view>
					<view class="grid" @tap="balance">
						<view class="image">
							<image src="/static/images/mine/qb.png"></image>
						</view>
						<view>会员充值</view>
					</view>
				</view>
				<!-- v-if="isLogin" -->
				<button type="primary" @tap="logout">退出登录</button>
			</view>
		</view>
	</view>
</template>


<style lang="scss" scoped>
	page {
		height: auto;
		min-height: 100%;
	}

	.container {
		//background-image: url('/static/images/integrals/bg.png');
		background-color: white;
		height: 100%;
		//background-size:cover;
	}

	.bg {
		width: 100%;
		height: calc(410 / 594 * 250rpx);


	}

	.hym-btn {
		position: absolute;
		top: 40rpx;
		right: 40rpx;
		color: $color-primary;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 50rem;
		font-size: $font-size-sm;
		box-shadow: 0 0 20rpx rgba(66, 66, 66, 0.1);

		&::after {
			border: 0;
		}

		image {
			width: 30rpx;
			height: 30rpx;
			margin-right: 10rpx;
		}
	}

	.user-box {
		position: relative;
		border-radius: 8rpx;
		margin-bottom: 30rpx;
		margin-top: -115rpx;
		box-shadow: $box-shadow;
	}

	.user-type {
		@include flex-row-start-col-center;
		margin-right: 20rpx;

		image {
			width: 30rpx;
			height: 30rpx;
		}
	}

	.user-info {
		padding: 30rpx;

		.user-info-item {
			@include flex-row-start-col-center;
			margin-bottom: 20rpx;
@include font-size-lg;
			&:last-child {
				margin-bottom: 0;
			}

			.user-info-label {
				// @include font-size-lg;
			}

			.user-info-value {
				// font-size: 40rpx;
				font-weight: bold;
			}
		}
	}

	button[plain] {
		border: 0
	}

	.avatar {
		position: relative;
		margin-top: -35rpx;
		margin-left: 0rpx;
		margin-right: 35rpx;
		width: 160rpx;
		height: 160rpx;
		border-radius: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #FFFFFF;
		box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: 0.2);

		image {
			width: 140rpx;
			height: 140rpx;
			border-radius: 100%;
		}

		.badge {
			position: absolute;
			right: -10rpx;
			bottom: -10rpx;
			background-color: #FFFFFF;
			border-radius: 50rem;
			display: flex;
			align-items: center;
			justify-content: center;
			color: $color-warning;
			font-size: 24rpx;
			padding: 8rpx;
			box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: 0.2);

			image {
				width: 30rpx;
				height: 30rpx;
			}
		}
	}

	.level-benefit {
		margin-left: 35rpx;
		padding: 10rpx 0 10rpx 30rpx;
		border-radius: 50rem 0 0 50rem;
	}

	.user-grid {
		width: 25%;
		padding: 30rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		.value {
			margin-bottom: 20rpx;
		}
	}

	.level-benefit-box {
		border-radius: 8rpx;
		margin-bottom: 30rpx;
		box-shadow: 0 10rpx 8rpx rgba($color: #878889, $alpha: 0.1);
		width: 100%;
		display: flex;
		padding: 30rpx;
		flex-direction: column;
		background-color: #FFFFFF;

		.row {
			display: flex;
			padding: 30rpx 0 20rpx;
			justify-content: space-around;
			align-items: center;

			.gri1d {
				width: 20%;
				display: flex;
				flex-direction: column;
				font-size: $font-size-sm;
				color: $text-color-assist;
				align-items: center;

				image {
					width: 80rpx;
					height: 80rpx;
					margin-bottom: 10rpx;
				}
			}
		}
	}

	.banner {
		width: 100%;
		border-radius: 8rpx;
		margin-bottom: 30rpx;
	}

	.service-box {
		width: 100%;
		background-color: #FFFFFF;
		padding: 32rpx 30rpx 10rpx;


		.row {
			display: flex;
			flex-wrap: wrap;
			color: $text-color-assist;
			font-size: $font-size-sm;
			padding-bottom: -40rpx;

			.gridbutton {
				background-color: #FFFFFF;
				line-height: 32rpx;
				font-size: 24rpx;
				color: #919293;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				margin-bottom: 40rpx;
				width: 25%;
				position: relative;

				button::after {
					border: none;
				}

				.image {
					image {
						width: 80rpx;
						height: 80rpx;
						margin-bottom: 20rpx;
					}
				}

				.new-badage {
					width: 40rpx;
					height: 40rpx;
					position: absolute;
					top: 0;
					right: 30rpx;
				}
			}

			.grid {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				margin-bottom: 40rpx;
				width: 25%;
				position: relative;

				.image {
					image {
						width: 80rpx;
						height: 80rpx;
						margin-bottom: 20rpx;
					}
				}

				.new-badage {
					width: 40rpx;
					height: 40rpx;
					position: absolute;
					top: 0;
					right: 30rpx;
				}
			}
		}
	}
</style>