标签:程序 实现 oda price pre XML api rgba 组件
<view wx:if="{{showPowerPriceView}}">
<view class=‘bg_layer‘>
    <view class="power-price-box power-price-flex">
自定义内容
</view>
</view>
</view>
// 打开模态框
 showPowerPrice: function() {
    this.setData({
      showPowerPriceView: true
    })
  },
// 关闭模态框
  closeModal: function () {
    this.setData({
      showPowerPriceView: false
    })
  }
蒙层
.bg_layer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9998;
}
自定义模态框内容,居中显示
.power-price-box {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 600rpx;
  background: rgba(232, 240, 255, 1);
  border-radius: 10rpx;
  z-index: 9999;
}
标签:程序 实现 oda price pre XML api rgba 组件
原文地址:https://www.cnblogs.com/yuanchao-blog/p/12653580.html