<template>
<view class="container">
<!-- 自定义顶部 -->
<view class="custom-header">
<uni-icons type="left" size="40rpx" 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">
<image src="../../static/login/logo.png" mode=""></image>
</view>
<view class="con_btn">
<button type="primary" @click="chooseAvatar()">一键登录</button>
<button type="default" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">暂不登录</button>
</view>
<!-- 内部使用 -->
<view class="tips">
<uni-icons type="info" size="35rpx" color="#5581FF" style="margin-right: 5rpx;height:30rpx;width: 30rpx;"></uni-icons><text>仅限内部人员使用</text>
</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;
position: relative;
}
.custom-header {
height: 77rpx;
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;
font-weight: 400;
font-size: 30rpx;
}
.content{
position: relative;
.meisheng_first_aid{
position: absolute;
top: 300rpx;
left: 273rpx;
width: 205rpx;
height: 158rpx;
image{
width: 100%;
height: 100%;
}
}
.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: 75rpx;
border-radius: 35rpx;
line-height: 75rpx;
font-size: 20rpx;
font-style: 400;
}
}
//提示信息
.tips{
position: absolute;
left: 230rpx;
top:1232rpx;
width: 250rpx;
height: 60rpx;
color: #5581FF;
font-size: 26rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
.popup-content{
height: 600rpx;
}
</style>