<div class="layuimini-container">
    <div class="layuimini-main">

  
  

        <form class="layui-form" style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
            <div class="layui-form-item">
                <label class="layui-form-label">原密码</label>
                <div class="layui-input-block">
                    <input type="password" name="old_pwd" lay-verify="required" autocomplete="off" placeholder="请输入6位数以上密码" class="layui-input" value="<?=$row['title']?>">
                </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">新密码</label>
                <div class="layui-input-block">
                    <input  type="password" name="ddpwd" lay-verify="required" autocomplete="off" placeholder="请输入6位数以上新密码" class="layui-input" value="<?=$row['title']?>">
                </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码</label>
                <div class="layui-input-block">
                    <input  type="password" name="pwd_confirm" lay-verify="required" autocomplete="off" placeholder="请输入6位数以上确认密码" class="layui-input" value="<?=$row['title']?>">
                </div>
            </div>
   
            <div class="layui-form-item">
                <div class="layui-input-block">
            
                    <button class="layui-btn" lay-submit="" lay-filter="demo1" name="sub" value="1">立即提交</button>
                    <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
                </div>
            </div>
        </form>

        <!-- 示例-970 -->
        

        

        
        
        
    </div>
</div>

<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
			,  $ = layui.jquery;

        
       
        //监听提交
        form.on('submit(demo1)', function (data) {
          
			res=data.field;
			if (res.ddpwd!=res.pwd_confirm){
				layer.alert("新密码和确认密码必须相等");	
			    return false;
			}
			  layer.load(2);
              data.field.id="<?=$ddadmin['id']?>"
			 $.post("index.php?class=duoduo2020&act=pwd",data.field, function(data) {
				 layer.closeAll('loading');
				 if (data.code==0){
                     layer.msg("修改成功");
                 }else{
                    layer.msg(data.msg)
                 }

		      },"json");
			  
			  
			  return false;
          
        });

        
       

    });
</script>