heyang 3 년 전
부모
커밋
339a901f5a
1개의 변경된 파일77개의 추가작업 그리고 99개의 파일을 삭제
  1. 77 99
      microserviceUserH5/vcloud/register.html

+ 77 - 99
microserviceUserH5/vcloud/register.html

@@ -10,18 +10,23 @@
 	<link rel="stylesheet" href="../static/css/normalize.css">
 	<link rel="stylesheet" href="../static/css/experience.css">
 	<link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
+	<link rel="stylesheet" href="../static/css/verify.css">
 	<script src="../static/js/vender/jquery-3.4.1.min.js"></script>
 	<script src="../static/js/vender/bootstrap/js/bootstrap.min.js"></script>
 	<script src="../static/js/vender/toastr/toastr.min.js"></script>
 	<script src="../static/js/vender/config.js"></script>
 	<script src="../static/js/vender/crypto-js.js"></script>
 	<script src="../static/js/vender/base64.js"></script>
+	<script src="../static/js/vender/verify.js"></script>
+	<script src="../static/js/vender/ase.js"></script>
 	<script>
 		toastr.options.positionClass = 'toast-center-center';
 	</script>
 </head>
 
 <body>
+	<div id="mpanel2"></div>
+    <div id="form-btn"></div>
 	<div class="top free-code-con" style="position:relative;">
 		<div>
 			<img src="../static/img/register/bg.png" alt="" class="bottom-img">
@@ -58,6 +63,10 @@
 		var parameters = GetRequest();
 		var phone = parameters["phone"];
 		var timer, flag = true;
+		var html = document.documentElement;
+		var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
+		var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
+		var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
         // var baseUrl = 'http://14.18.190.141:24380'
 		$("#recv_ipt").val(phone ? phone : '');
 		$("#recv_ipt").bind('input propertychange', function (e) {
@@ -79,40 +88,68 @@
 			}
 		});
 
-		$('#mpanel2').eq(0).text('');
-		$('#mpanel2').slideVerify({
-			baseUrl: baseUrl + '/api/activity',  //服务器请求地址, 默认地址为安吉服务器;
-			mode: 'pop',     //展示模式
-			containerId: 'recv_btn', //pop模式 必填 被点击之后出现行为验证码的元素id
-			imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
-				width: imgWidth,
-				height: imgHeight
-			},
-			barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
-				width: imgWidth,
-				height: barHeight
-			},
-			beforeCheck: function () {
-				var tel = $("#recv_ipt").val()
-				if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(tel)) {
-					stopManyClick(() => {
-						toastr.error('请填写正确的手机号')
-					})
-					return false
-				} else {
+		function validate() {
+			$('#mpanel2').slideVerify({
+				baseUrl: baseUrl + '/api/activity',  //服务器请求地址, 默认地址为安吉服务器;
+				mode: 'pop',     //展示模式
+				containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
+				imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
+					width: imgWidth,
+					height: imgHeight
+				},
+				barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
+					width: imgWidth,
+					height: barHeight
+				},
+				beforeCheck: () => {
 					return true
+				},
+				ready:  () => { 
+				},  //加载完毕的回调
+				success: (params) => { //成功的回调
+					setTimeout(() => {
+						submit(params.captchaVerification);
+					},1000)
+				},
+				error: function () {}
+			});
+		}
+
+		function submit(captchaVerification){
+			var data = {}
+			data.userName = parameters['username'] ? parameters['username'] : null
+			data.type = parameters['type'] ? parameters['type'] : null
+			data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
+			data.newPhone = $('#recv_ipt').val();
+			data.captchaVerification = captchaVerification;
+			$.ajax({
+				url: baseUrl + '/api/activity/v1/promote',
+				data: JSON.stringify(data),
+				type: 'post',
+				contentType: "application/json",
+				dataType: 'json',
+				cache: false,
+				success: function (res) {
+					if (res.status === 0) {
+						toastr.error('领取成功')
+						$(window).attr('location', res.data);
+					} else if (res.status === 1) {
+						toastr.error(res.msg)
+						setTimeout(function() {
+							$(window).attr('location', 'http://www.androidscloud.com/');
+						}, 1000)
+					} else if(res.status === 11){
+						$('#mpanel2').eq(0).text('');
+						validate(); // 生成验证码
+						setTimeout(() => {
+							document.getElementById('form-btn').click();
+						},500)
+					} else {
+						toastr.error(res.msg)
+					}
 				}
-			},
-			ready: function () { },  //加载完毕的回调
-			success: function (params) { //成功的回调
-				// params为返回的二次验证参数 需要在接下来的实现逻辑回传服务器
-				// 例如: login($.extend({}, params))
-				handleClick(params.captchaVerification)
-			},
-			error: function () {
-				console.log('error');
-			}        //失败的回调
-		});
+			})
+		}
 
 		function getUserInfo() {
 			var userName = parameters['username'] ? parameters['username'] : null
@@ -143,9 +180,9 @@
 				keyType: 2,
 				security: encrypts
 			}
-			let urls = baseUrl == 'http://14.18.190.141:24380'?'http://14.18.190.141:24380':'https://wjzx.androidscloud.com:9091';
+			let urls = baseUrl == 'http://14.18.190.141:24380'?'http://110.53.221.195:8210':'https://wjzx.androidscloud.com:9091';
 			$.ajax({
-				url: `${urls}/file-center/fileOperate/getImage?id=`+fileId,
+				url: `${urls}/document/newFile/download/0/3dn9b4585511476691c6?fileKey=`+fileId,
 				type: 'get',
 				headers: data,
 				xhrFields: { responseType: "blob" },
@@ -213,78 +250,19 @@
 							setTimeout(function() {
 								$(window).attr('location', 'http://www.androidscloud.com/');
 							}, 1000)
+						} else if(res.status === '0011'){
+							$('#mpanel2').eq(0).text('');
+							validate(); // 生成验证码
+							setTimeout(() => {
+								document.getElementById('form-btn').click();
+							},500)
 						} else {
 							toastr.error(res.msg)
 						}
 					}
 				})
-				var Sys = {};
-				var ua = navigator.userAgent.toLowerCase();
-				var s, browserType;
-				(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
-					(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
-						(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
-							(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
-								(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
-				if (Sys.ie) {
-					browserType = 'IE: ' + Sys.ie
-				}
-				if (Sys.firefox) {
-					browserType = 'Firefox: ' + Sys.firefox
-				}
-				if (Sys.chrome) {
-					browserType = 'Chrome: ' + Sys.chrome
-				}
-				if (Sys.opera) {
-					browserType = 'Opera: ' + Sys.opera
-				}
-				if (Sys.safari) {
-					browserType = 'Safari: ' + Sys.safari
-				}
-				var form = {
-					platform: 4,
-					visitType: 4,
-					time: time,
-					phoneNum: ipt_phone,
-					downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
-					browserType: browserType
-				}
-				var list = []
-				list.push(form)
-				// 推广页面下载埋点接口
-				$.ajax({
-					url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
-					data: JSON.stringify(list),
-					type: 'post',
-					contentType: "application/json",
-					dataType: 'json',
-					cache: false,
-					success: function (res) {
-					}
-				})
 			}
 		}
-
-		/*
-		function handleDownload() {
-				$.ajax({
-						url: baseUrl + '/api/user/promote/webUrl',
-						type: 'get',
-						cache: false,
-						dataType: 'text',
-						success: function (data) {
-								var uri;
-								if (data.startsWith('http')) {
-										uri = data
-								} else {
-										uri = 'http://' + data
-								}
-								$(window).attr('location',uri);
-						}
-				})
- 
-		}
-		 */
 		function visit() {
 			$.ajax({
 				url: baseUrl + '/api/user/v3/invitation/client/addInviteData',