index.html 4.3 KB

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