index.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {extend name="layout:home" /}
  2. {block name="container"}
  3. <style>
  4. .accountinfo_title{
  5. width: 150px;
  6. margin:50px auto;
  7. text-align: center;
  8. font-size: 13px;
  9. color: dodgerblue;
  10. }
  11. table{
  12. margin:0 auto;
  13. font-size: 13px;
  14. }
  15. /*.accountinfo_title table{*/
  16. /*margin-left: 150px;*/
  17. /*}*/
  18. table td{
  19. width: 100px;
  20. height: 60px;
  21. line-height: 60px;
  22. }
  23. .td_info{
  24. width: 80px;
  25. height: 60px;
  26. line-height: 60px;
  27. }
  28. .td_user_info{
  29. width: 220px;
  30. height: 60px;
  31. line-height: 60px;
  32. }
  33. table input{
  34. border: 1px #aaa solid;
  35. border-radius: 2px;
  36. height: 30px;
  37. width: 280px;
  38. line-height:30px ;
  39. }
  40. </style>
  41. <div class="layui-tab layui-tab-card">
  42. <div class="updatepwd">
  43. <form method="post">
  44. <div>
  45. <div class="accountinfo_title">重置密码</div>
  46. <table>
  47. <tr>
  48. <td class="td_info">当前密码</td>
  49. <td class="td_user_info"><input type="text" name="password" id="password" placeholder="当前密码"></td>
  50. </tr>
  51. <tr>
  52. <td class="td_info">重置密码</td>
  53. <td class="td_user_info"><input type="text" name="new_password" id="new_password" placeholder="重置密码"><div id="pwd" style="font-size: 10px;color:#aaa;margin-top: -30px;">密码必须包含有字母,数字,符号,密码长度为6-20个字符</div></td>
  54. </tr>
  55. <tr>
  56. <td class="td_info">确认密码</td>
  57. <td class="td_user_info"><input type="text" name="confirm_password" id="confirm_password" placeholder="确认密码"></td>
  58. </tr>
  59. <tr>
  60. <td class="td_info"></td>
  61. <td style="text-align: center;"><input type="submit" id="layui-btn" value="保存修改" style="width: 70px;"></td>
  62. </tr>
  63. </table>
  64. </div>
  65. </form>
  66. </div>
  67. </div>
  68. <script>
  69. //密码 校验
  70. $("#new_password").blur(function(){
  71. var password = document.getElementById("new_password").value;
  72. var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
  73. if (!patrn.exec(password)){
  74. document.getElementById("new_password").style.borderColor = "red";
  75. document.getElementById("layui-btn").type = "button";
  76. }else{
  77. document.getElementById("new_password").style.borderColor = "#e6e6e6";
  78. if(document.getElementById("confirm_password").style.borderColor != "red"){
  79. document.getElementById("layui-btn").type = "submit";
  80. }
  81. }
  82. });
  83. $("#confirm_password").blur(function(){
  84. var password = document.getElementById("confirm_password").value;
  85. var patrn=/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,20}$/;
  86. if (!patrn.exec(password)){
  87. document.getElementById("confirm_password").style.borderColor = "red";
  88. document.getElementById("layui-btn").type = "button";
  89. }else{
  90. document.getElementById("confirm_password").style.borderColor = "#e6e6e6";
  91. if(document.getElementById("new_password").style.borderColor != "red"){
  92. document.getElementById("layui-btn").type = "submit";
  93. }
  94. }
  95. });
  96. </script>
  97. <script type="text/javascript">
  98. layui.use('laydate', function(){
  99. var laydate = layui.laydate;
  100. //执行一个laydate实例
  101. laydate.render({
  102. elem: '#creatTime' //指定元素
  103. });
  104. laydate.render({
  105. elem:'#timeRang',
  106. range:true,
  107. format: 'yyyy/MM/dd',
  108. done: function(value, date){
  109. /* 时间选择完成后的回调 */
  110. }
  111. })
  112. });
  113. </script>
  114. {/block}