signup.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. $(function(){
  2. /* $.validator.setDefaults({
  3. submitHandler: function() {
  4. alert("提交事件!");
  5. }
  6. }); */
  7. $(".signup-form").validate({
  8. submitHandler:(form) => {
  9. var success=$(".head_success").val();
  10. var warning=$(".head_warning").val();
  11. var success1=$(".signin_success").val();
  12. var warning1=$(".signin_warning").val()
  13. if($(".agreeme")[0].checked) {
  14. zeroModal.success({
  15. unique:'1',
  16. opacity:0.8,
  17. content:success,
  18. contentDetail:success1,
  19. width:'300px',
  20. height:'260px',
  21. ok:false,
  22. onClosed:function(){
  23. ;//location.href='../signin/signin.html'
  24. },
  25. onComplete:function(evn){
  26. login()
  27. console.log('onComplete')
  28. setTimeout(function(){
  29. location.href='../lanhu/index.html'
  30. zeroModal.close('1');
  31. },3000);
  32. }
  33. })
  34. }else{
  35. zeroModal.alert({
  36. unique:'1',
  37. opacity:0.8,
  38. content:warning,
  39. contentDetail:warning1,
  40. width:'300px',
  41. height:'260px',
  42. ok:false,
  43. onClosed:function(){
  44. ;//location.href='../signin/signin.html'
  45. },
  46. onComplete:function(evn){
  47. console.log('onComplete')
  48. setTimeout(function(){
  49. zeroModal.close('1');
  50. },3000);
  51. }
  52. })
  53. }
  54. }
  55. });
  56. function login(){
  57. window.localStorage.setItem("loginUser",$("#email").val())
  58. console.log($("#email").val())
  59. }
  60. $(".form-control").on("input",function(evn){
  61. //console.log('input');
  62. let $icon=$(this).siblings('.input-tool-icon');
  63. if($(this).val().length>0){
  64. $icon.show();
  65. }
  66. else{
  67. $icon.hide();
  68. }
  69. });
  70. $(".form-group-custom").on("click",".glyphicon-remove",function(evn){
  71. $(this).siblings('.form-control').val('');
  72. $(this).hide();
  73. });
  74. $(".form-group-custom").on("click",".glyphicon-eye-open",function(evn){
  75. $(this).siblings('.form-control').prop('type','text');
  76. $(this).removeClass('glyphicon-eye-open');
  77. $(this).addClass('glyphicon-eye-close');
  78. });
  79. $(".form-group-custom").on("click",".glyphicon-eye-close",function(evn){
  80. $(this).siblings('.form-control').prop('type','password');
  81. $(this).removeClass('glyphicon-eye-close');
  82. $(this).addClass('glyphicon-eye-open');
  83. });
  84. $(".tip-txt-link").on("click",function(){
  85. let forward=$(this).data('forward');
  86. if(forward){
  87. location.href=forward;
  88. }
  89. });
  90. $(".create-btn2").on("click",function(evn){
  91. let md=zeroModal.success({
  92. unique:'1',
  93. opacity:0.8,
  94. content:'success',
  95. contentDetail:'You have successfully registered',
  96. width:'300px',
  97. height:'260px',
  98. ok:false,
  99. onClosed:function(){
  100. ;//location.href='../signin/signin.html'
  101. },
  102. onComplete:function(evn){
  103. console.log('onComplete')
  104. setTimeout(function(){
  105. zeroModal.close('1');
  106. },3000);
  107. }
  108. })
  109. });
  110. });