浏览代码

Merge branch 'master' of http://192.168.32.253:3000/Software/android-cloud-H5

huangxiaojing 3 年之前
父节点
当前提交
621e8b5ff3

二进制
microserviceUserH5/static/img/invite/header-img.png


+ 2 - 0
microserviceUserH5/static/js/vender/config.js

@@ -2,6 +2,8 @@ var url = window.location.href;
 url = url.split('/');
 var baseUrl = url[0] + '//' + url[2];
 // var baseUrl = 'http://14.215.128.96'
+// var baseUrl = 'http://vclusters.imwork.net:2221'
+
 
 function GetRequest() {
   var url = location.search; // 获取url中"?"符后的字串

+ 2 - 2
microserviceUserH5/vcloud/beeMansLogin.html

@@ -72,7 +72,7 @@
     } else {
       
       $.ajax({
-        url: 'http://vclusters.imwork.net:2219/api/user/v1/client/getPbKey',
+        url: 'http://vclusters.imwork.net:2221/api/user/v1/client/getPbKey',
         type: 'post',
         contentType: "application/json",
         dataType: 'json',
@@ -93,7 +93,7 @@
     }
     $('.master').show()
     $.ajax({
-      url: 'http://vclusters.imwork.net:2219/api/user/v1/beeMans/fmCloudLogin',
+      url: 'http://vclusters.imwork.net:2221/api/user/v1/beeMans/fmCloudLogin',
       data: JSON.stringify(form),
       type: 'post',
       contentType: "application/json",

+ 49 - 31
microserviceUserH5/vcloud/invite.html

@@ -74,9 +74,10 @@
 	<input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="inviteCopy" value="">
 	<script>
 		toastr.options.positionClass = 'toast-center-center';
-		toastr.options.timeOut = '3000';
+		toastr.options.timeOut = '1500';
 	</script>
 	<script type="text/javascript">
+		let timer,flag = true;
 		var url = window.location.href;
 		url = url.split('/')
 		//   var baseUrl = url[0] + '//' + url[2]
@@ -85,6 +86,7 @@
 		var n2 = loc.indexOf("=");//取得=号的位置
 		// var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
 		var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
+		
 
 		var u = navigator.userAgent;
 		var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
@@ -102,17 +104,18 @@
 				$('#invitationCode').text(res.data.invitationCode)
 				//加载数据
 				$('#passwordCopy').val($('#invitationCode').text());
-
 				//复制按钮
 				$('.btn-code-copy').on('click', function () {
-					var input = document.getElementById("passwordCopy");
-					// 选中文本
-					input.select();
-					// 执行浏览器复制命令
-					document.execCommand("copy");
-					toastr.error('复制成功', 0)
+					stopManyClick(() =>{
+						var input = document.getElementById("passwordCopy");
+						// 选中文本
+						input.select();
+						// 执行浏览器复制命令
+						// document.activeElement.blur();
+						document.execCommand("copy");
+						toastr.error('复制成功', 0)
+					})
 				});
-
 				if (res.data.friendList.length > 0) {
 					var str = ''
 					for (var i = 0; i < res.data.friendList.length; i++) {
@@ -138,18 +141,21 @@
 		})
 
 		$("#recv_ipt").bind('input propertychange', function (e) {
-			var ipt_phones = $('#recv_ipt').val();
-			var c = $(this);
-			if (/[^\d]/.test(c.val())) {//替换非数字字符
-				var temp_amount = c.val().replace(/[^\d]/g, '');
-				$(this).val(temp_amount);
-				toastr.error('请输入正确的手机号')
-			}
-			if (ipt_phones.length >= 12) {
-				toastr.error('请输入正确的手机号')
-				var recvstr = ipt_phones.substring(0, 11)
-				$("#recv_ipt").val(recvstr);
-			}
+			stopManyClick(() =>{
+				var ipt_phones = $('#recv_ipt').val();
+			    var c = $(this);
+				if (/[^\d]/.test(c.val())) {//替换非数字字符 v1/promote
+					var temp_amount = c.val().replace(/[^\d]/g, '');
+					$(this).val(temp_amount);
+					toastr.error('请输入正确的手机号')
+				}
+				if (ipt_phones.length >= 12) {
+					toastr.error('请输入正确的手机号')
+					var recvstr = ipt_phones.substring(0, 11)
+					$("#recv_ipt").val(recvstr);
+				}
+			})
+			
 		});
 		function handleShow() {
 			$('.dialog').animate({top: '2.4rem'},"fast");
@@ -207,16 +213,19 @@
 					dataType: 'json',
 					cache: false,
 					success: function (res) {
-						//加载数据
-						var copyBefore = JSON.stringify(res.data.url);
-						var copyUrl = copyBefore.split('"');
-						$('#inviteCopy').val(copyUrl[1]);
-						var input = document.getElementById("inviteCopy");
-						// 选中文本
-						input.select();
-						// 执行浏览器复制命令
-						document.execCommand("copy");
-						toastr.error('复制成功')
+						stopManyClick(() =>{
+							//加载数据
+							var copyBefore = JSON.stringify(res.data.url);
+							var copyUrl = copyBefore.split('"');
+							console.log(copyUrl[1])
+							$('#inviteCopy').val(copyUrl[1]);
+							var input = document.getElementById("inviteCopy");
+							// 选中文本
+							input.select();
+							// 执行浏览器复制命令
+							document.execCommand("copy");
+							toastr.error('复制成功')
+						})
 					}
 				})
 			}
@@ -297,6 +306,15 @@
 			})
 		}
 		getInvitationRecently()
+		//防止提示一秒内重复显示
+		function stopManyClick(fn) {
+			if (flag) {
+				fn();
+			}
+			flag = false;
+			if(timer){clearTimeout(timer);}
+			timer = setTimeout(() => {flag = true}, 1500);
+		}
 	</script>
 </body>
 

+ 34 - 12
microserviceUserH5/vcloud/register.html

@@ -57,6 +57,7 @@
 	<script type="text/javascript" th:inline="javascript">
 		var parameters = GetRequest();
 		var phone = parameters["phone"];
+		var timer, flag = true;
 		$("#recv_ipt").val(phone ? phone : '');
 
 
@@ -66,12 +67,16 @@
 			if (/[^\d]/.test(c.val())) {//替换非数字字符
 				var temp_amount = c.val().replace(/[^\d]/g, '');
 				$(this).val(temp_amount);
-				toastr.error('请填写正确的手机号')
+				stopManyClick(() =>{
+					toastr.error('请填写正确的手机号')
+				})
 			}
 			if (ipt_phones.length >= 12) {
-				toastr.error('请填写正确的手机号')
 				var recvstr = ipt_phones.substring(0, 11)
 				$("#recv_ipt").val(recvstr);
+				stopManyClick(() =>{
+					toastr.error('请填写正确的手机号')
+				})
 			}
 		});
 
@@ -94,11 +99,12 @@
 		}
 
 		function getHead(fileId) {
+			$('.head img').attr('src', '../static/img/invite/header-img.png');
 			var timestamp = new Date().getTime()
-      var encrypts = encrypt(
-        'RuiChiSecurityGo' + timestamp,
-        'RuiChiSecurityGo'
-      )
+			var encrypts = encrypt(
+				'RuiChiSecurityGo' + timestamp,
+				'RuiChiSecurityGo'
+			)
 			var data = {
 				keyType: 2,
 				security: encrypts
@@ -112,9 +118,9 @@
 				success: function (res) {
 					var xhr = new XMLHttpRequest();
 					var imageType = xhr.getResponseHeader("Content-Type");
-        	var blob = new Blob([res], { type: imageType });
+        	        var blob = new Blob([res], { type: imageType });
 					var imageUrl = (window.URL || window.webkitURL).createObjectURL(blob);
-        	$('.head img').attr('src', imageUrl);
+        	        $('.head img').attr('src', imageUrl);
 				}
 			})
 		}
@@ -128,15 +134,18 @@
   	}
 
 		getUserInfo();
-
 		function handleClick() {
+			stopManyClick(result);
+		}
+		function result() {
 			var time = new Date().getTime()
 			var data = {}
 			data.userName = parameters['username'] ? parameters['username'] : null
 			data.type = parameters['type'] ? parameters['type'] : null
 			data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
 			toastr.options = {
-				positionClass: "toast-center-center"
+				positionClass: "toast-center-center",
+		        timeOut: 1500
 			};
 			var ipt_phone = $('#recv_ipt').val();
 			var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
@@ -144,9 +153,13 @@
 			var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
 			downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
 			if (!ipt_phone) {
-				toastr.error('请填写正确的手机号')
+				stopManyClick(() =>{
+				    toastr.error('请填写正确的手机号')
+			    })
 			} else if (!res) {
-				toastr.error('请填写正确的手机号')
+				stopManyClick(() =>{
+				    toastr.error('请填写正确的手机号')
+			    })
 			} else {
 				data.newPhone = ipt_phone
 				$.ajax({
@@ -249,6 +262,15 @@
 		}
 
 		visit()
+		//防止提示一秒内重复显示
+		function stopManyClick(fn) {
+			if (flag) {
+				fn();
+			}
+			flag = false;
+			if(timer){clearTimeout(timer);}
+			timer = setTimeout(() => {flag = true}, 1500);
+		}
 	</script>
 </body>
 <style>