微信小程序中的弹出框

时间:2024-10-03 20:41:14
  • <view>
  •   <view class='dialog-container' hidden="{{hasUserInfo}}">
  •   <text>{{hasUserInfo}}</text>
  •     <view class='dialog-mask'></view>
  •     <view class='dialog-info'>
  •         <view class='dialog-title'>登陆提示</view>
  •         <view class='dialog-content'>为了您能有更好的体验,请点击授权?</view>
  •         <view class='dialog-footer'>
  •           <button class='dialog-btn' open-type="getUserInfo" bindgetuserinfo='bindGetUserInfo' catchtap='confirmEvent'>点击授权</button>
  •         </view>
  •     </view>
  • </view>
  • .dialog-mask{
  •   position: fixed;
  •   z-index: 1000;
  •   top: 0;
  •   right: 0;
  •   left: 0;
  •   bottom: 0;
  •   background: rgba(0, 0, 0, 0.3);
  • }
  • .dialog-info{
  •   position: fixed;
  •   z-index: 5000;
  •   width: 80%;
  •   max-width: 600rpx;
  •   top: 50%;
  •   left: 50%;
  •   -webkit-transform: translate(-50%, -50%);
  •   transform: translate(-50%, -50%);
  •   background-color: #FFFFFF;
  •   text-align: center;
  •   border-radius: 3px;
  •   overflow: hidden;
  • }
  • .dialog-title{
  •   font-size: 36rpx;
  •   padding: 30rpx 30rpx 10rpx;
  • }
  • .dialog-content{
  •   padding: 10rpx 30rpx 20rpx;
  •   min-height: 80rpx;
  •   font-size: 32rpx;
  •   line-height: 1.3;
  •   word-wrap: break-word;
  •   word-break: break-all;
  •   color: #999999;
  • }
  • .dialog-footer{
  •   display: flex;
  •   align-items: center;
  •   position: relative;
  •   line-height: 90rpx;
  •   font-size: 34rpx;
  • }
  • .dialog-btn{
  •   display: block;
  •   -webkit-flex: 1;
  •   flex: 1;
  •   position: relative;
  •   color: #3CC51F;
  • }