<template>
	<view class="container">
	    <!-- 自定义顶部 -->
	    <view class="custom-header">
			<uni-icons type="left" size="30" class="uni_back" @click="goBack"></uni-icons>
	      <view class="left-icon" @click="goBack">授权</view>
	      <view class="title"></view>
	    </view>
	
	    <!-- 页面内容 -->
	    <view class="content">
	      <view class="meisheng_first_aid">
	      	
	      </view>
		  <view class="con_btn">
		  	<button type="primary" @click="chooseAvatar()">一键登录</button>
			<button type="default"  open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">暂不登录</button>				
		  </view>
	    </view>
		
	
	  </view>

</template>

<script>
	export default {
		data() {
			return {
				type:''
			};
		},
		 methods: {
		    goBack() {
		      uni.navigateBack();
		    },
			// 一键登录
			chooseAvatar(){
				uni.getUserProfile({
				  desc: '用于完善用户资料', // 授权说明
				  success: function (res) {
					console.log(res.userInfo,'res');
					// 在这里可以将用户信息保存到本地或者发送到服务器
					uni.switchTab({
						url:'/pages/home/index'
					})
				  },
				  fail: function (res) {
					console.log('用户拒绝授权获取个人信息');
				  }
				});
			},
			
			getPhoneNumber(e){
				console.log(e,'e');
			},
		  }
	}
</script>

<style lang="scss" scoped>
.container {
  height: 100vh;
}

.custom-header {
  height: 5%;
  background-color: #fff;
  color: black;
  display: flex;
  align-items: center;
  padding-top: 10rpx;
}
.uni_back{
	margin-left: 25rpx;
}
.left-icon {
  font-size: 20rpx;
  color: #141414;
  width: 59rpx;
  height: 29rpx;
  line-height: 29rpx;
}
.content{
	position: relative;
	.meisheng_first_aid{
		position: absolute;
		top: 300rpx;
		left: 273rpx;
		width: 205rpx;
		height: 158rpx;
		
	}
	.con_btn{
		width: 447rpx;
		height: 239rpx;
		position: absolute;
		left: 134rpx;
		top: 614rpx;
		
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		align-content: space-around;
		button{
			width: 325rpx;
			height: 70rpx;
			// border-radius: 50%;
			line-height: 70rpx;
		}
	}
}
.popup-content{
	height: 600rpx;
}
</style>
