微信小程序wepy框架下的页面显示/隐藏

 

<view class="m-modal" hidden='{{flag}}'>
      <view class="m-free">
        <image class="free-close" src="../../assets/images/close-2.png" @tap="closeFlag"></image>
        <image class="free-img" src="../../assets/images/v-free.png"></image>
        <text class="free-tit">关注公众号,免费观看视频</text>
        <text class="free-txt">青柠健康,让你每天健康一点,微信搜索公众号guangzhouhaici,立即关注</text>

      </view>
</view>
.m-modal{
    background-color: rgba(0, 0, 0, 0.4);
    position: fixed;
    flex-direction: column;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
  }
  .m-free{
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 600rpx;
    height: 648rpx;
    background-color: white;
    border-radius: 10rpx;
    .free-close{
      width: 26rpx;
      height: 26rpx;
      margin-top: 20rpx;
      margin-left: 544rpx;
    }
    .free-img{
      width: 320rpx;
      height: 219rpx;
      margin: 0 140rpx 20rpx;
    }
    text{
      text-align: center;
      padding: 20rpx 42rpx 0;
    }
    .free-tit{
      //font-size: 34rpx;
      color: #2D2D2D;
    }
    .free-txt{
      font-size: 28rpx;
      color: #696969;
    }

  }

hidden的设置:false显示,true隐藏 

data = {
      flag:false
}

methods = {

      closeFlag:function () {
        this.flag = true
      }
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值