accredit.vue 2.12 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
<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>