@@ -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()
diff --git a/Application/Mobile/Controller/BaseController.class.php b/Application/Mobile/Controller/BaseController.class.php
index 0b58f5446..9663c309f 100644
--- a/Application/Mobile/Controller/BaseController.class.php
+++ b/Application/Mobile/Controller/BaseController.class.php
@@ -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);
}
diff --git a/Application/Mobile/Controller/CommonController.class.php b/Application/Mobile/Controller/CommonController.class.php
index ed92a328e..b67a7c7db 100644
--- a/Application/Mobile/Controller/CommonController.class.php
+++ b/Application/Mobile/Controller/CommonController.class.php
@@ -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('发送失败');
}
}