弹出遮罩层弹窗组件

一.    带蒙版弹出窗口

1.  HTML页面

<view class="float-bg"  wx:if="{{isShow}}" >
  <view class="mid-bg">
    <image class="header_img" mode="aspectFill" src="../../images/tabbar_mine_alert_change.png" ></image>
    <view class="con-text">提交成功 , 等待处理</view>
    <view class="but-bg">
        <!-- <view class="cancel-button" bindtap="cancelClick">取消</view> -->
        <view class="commit-button" bindtap="commitClick">确定</view>
    </view>
  </view>
</view>

2. css页面

/*wxss */
.float-bg{
  position: fixed;
  width: 750rpx;
  height: 100%;
  background-color: #33333333;
  z-index: 99;
  top: 0;
}
.mid-bg{
  width: 500rpx;
  height: 300rpx;
  margin-left: 125rpx;
  margin-top:60%;
  background-color: white;
  border-radius: 20rpx;
}
.header_img{
  position: relative;
  width: 100rpx;
  height: 100rpx;
  left: 200rpx;
  top: -40rpx;
}
.con-text{
  width: 500rpx;
  height: 50rpx;
  text-align: center;
  font-size: 30rpx;
  color: #333;
}
.but-bg{
  width: 500rpx;
  height: 80rpx;
  margin-top: 30rpx;
  display: flex;
}
/* .cancel-button{
  width: 130rpx;
  height: 70rpx;
  background-color: #AAA;
  line-height: 70rpx;
  text-align: center;
  font-size: 26rpx;
  color: white;
  border-radius: 10rpx;
  margin-left: 60rpx;
} */
.commit-button{
  width: 130rpx;
  height: 70rpx;
  background-color: #EE7532;
  line-height: 70rpx;
  text-align: center;
  font-size: 26rpx;
  color: white;
  border-radius: 10rpx;
  margin-left: 185rpx;
  margin-top: 10rpx;
}

3.js页面

//js文件
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    
  },

  /**
   * 组件的初始数据
   */
  data: {
    isShow:true
  },

  /**
   * 组件的方法列表
   */
  methods: {
    cancelClick:function (e) {
      var myEventDetail = {} // detail对象,提供给事件监听函数
      var myEventOption = {} // 触发事件的选项
      this.triggerEvent('cancelclick', myEventDetail, myEventOption)
      this.setData({
        isShow:false
      })
    },
    commitClick:function (e) {
      var myEventDetail = {} // detail对象,提供给事件监听函数
      var myEventOption = {} // 触发事件的选项
      this.triggerEvent('commitlclick', myEventDetail, myEventOption)
      this.setData({
        isShow:false
      })
      wx.switchTab({
        url: '/pages/TabarMinePage/TabbarMinePage',
      })
    },
    

  },
  
})

如有错误,请各位大佬不吝赐教~~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值