zoukankan      html  css  js  c++  java
  • 小程序自定义弹窗

    wxml

    <view class='cardNum'> 
    <text catchtap='showDialogBtn'>解除绑定</text>
    </view>

    <!--弹窗--> <view class="modal-mask" bindtap="hideModal" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view> <view class="modal-dialog" wx:if="{{showModal}}"> <view class="modal-content"> 解除板顶后银行卡服务将不可使用 </view> <view class="modal-footer"> <view class="btn-cancel" bindtap="hideModal" data-status="cancel">取消</view> <view class="btn-confirm" bindtap="onConfirm" data-status="confirm">确定</view> </view> </view>

    wxss

    .cardNum text{
    background: white;
    float: right;
    padding: 5rpx 10rpx;
    border-radius: 8rpx;
    font-size: 24rpx;
    color:#a53533;
    margin-right: 30rpx;
    }

    .modal-mask { 100%; height: 100%; position: fixed; top: 0; left: 0; background: #000; opacity: 0.5; overflow: hidden; z-index: 9000; color: #fff; } .modal-dialog { 540rpx; overflow: hidden; position: fixed; top: 50%; left: 0; z-index: 9999; background: #f9f9f9; margin: -180rpx 105rpx; border-radius: 8rpx; } .modal-content { padding: 50rpx 0rpx; text-align: center; color: #666 } .modal-footer { display: flex; flex-direction: row; height: 86rpx; border-top: 1px solid #dedede; font-size: 32rpx; line-height: 86rpx; } .btn-cancel { 50%; color: #666; text-align: center; border-right: 1px solid #dedede; } .btn-confirm { 50%; background:#a53533; color: white; text-align: center; }

    wxjs

    Page({
    
      data: {
        cardList: [ ],
        showModal: false,
    
      },
    
      showDialogBtn: function () {
        var that = this
        that.setData({
          showModal: true
        })
      },
      /**
       * 弹出框蒙层截断touchmove事件
       */
      preventTouchMove: function () {
      },
      /**
       * 隐藏模态对话框
       */
      hideModal: function () {
        var that = this
        that.setData({
          showModal: false
        });
      },
      onLoad: function (options) {
    
      },
      onShow: function () {
    
      } 
    
    })

     

  • 相关阅读:
    HDU 5360——Hiking——————【贪心+优先队列】
    HDU 5351——MZL's Border——————【高精度+找规律】
    高精度运算——java
    java题目练手
    java学习
    Arduino 模拟引脚
    Batch批处理 间断向EXE发送参数
    Example Code for a TMP102 I2c Thermometer————Arduino
    c++中vector的用法详解
    C/C++ 中 exit() 函数
  • 原文地址:https://www.cnblogs.com/xiaoxiao2017/p/10740331.html
Copyright © 2011-2022 走看看