<template>
	<s-layout title="我的" tabbar="/pages/index/user" navbar="custom" :bgStyle="template.style?.background"
		:navbarStyle="template.style?.navbar" onShareAppMessage :showFloatButton="true">
		<!-- 登录信息 -->
		<view class="myBox">
				<view @touchmove.prevent scroll-y="true" :show-scrollbar="true"
					class="con-center flex flex-start flex-column">
					<view class="header">
						<!-- 用户信息 -->
						<view class="hea-left flex">
							<view class="head-avatar" @click="toLogin">
								<image style="width: 130rpx;height: 130rpx;border-radius: 152rpx;"
									src="/static/wechat.png"></image>
							</view>
							<view class="headAvatar-info justify-start">
								<view class="info-name fs-36 weight8 flexD">会飞的蜗牛
									<view class="authenticationBox weight8 fs-20">已认证</view>
								</view>
								<view class="fs-28 weight4" style="margin-top: 30rpx;">剩余拨打次数： 10次</view>
							</view>
							<view class="head-signInBox">
								<image style="width: 46rpx;height: 44rpx;" src="https://jiangxiaoxian.0rui.cn/signIn.png" mode=""></image>
								<view class="signInText" style="margin-left: 10rpx;">签到</view>
							</view>
							
						</view>
						
						<!-- 四个主内容 -->
						<view class="head-secondBox">
							<view class="collect">
								<view class="collect-num">14</view>
								<view class="collect-text">收藏</view>
							</view>
							<view class="feetPrint">
								<view class="feetPrint-num">14</view>
								<view class="feetPrint-text">足迹</view>
							</view>
							<view class="feetPrint">
								<view class="feetPrint-num">14</view>
								<view class="feetPrint-text">积分</view>
							</view>
							<view class="collect">
								<view class="collect-num">14</view>
								<view class="collect-text">优惠券</view>
							</view>
						</view>
					</view>
					
					<!-- 我的订单 -->
					<view class="myOrder">
						<view class="myOrder-first">
							<view style="font-weight: 800;font-size: 34rpx;line-height: 28rpx;color: #3d3d3d;">我的订单</view>
							<view style="display: flex;align-items: center;justify-content: center;">
								<view style="font-size: 26rpx;line-height: 26rpx;font-weight: 400;color: #999999;">全部订单</view>
								<image style="width: 28rpx;height: 28rpx;margin-left: 10rpx;" src="https://jiangxiaoxian.0rui.cn/rightMore.png" mode=""></image>
								<!-- <uni-icons type="arrowthinright" color="#999" style="line-height: 40px;"></uni-icons> -->
							</view>
						</view>
						<view class="myOrder-second">
							<view class="pendingBox">
								<image class="pendImg" src="https://jiangxiaoxian.0rui.cn/pendPay.png"></image>
								<view class="fs-28 weight4" style="margin-top: 20rpx;color: #3d3d3d;">待支付</view>
							</view>
							<view class="pendingBox">
								<image class="pendImg" src="https://jiangxiaoxian.0rui.cn/shipment.png"></image>
								<view class="fs-28 weight4" style="margin-top: 20rpx;color: #3d3d3d;">待发货</view>
							</view>
							<view class="pendingBox">
								<image class="pendImg" src="https://jiangxiaoxian.0rui.cn/pendingDoods.png"></image>
								<view class="fs-28 weight4" style="margin-top: 20rpx;color: #3d3d3d;">待收货</view>
							</view>
							<view class="pendingBox">
								<image class="pendImg" src="https://jiangxiaoxian.0rui.cn/completed.png"></image>
								<view class="fs-28 weight4" style="margin-top: 20rpx;color: #3d3d3d;">已完成</view>
							</view>
						</view>
					</view>


					<view style="height: 80rpx;width: 100%;"></view>
				</view>



				<!-- 授权登录 
				<u-popup :show="showLogin == true" type="center" round="20"
					:customStyle="{ 'width': '644rpx', 'height': '426rpx','position': 'relative'}" :closeable="false"
					@close="closeLogin" @open="openLogin">
					<view class="popup">
						<button class="texbut" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
							授权登录
						</button>
					</view>
				</u-popup>-->
				
				<su-popup :show="showLogin == true" type="center" round="10" :isMaskClick="false">
				 <view class="popup">
				 	<button class="texbut" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
				 		授权登录
				 	</button>
				 </view>
				</su-popup>
		
				<!-- <u-toast ref="uToast"></u-toast> -->

		</view>

		<!-- <s-block v-for="(item, index) in template.data" :key="index" :styles="item.style">
      <s-block-item :type="item.type" :data="item.data" :styles="item.style" />
    </s-block> -->
	</s-layout>
</template>

<script setup>
	import {
		computed,
		ref
	} from 'vue';
	import {
		onShow,
		onPageScroll,
		onPullDownRefresh
	} from '@dcloudio/uni-app';
	import sheep from '@/sheep';
	
	const showLogin = ref(false);
	

	// 隐藏原生tabBar
	uni.hideTabBar({
		fail: () => {},
	});

	const template = computed(() => sheep.$store('app').template.user);
	const isLogin = computed(() => sheep.$store('user').isLogin);

	onShow(() => {
		sheep.$store('user').updateUserData();
	});

	onPullDownRefresh(() => {
		sheep.$store('user').updateUserData();
		setTimeout(function() {
			uni.stopPullDownRefresh();
		}, 800);
	});

	onPageScroll(() => {});
	
	function toLogin() {
		console.log('toLogin',showLogin.value);
		showLogin.value = true;
		console.log('showLogin',showLogin.value);
	}
	function closeLogin() {
		console.log('closeLogin');
		showLogin.value = false;
	}
	function openLogin() {
		console.log('openLogin');
		showLogin.value = true;
	}
	
</script>

<style lang="scss" scoped>
	.pendImg {
		width: 70rpx;
		height: 70rpx;
	}
	
	.weight4 {
		font-weight: 400;
	}

	.weight8 {
		font-weight: 400;
	}

	.fs-28 {
		font-size: 28rpx;
		line-height: 28rpx;
	}

	.fs-36 {
		font-size: 36rpx;
		line-height: 36rpx;
	}

	.fs-20 {
		font-size: 20rpx;
		line-height: 20rpx;
	}

	.flexD {
		display: flex;
	}

	.gird {
		display: grid;
	}

	.w-100 {
		width: 100%;
	}

	.flex {
		display: flex;
	}

	.flex-start {
		align-items: flex-start;
	}

	.justify-center {
		justify-content: center;
	}

	.align-items {
		align-items: center;
	}

	.flex-column {
		flex-flow: column;
	}

	.justify-start {
		justify-content: start;
	}
	
	.myBox {
		position: fixed;
		width: 750rpx;
		min-height: 100vh;
		background-color: #F5F5F5;
		background-size: 100%;
		background-repeat: no-repeat;
	}

	.con-center {
		height: 1314rpx;
		// padding: 0 30rpx;

		.header {
			width: 93%;
			height: 620rpx;
			padding: 0 30rpx;
			justify-content: space-between;
			align-items: center;
			// margin: 0 auto;
			// padding: 30rpx;
			background-image: url('https://jiangxiaoxian.0rui.cn/topback.png');
			background-size: 100%;

			.hea-left {
				width: 100%;
				height: 140rpx;
				align-items: center;
				position: relative;
				top: 180rpx;

				.avatar {
					width: 140rpx;
					height: 140rpx;
					border-radius: 50%;
				}

				.head-avatar {
					width: 130rpx;
					height: 130rpx;
					margin-right: 30rpx;
				}

				.headAvatar-info {
					display: gird;
					// align-items: center;
					// justify-content: center;

					.info-name {
						display: flex;
						justify-content: flex-start;
						font-weight: 900rpx;
						align-items: center;


						.authenticationBox {
							margin-left: 10rpx;
							background-color: #333333;
							border-radius: 8rpx;
							width: 80rpx;
							height: 30rpx;
							color: #fecc4e;
							display: flex;
							padding: 5rpx 10rpx 8rpx 10rpx;
							align-items: center;
							justify-content: center;
						}
					}
				}
				
				.head-signInBox {
					width: 156rpx;
					height: 70rpx;
					position: absolute;
					right: -30rpx;
					display: flex;
					justify-content: center;
					background-color: #fff;
					align-items: center;
					border-radius: 116rpx 0 0 116rpx;
					
					.signInText {
						font-size: 30rpx;
						font-weight: 800;
						line-height: 28rpx;
						color: #333333;
					}
				}
				

				
				.line {
					width: 320rpx;
					height: 1rpx;
					background: #BABDC7;
					border-radius: 0rpx 0rpx 0rpx 0rpx;
					margin: 19rpx 0 7rpx 0;
				}

				.red {
					font-family: PingFang SC, PingFang SC;
					font-weight: 800;
					font-size: 26rpx;
					color: #FF4949;
					line-height: 32rpx;
				}
			}
			
			.head-secondBox {
				margin-top: 50rpx;
				display: flex;
				justify-content: space-around;
				align-items: center;
				height: 76rpx;
				width: 100%;
				position: relative;
				top: 190rpx;
				
				.collect {
					display: grid;
					align-items: center;
					text-align: center;
					justify-content: center;
					width: 158rpx;
					height: 100%;
					
					.collect-num {
						font-size: 34rpx;
						font-weight: 800;
						color: #333333;
						line-height: 28rpx;
					}
					
					.collect-text {
						margin-top: 20rpx;
						font-size: 28rpx;
						font-weight: 400;
						color: #333333;
						line-height: 28rpx;
					}
				}
				
				.feetPrint {
					display: grid;
					align-items: center;
					text-align: center;
					justify-content: center;
					width: 188rpx;
					height: 100%;
					
					.feetPrint-num {
						font-size: 34rpx;
						font-weight: 800;
						color: #333333;
						line-height: 28rpx;
					}
					
					.feetPrint-text {
						margin-top: 20rpx;
						font-size: 28rpx;
						font-weight: 400;
						color: #333333;
						line-height: 28rpx;
					}
				}
			}

			.line {}

		}
		
		.myOrder {
			width: 630rpx;
			height: 206rpx;
			margin: 0 auto;
			position: relative;
			bottom: 108rpx;
			background-color: #ffffff;
			border-radius: 18rpx;
			display: block;
			padding: 40rpx 30rpx;
			
			.myOrder-first {
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;
			}
			
			.myOrder-second {
				width: 100%;
				display: flex;
				margin-top: 40rpx;
				justify-content: space-between;
				
				.pendingBox {
					display: block;
					justify-content: center;
					align-items: center;
					
				}
			}
		}
		
	}



	.popup {
		background-image: url('https://jiangxiaoxian.0rui.cn/showLogin.png');
		background-size: 100%;
		width: 600rpx;
		height: 640rpx;
		display: flex;
		padding-bottom: 44rpx;
		flex-direction: column;
		align-items: baseline;
		justify-content: flex-end;
		padding-left: 73rpx;
		padding-right: 73rpx;

		.img_shouquan {
			position: absolute;
			width: 680rpx;
			height: 857rpx;
			left: -25rpx;
			top: -390rpx;
		}


		#txt2 {
			text-align: center;
			margin-top: 200rpx;
			font-size: 28rpx;
			color: #525252;
			margin-bottom: 60rpx;
			position: relative;
			font-weight: 500;
		}

		.texbut {
			width: 507rpx;
			height: 90rpx;
			border-radius: 45rpx;
			background: #ffbd25;
			font-size: 34rpx;
			color: #3d3d3d;
			font-weight: bold;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}






</style>