master
ELF 5 years ago
parent 6621467b58
commit 18e39c5fc7

@ -381,7 +381,7 @@
<img src="__IMG__/20191225/yanzhengma.png" alt="">
<input name="verify_code" type="text" placeholder="请输入验证码">
</div>
<img id="verifyCode" onclick="GetVerityCode()" src="/mobile.php?s=/Common/verify.html" alt="">
<img id="verifyCode" src="/mobile.php?s=/Common/verify.html" alt="">
</div>
<div class="register-btn">
<div id="loginBtn" class="loginBtn">登录</div>
@ -423,7 +423,7 @@
</div>
<div id="forgetGetPhoneCode" class="gain">获取验证码</div>
</div>
<div class="modification">修改密码</div>
<div id="modify-password" class="modification">修改密码</div>
<div class="register-forget">
<div>
<div>
@ -462,11 +462,11 @@
</div>
<div id="getPhoneCode" class="gain">获取验证码</div>
</div>
<div id="phonereg" class="modification">立即注册</div>
<div id="mobile-reg" class="modification">立即注册</div>
<div class="register-forget">
<div>
<div style="color:#292929;font-size: 0.22rem;">注册即表示同意</div>
<span><a href="{:U('News/protocol')}" style="color:#3CC2EF">《用户协议》</a></span>
<span><a href="/mobile.php?s=News/protocol.html" style="color:#3CC2EF">《用户协议》</a></span>
</div>
<div class="phoneCut">
<img src="__IMG__/20191225/qiehuan.png" alt="">
@ -496,11 +496,11 @@
<img src="__IMG__/20191225/mima.png" alt="">
<input name="repassword" type="password" placeholder="请再次确认输入密码">
</div>
<div class="modification">立即注册</div>
<div id="normal-reg" class="modification">立即注册</div>
<div class="register-forget">
<div>
<div style="color:#292929;font-size: 0.22rem;">注册即表示同意</div>
<span><a href="{:U('News/protocol')}" style="color:#3CC2EF">《用户协议》</a></span>
<span><a href="/mobile.php?s=News/protocol.html" style="color:#3CC2EF">《用户协议》</a></span>
</div>
<div class="commonCut">
<img src="__IMG__/20191225/qiehuan.png" alt="">
@ -567,42 +567,42 @@ var PhoneObj = {
},
//获取验证码
sendPhoneCode:function(phone, fun){
if(PhoneObj.codeflag){
if(PhoneObj.checkPhone(phone)){
//无需等待网络响应直接倒计时
fun()
//获取验证码
$.ajax({
type: 'GET',
url: 'mobile.php?s=/Common/sendPhoneCode.html&phone='+phone,
dataType: 'JSON',
success: function (result) {
if (result.status != '0000') {
alert(result.msg);
}
}
})
if(PhoneObj.codeflag){
if(PhoneObj.checkPhone(phone)){
//无需等待网络响应直接倒计时
fun()
//获取验证码
$.ajax({
type: 'GET',
url: 'mobile.php?s=/Common/sendPhoneCode.html&phone='+phone,
dataType: 'JSON',
success: function (result) {
if (result.status != '0000') {
alert(result.msg);
}
}
}else{
// alert("发送验证码频率过高,请等待"+PhoneObj.i+"秒后再试")
})
}
}else{
// alert("发送验证码频率过高,请等待"+PhoneObj.i+"秒后再试")
}
},
checkPassword(password){
if(password.length < 6 || password.length > 12){
alert('密码长度6-12个字符');
return false;
}
// var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])');
// if (!pwdRegex.test(password)) {
// alert("您的密码复杂度太低(密码中必须包含字母、数字)!");
// return false;
// }
var chinaRex = new RegExp("[\\u4E00-\\u9FFF]+","g");;
if (chinaRex.test(password)) {
alert("密码不允许含有中文字符!");
return false;
}
return true;
if(password.length < 6 || password.length > 12){
alert('密码长度6-12个字符');
return false;
}
// var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])');
// if (!pwdRegex.test(password)) {
// alert("您的密码复杂度太低(密码中必须包含字母、数字)!");
// return false;
// }
var chinaRex = new RegExp("[\\u4E00-\\u9FFF]+","g");;
if (chinaRex.test(password)) {
alert("密码不允许含有中文字符!");
return false;
}
return true;
}
}
@ -683,12 +683,18 @@ var PhoneObj = {
window.location.href = 'mqqwpa://im/chat?chat_type=wpa&uin={$serviceQQ}&version=1&src_type=web&web_src=oicqzone.com';
})
$('#verifyCode').on({
click: function () {
GetVerityCode()
}
})
function GetVerityCode() {
//刷新验证码
$("#verifyCode").attr("src", "/mobile.php?s=/Common/verify.html&id=" + Math.random());
}
$("#phonereg").on("click",function(){
$("#mobile-reg").on("click",function(){
var box = $('#phone-register-box')
var phone = box.find('[name=mobile]').val()
var password = box.find('[name=password]').val()
@ -774,7 +780,7 @@ var PhoneObj = {
})
//普通注册
$("#userreg").on("click", function(){
$("#normal-reg").on("click", function(){
var box = $('#register-box')
var account = box.find('[name=account]').val()
var password = box.find('[name=password]').val()
@ -822,7 +828,7 @@ var PhoneObj = {
})
//忘记密码
$("#forgetBtn").on("click",function(){
$("#modify-password").on("click",function(){
var box = $('#forget-box')
var phone = box.find('[name=mobile]').val()
var password = box.find('[name=password]').val()

@ -385,12 +385,12 @@ class BaseController extends Controller {
return M("bind_recharge","tab_")->add($data);
}
protected function respondSuccess($message, $code = '0000')
protected function respondSuccess($message = '成功', $code = '0000')
{
$this->respond($message, $code);
}
protected function respondError($message, $code = '1000')
protected function respondError($message = '失败', $code = '1000')
{
$this->respond($message, $code);
}

@ -26,15 +26,10 @@ class CommonController extends BaseController {
{
$account = I('account');
$password = I('password');
$code = I('code', '');
$verifyCode = I('verify_code', '');
if (!$code) {
$this->respondError('参数非法');
}
$promoteId = I('promote_id', 0);
$applyService = new ApplyService();
$result = $applyService->decodeApplyCode($code);
if (!$result) {
if (!$promoteId) {
$this->respondError('参数非法');
}
@ -42,7 +37,6 @@ class CommonController extends BaseController {
if (!$verify->check($verifyCode)) {
$this->respondError('验证码错误');
}
$promoteId = $result['promote_id'];
$promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
$userApi = new MemberApi();
@ -221,9 +215,9 @@ class CommonController extends BaseController {
$result = R('Common/Sms/send_sms_code', [$phone, 10, false]);
if ($result['code'] == 200) {
$this->setData($result['data'])->respondSuccess();
$this->setData($result['data'])->respondSuccess('发送成功');
} else {
$this->respondError();
$this->respondError('发送失败');
}
}

Loading…
Cancel
Save