signup.js 2.7 KB

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