• 小程序中自定义代用输入框的模态框弹窗


    <HTML部分-->
    <button type="default" bindtap='showModal2'>弹出带文本框的modal</button>
    <modal hidden="{{hiddenModal2}}" title="请完善您的个人信息" confirm-text="提交" cancel-text="取消" bindconfirm="model2confirm"
      bindcancel="model2cancel">
      <view class="loginBox">
        <view style='70%;margin-left:15%;'>
          <view
            style='border-top-left-radius:8px;border-top-right-radius:8px;100%;height:38px;display:inline-block;background:#fff;'>
            <view style='20%;display:inline-block;height:100%;'>
              <image src='../../images/xueyuan.svg' style='display:inline;' mode="aspectFit" style='60rpx;display:inline-block;height:100%;'></image>
            </view>
            <input style='80%;display:inline-block;height:100%;' bindinput='input1' placeholder-style='font-size:12px;'
              placeholder='学 院:'></input>
          </view>
          <view
            style='100%;height:38px;display:inline-block;background:#fff;margin-top:-5px;border-top:1px solid #f8f8f8;border-bottom-left-radius:8px;border-bottom-right-radius:8px;'>
            <view style='20%;display:inline-block;height:100%;'>
              <image src='../../images/code.svg' style='display:inline' mode="aspectFit" style='50rpx;display:inline-block;height:100%;'></image>
            </view>
            <input style='80%;display:inline-block;height:100%;' bindinput='input2' placeholder-style='font-size:12px;'
              placeholder='工 号:'></input>
          </view>
        </view>
      </view>
    </modal>
    js部分:
    Page({
      data: {
       hiddenModal2:true,
       input1:'',
       input2:''
      },
      input1:function(e){
       this.setData({input1:e.detail.value})
      },
      input2:function(e){
        this.setData({input2:e.detail.value})
       },
      showModal2: function (e) {
       this.setData({ hiddenModal2: false })
      },
      model2confirm: function (e) {
       this.setData({ hiddenModal2: true })
       console.log(this.data.input1,this.data.input2)
      //  wx.showToast({
      //   title: '确定',
      //   icon:'none'
      //  })
      },
      model2cancel: function (e) {
       this.setData({ hiddenModal2: true })
      }
     })
     
    

      

  • 相关阅读:
    drf 之 JWT认证 什么是集群以及分布式 什么是正向代理,什么是反向代理
    drf 之自定制过滤器 分页器(三种)如何使用(重点) 全局异常 封装Response对象 自动生成接口文档
    课堂练习之“寻找最长单词链”
    《人月神话》读书笔记(三)
    用户体验
    第十四周进度报告
    课堂练习之“寻找水王”
    《人月神话》读书笔记(二)
    第二阶段冲刺(十)
    第二阶段冲刺(九)
  • 原文地址:https://www.cnblogs.com/gzw-23/p/14829804.html
Copyright © 2020-2023  润新知