浏览代码

Merge branch 'bug-5.2' of Software/android-cloud-H5 into test

hutao 3 年之前
父节点
当前提交
469672c91a
共有 2 个文件被更改,包括 28 次插入12 次删除
  1. 6 0
      microserviceUserH5/static/css/yunActivity.css
  2. 22 12
      microserviceUserH5/vcloud/yunActivity.html

+ 6 - 0
microserviceUserH5/static/css/yunActivity.css

@@ -93,6 +93,7 @@ img {
 }
 
 .ipt-row{
+  position: relative;
   width: 6.2rem;
   height: 0.68rem;
   border: 0.02rem solid #E6E6E6;
@@ -154,6 +155,11 @@ img {
 }
 
 .get-code{
+  position: absolute;
+  right: 0.2rem;
+  width: 1.53rem;
+  height: 0.28rem;
+  line-height: 0.28rem;
   font-size: 0.3rem;
   color: #333333;
 }

+ 22 - 12
microserviceUserH5/vcloud/yunActivity.html

@@ -88,7 +88,7 @@
 	</div>
 	<script>
 		toastr.options.positionClass = 'toast-center-center';
-		toastr.options.timeOut = '1500';
+		toastr.options.timeOut = '3000';
 	</script>
 	<script type="text/javascript">
 		var baseUrl = 'http://14.18.190.141:1280'
@@ -139,20 +139,17 @@
 				success: function (res) {
 					if(res.status == 0){
 						myCode = res.data;
-						// $('.copy-dialog').animate({top: '1.8rem'},"fast");
-						// $('.copy-dialog').show()
-						// // $('.copy-mask').show();
-						// $('.close').show()
-						// document.documentElement.style.overflow='hidden';
 						if (isIOS) {
 						operate(`周年庆h5落地页打开${isIOS}`);
 						}else if(isAndroid) {
 						operate(`周年庆h5落地页打开${isAndroid}`);	
 						}
 						download();
-						toastr.error(`复制成功`);
+						toastr.error(`领取成功`);
 					}else{
-						toastr.error(res.msg);
+						stopManyClick(() =>{
+							toastr.error(res.msg)
+						})
 					}
 				}
 			})
@@ -171,8 +168,13 @@
 			getCode();
 		},false);
 		// 获取验证码接口
+		let flag1 = false  // 标志验证码防止重复点击
 		function getCode() {
 			let phone = $('.phone-ipt').eq(0).val();
+			if (flag1) {
+				return
+			}
+			flag1 = true
 			phone = phone.replace(/\s+/g,"");
 			$.ajax({
 				url: baseUrl + '/api/message/v5/phone/send',
@@ -186,7 +188,10 @@
 				cache:false,
 				success: function (res) {
 					if(res.status == 0) {
-						toastr.error(`验证码已发送`);
+						stopManyClick(() =>{
+							toastr.error(`验证码已发送`);
+						})	
+						flag1 = false
 						isStart = true;
 						$('.get-code').eq(0).text('60s');
 						$('.get-code')[0].className = 'get-code get-code-active';
@@ -236,9 +241,6 @@
 			if(!reg_tel.test(phone)){
 				$('.phone-tip').eq(0).css('display', 'block');
 			}
-			// if(phone == '') {
-			// 	$('.phone-tip').eq(0).css('display', 'none');	
-			// }
 			if(phone !== '') {
 				$(".btn-dowlond").attr({"style":"background: #E85A4B;"});
 			}else{
@@ -378,6 +380,14 @@
 				})
 			}
 		});
+		function stopManyClick(fn) {
+			if (flag) {
+				fn();
+			}
+			flag = false;
+			if (timer) { clearTimeout(timer); }
+			timer = setTimeout(() => { flag = true }, 1500);
+		}
 	</script>
 </body>