Forráskód Böngészése

增加登录,登出页面脚本

chenwen 3 éve
szülő
commit
81bea7b0d7
2 módosított fájl, 162 hozzáadás és 0 törlés
  1. 62 0
      assets/js/signin.js
  2. 100 0
      assets/js/signup.js

+ 62 - 0
assets/js/signin.js

@@ -0,0 +1,62 @@
+$(function(){
+	$(".signin-form").validate({
+			
+			 submitHandler:(form) => {
+				zeroModal.success({
+					unique:'1',
+					opacity:0.8,
+					content:'success',
+					contentDetail:'Signin success',
+					width:'300px',
+					height:'260px',
+					ok:false,
+					onClosed:function(){
+						;//location.href='../signin/signin.html'
+					},
+					onComplete:function(evn){
+						console.log('onComplete')
+						setTimeout(function(){
+							zeroModal.close('1');
+						},3000);
+					}
+					
+				})  
+			 }
+	});
+	
+	$(".form-control").on("input",function(evn){
+		//console.log('input');
+		let $icon=$(this).siblings('.input-tool-icon');
+		if($(this).val().length>0){
+			$icon.show();
+		}
+		else{
+			$icon.hide();
+		}
+		
+	});
+	
+	$(".form-group-custom").on("click",".glyphicon-remove",function(evn){
+		$(this).siblings('.form-control').val('');
+		$(this).hide();
+	});
+	
+	$(".form-group-custom").on("click",".glyphicon-eye-open",function(evn){
+		$(this).siblings('.form-control').prop('type','text');
+		$(this).removeClass('glyphicon-eye-open');
+		$(this).addClass('glyphicon-eye-close');
+	});
+	
+	$(".form-group-custom").on("click",".glyphicon-eye-close",function(evn){
+		$(this).siblings('.form-control').prop('type','password');
+		$(this).removeClass('glyphicon-eye-close');
+		$(this).addClass('glyphicon-eye-open');
+	});
+	
+	$(".tip-txt-link").on("click",function(){
+		let forward=$(this).data('forward');
+		if(forward){
+			location.href=forward;
+		}
+	});
+});

+ 100 - 0
assets/js/signup.js

@@ -0,0 +1,100 @@
+$(function(){
+	
+	/* $.validator.setDefaults({
+		submitHandler: function() {
+		  alert("提交事件!");
+		}
+	}); */
+	
+	 $(".signup-form").validate({
+		 /* errorPlacement:(error, element)=>{
+			 console.log(error);
+			 alert(error.text());
+		 }, */
+		
+		 submitHandler:(form) => {
+			$(".agree-chkbox").prop('checked',true);
+			zeroModal.success({
+				unique:'1',
+				opacity:0.8,
+				content:'success',
+				contentDetail:'You have successfully registered',
+				width:'300px',
+				height:'260px',
+				ok:false,
+				onClosed:function(){
+					location.href='../signin/signin.html'
+				},
+				onComplete:function(evn){
+					console.log('onComplete')
+					setTimeout(function(){
+						zeroModal.close('1');
+					},3000);
+				}
+				
+			})  
+		 }
+	 });
+	
+	$(".form-control").on("input",function(evn){
+		//console.log('input');
+		let $icon=$(this).siblings('.input-tool-icon');
+		if($(this).val().length>0){
+			$icon.show();
+		}
+		else{
+			$icon.hide();
+		}
+		
+	});
+	
+	$(".form-group-custom").on("click",".glyphicon-remove",function(evn){
+		$(this).siblings('.form-control').val('');
+		$(this).hide();
+	});
+	
+	$(".form-group-custom").on("click",".glyphicon-eye-open",function(evn){
+		$(this).siblings('.form-control').prop('type','text');
+		$(this).removeClass('glyphicon-eye-open');
+		$(this).addClass('glyphicon-eye-close');
+	});
+	
+	$(".form-group-custom").on("click",".glyphicon-eye-close",function(evn){
+		$(this).siblings('.form-control').prop('type','password');
+		$(this).removeClass('glyphicon-eye-close');
+		$(this).addClass('glyphicon-eye-open');
+	});
+	
+	$(".tip-txt-link").on("click",function(){
+		let forward=$(this).data('forward');
+		if(forward){
+			location.href=forward;
+		}
+	});
+	
+	$(".create-btn2").on("click",function(evn){
+		let md=zeroModal.success({
+			unique:'1',
+			opacity:0.8,
+			content:'success',
+			contentDetail:'You have successfully registered',
+			width:'300px',
+			height:'260px',
+			ok:false,
+			onClosed:function(){
+				;//location.href='../signin/signin.html'
+			},
+			onComplete:function(evn){
+				console.log('onComplete')
+				setTimeout(function(){
+					zeroModal.close('1');
+				},3000);
+			}
+			
+		})
+	});
+	
+	
+});
+
+