From d7b244e5d5806352a46eb05e63f4edb5bbb531fe Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 25 Dec 2019 17:27:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=90=BD=E5=9C=B0=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/View/default/Home/landingPage.html | 90 ++++++++++++++++++- 1 file changed, 88 insertions(+), 2 deletions(-) diff --git a/Application/Home/View/default/Home/landingPage.html b/Application/Home/View/default/Home/landingPage.html index f00a69ef3..cbed3df55 100644 --- a/Application/Home/View/default/Home/landingPage.html +++ b/Application/Home/View/default/Home/landingPage.html @@ -378,10 +378,10 @@
- +
- +
登录
@@ -764,6 +764,92 @@ var PhoneObj = { } }); }) + + //普通注册 + $("#userreg").on("click", function(){ + var box = $('#register-box') + var account = box.find('[name=account]').val() + var password = box.find('[name=password]').val() + var repassword = box.find('[name=repassword]').val() + var verifyCode = box.find('[name=verify_code]').val() + + var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])'); + if(account.length < 6 || account.length > 15){ + alert('账号长度必须是6-15位'); + return false; + } + if (!pwdRegex.test(account)) { + alert("账号必须是6-15位字母数字组合!"); + return false; + } + if(password.length < 6 || password.length > 12){ + alert('密码长度6-12个字符'); + return false; + } + if(password != repassword){ + alert('两次密码不一样'); + return false; + } + $.ajax({ + type: 'POST', + url: 'mobile.php?s=/Ssg/userRegister.html', + dataType: 'JSON', + data:{ + account: account, + password: regpassword, + promote_id: promoteId + }, + success: function (result) { + if (result.return_code == 'fail') { + alert(result.return_msg); + } else { + //成功 + $("#alert_box").show(); + setTimeout(hideAndLogin,2500) + // alert("注册并登陆成功"); + // window.location.href = "mobile.php?s=/Ssg/index.html" + } + } + }) + + }) + //忘记密码 + $("#forgetBtn").on("click",function(){ + var box = $('#forget-box') + var phone = box.find('[name=mobile]').val() + var password = box.find('[name=password]').val() + var verifyCode = box.find('[name=verify_code]').val() + if(!PhoneObj.checkPhone(phone)){ + return false; + } + if(!PhoneObj.checkPassword(password)){ + return false; + } + if(verifyCode == ''){ + alert('请输入验证码'); + return false; + } + $.ajax({ + type: 'POST', + url: '/mobile.php?s=/Common/forgetPassword.html', + dataType: 'JSON', + data:{ + account: phone, + password: password, + verify_code: verifyCode + }, + success: function (result) { + console.log(result) + if (result.return_code == 'fail') { + alert(result.return_msg); + } else { + $("#alert_content").html("密码修改成功,系统将在三秒后自动登录"); + $("#alert_box").show(); + setTimeout(hideAndLogin,2500) + } + } + }) + }) })