小程序登录按钮遮罩浮层效果

来源:未知 浏览 134次 时间 2021-06-09 04:39

逻辑如下:

 

1:第一次登陆的时候会有一个登录按钮遮罩浮层提示去授权登录

小程序登录按钮遮罩浮层效果

3:判断是否授过权(判断是第一次登录还是第n次)如果用户第一次已经登录授权后面继续登录的时候悬浮框就不会再出现

 

小程序登录按钮遮罩浮层效果

index.html

 

<!-- 授权弹框提示 --> <view class="container"> <view class="float" hidden='{{viewShowed}}'> <view class='floatContent'> <view class='floatText'> <text>获取微信授权信息</text> <button open-type="getUserInfo" bindgetuserinfo="getUserInfo">去设置</button> </view> </view> </view> </view>  

index.wxss

 

.float { height: 100%; width: 100%; position: fixed; background-color: rgba(0, 0, 0, 0.5); z-index: 2; top: 0; left: 0; } .floatContent { padding: 20rpx 0; width: 80%; background: #fff; margin: 40% auto; border-radius: 20rpx; display: flex; flex-direction: column; justify-content: space-around; align-items: center; position: relative; height: 332rpx; } .floatText text { color: #000; font-size: 40rpx; display: block; text-align: center; line-height: 90rpx; border-radius: 30rpx; margin-right: 10rpx; }  

index.js

 

标签: viewgtlt授权