微信效果记录_懒汉式

1、弹窗,一个输入框,一个确定,一个取消
弹窗.png
1、弹窗,一个输入框,一个确定,一个取消

wxml

<!--蒙层-->
<view class='drawer_screen' hidden="{{isHiddenDialog}}"></view>
<view class='passworddialog'  hidden="{{isHiddenDialog}}">
  <view class="drawer_title">提示</view>
   <view class="drawer_content">
     <view class="top grid">
      <label class="title col-0">金额</label>
      <input class="input_base input_h30 col-1" type='number' name="rName" placeholder='请输入金额' bindinput='inputNumberListener'></input>
    </view>
   </view>
   <view class='button_sure_calcle'>
      <view class='button_tb cancle' bindtap='cancleListener'>
        取消
      </view>
       <view class='button_tb sure' bindtap='sureListener'>
        确定
      </view>
   </view>
</view>

css

.passworddialog {
  width: 650rpx;
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 1001;
  background: #fafafa;
  margin: -150px 50rpx 0 50rpx;
  border-radius: 3px;
  display: flex;
  display: -webkit-flex;
  flex-direction: column;
}

.drawer_title {
  padding: 5px;
  font: 20px "microsoft yahei";
  text-align: center;
  display: flex;
  display: -webkit-flex;
  align-items: center;
  flex-direction: row;
  justify-content: center;
}

.drawer_content {
  margin-top: 10px;
  height: 80px;
  overflow-y: scroll;
  display: flex;
  display: -webkit-flex;
  flex-direction: column;
  align-items: center;
}

.top{
    padding-top:8px;
}

.grid { display: -webkit-flex; display: flex; }

.title {
    height: 30px;
    line-height: 30px;
    width: 160rpx;
    text-align: center;
    display: inline-block;
    font: 300 28rpx/30px "microsoft yahei";
}

.input_base {
    border: 2rpx solid #ccc;
    padding-left: 10rpx;
    margin-right: 50rpx;
}
.input_h30{
    height: 30px;
    line-height: 30px;
}

.col-1 {flex: 1}

.button_sure_calcle{
  display: flex;
  display: -webkit-flex;
  flex-direction: row;
}

.button_tb{
  height: 40px;
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 16px;
  justify-content: center;
  color: white;
}

.cancle{
  background: rgba(128, 128, 128, 0.473);
}

.sure{
  background: #22b1b1;
}

js:

inputNumberListener:function(event){//金额输入监听
    this.data.number = e.detail.value;
  },
  cancleListener: function () { //取消
    this.data.number = "";
    this.setData({
      isHiddenDialog: true,
    });
  },
  sureListener: function () {
    this.setData({
      isHiddenDialog: true,
    });
   
  }
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 每天的学习记录,可能有的地方写的不对,因为刚学,以后发现错的话会回来改掉整体流程 https://develope...
    有点健忘阅读 10,263评论 0 7
  • create by jsliang on 2018-9-17 17:58:56 Recently revised...
    梁_飘阅读 5,498评论 0 6
  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 14,281评论 4 61
  • 位置相关 1. 视空间位置 o.pos =mul(UNITY_MATRIX_MVP, v.vertex); 2.物...
    Saber_87d4阅读 2,726评论 0 0
  • 【平兄稳定币系列 1】为何需要稳定币? 稳定币想必大家并不陌生,接近地最多的或许是泰达币 USDT 了。但可能大部...
    平兄_3cd7阅读 1,202评论 0 0