首页 > 技术文章 > 小程序---提交成功弹框

wangshishuai 2018-10-27 16:41 原文

xml

<view>
  <view class="bg" style='display:{{display}}'></view>
  <view class="show" style='display:{{display}}'>
    <image class='img1s' bindtap='hideview' src='../../images/sc.png'></image>
    <image class='img2s' src='../../images/ts@2x.png'></image>
    <view class='txt1'>删除成功</view>
    
  </view>
</view>

wss

.bg {
  display: none;
  position: absolute;
  top: 0%;
  left: 0%;
  width: 100%;
  height: 100%;
  background-color: black;
  z-index: 1001;
  -moz-opacity: 0.7;
  opacity: 0.70;
  filter: alpha(opacity=70);
}
.show {
  display: none;
  text-align: center;
  position: absolute;
  top: 25%;
  left: 30rpx;
  margin: 0 auto;
  /* left: 20%; */
  width: 690rpx;
  height: 400rpx;

  background-color: white;
  z-index: 1002;
  overflow: auto;
}
.txt1{
  margin-top: 20rpx;
  font-size: 36rpx;
  color: rgb(0,192,10);
}
.txt2{
  margin-top: 40rpx;
  font-size: 30rpx;
  color: (51,51,51)
  }
.img1s{
  position: absolute;
  right: 30rpx;
   width: 40rpx;
  height: 40rpx;

  top: 20rpx;
}

.img2s{
  margin-top: 100rpx;
  width: 100rpx;
  height: 100rpx;
}

js

  data: {
    display:'block'
  },
  showview: function () {
    this.setData({
      display: "block",
      nons: true
    })
    console.log(that.data.nons)
  },
  hideview: function () {
    this.setData({
      display: "none",
      nons: false,
    })
    this.onLoad()
  },
  removes:function(){
    let that=this
    that.setData({
      display: "block",
      nons: true,
    })
  },

 

推荐阅读