xuguohong

update sdk

......@@ -30,5 +30,5 @@
2017-07-07<br>
1、sdk更新和添加文件损坏处理
2017=07-24<br>
2017-07-24<br>
1、添加聊天统计,修改安装标识码
\ No newline at end of file
......
......@@ -539,17 +539,17 @@ function initMatching(){
if (result.code == -10) {
// 未登录,跳转的登录界面
} else if (result.code == 0) {
if (func && typeof func == "function") {
context ? func.call(context, result) : func(result);
}
if (typeof(result.msg) == '$object' && result.msg.msg)
result.msg = result.msg.msg;
}
if ($obj[0].tagName == "FORM") {
$obj[0].disabled = false;
$obj.find("input, button").attr('disabled', null);
$obj.find("input[type='text'],input[type='password'],input[name='password'], button").attr('disabled', null);
var $but_input = $obj.find('[type=submit]');
if ($but_input.is('button')) {
$but_input.html(temp);
......
......@@ -384,18 +384,28 @@
that.$c.on('click', '[type=submit],.submit', function(e) {
var passWordReg = /^[0-9a-zA-Z]+$/;
e.preventDefault();
if(/[A-Z]/.test(that.$c.find("input[name='username']").val())){
Core.showTips("账号不能有大写字母!");
}else if(/[A-Z]/.test(that.$c.find("input[name='password']").val())){
Core.showTips("密码不能有大写字母!");
}else if(that.$c.find("input[name='password']").val().length<6 || that.$c.find("input[name='password']").val().length>16){
Core.showTips("密码长度为6-16位字符!");
}else if(!that.$c.find('.checkbox-2').length>0){
Core.showTips('请同意'+Core.PLATFORM_NAME+'网络协议',1);
}else if(!passWordReg.test(that.$c.find("input[name='password']").val())){
Core.showTips('请输入数字字母组成的密码!', true);
return false;
}else{
//如果是游客的话则调用安卓截屏方法
if (that.$c.find('[name="username"]').val() == that.$c.find('[name="old_usernmae"]').val() && window.android != undefined && window.android.screenShot != undefined ){
window.android.screenShot();
}
}
$(this).attr("disabled",true);
$(this).css({"background":"#999"});
$(this).parent("li").css({"background":"#999"});
Core.ajax_do(that.$c.find('.ajax'), that.register_cb, that);
}
return false;
......@@ -418,21 +428,30 @@
that.$c.find('[name="old_usernmae"]').val(random_name)
that.$c.find('[name="password"]').val(random_passwd)
that.$c.find('[name="type"]').val(-1)
that.$c.find("input#btn-regist").attr('disabled', null);
that.$c.find('.submit').css({"background":"#00beef"});
that.$c.find('.submit').parent("li").css({"background":"#00beef"});
}
Register.prototype.cache = Login.prototype.cache;
Register.prototype.register_cb = function(result) {
Core.updateData(result.msg);
Core.first_user = this.$c.find('[name="username"]').val()
Core.first_password = this.$c.find('[name="password"]').val()
Core.first_user = this.$c.find('[name="username"]').val();
Core.first_password = this.$c.find('[name="password"]').val();
// 显示一个注册成功信息,并跳转到home
this.cache();
Core.showTips('成功注册,欢迎使用' + Core.PLATFORM_NAME + '手游平台');
Core.updateMod('home');
this.$c.find("input#btn-regist").attr('disabled', null);
this.$c.find('.submit').css({"background":"#00beef"});
this.$c.find('.submit').parent("li").css({"background":"#00beef"});
}
Register.prototype.show_after = function() {
this.set_random();
}
Core.registerMod('register', Register);
......@@ -587,9 +606,14 @@
that.$c.on("click","#js_confirm_resetnewpsw",function(){
var NewPsw = that.$c.find("#js_reset_newpsw").val(),
NewKey = that.$c.find("input[name='pwd_code']").val(),
passWordReg = /^[0-9a-zA-Z]+$/,
account = $("input[name='loginUserName']").val();
var names = localStorage.getItem('user_names');
names = JSON.parse(names);
if(!passWordReg.test(NewPsw)){
Core.showTips('请输入数字字母组成的密码!', true);
return false;
}
Core.ajax({
type:"post",
url:"/user/reset_passwd?pwd_code="+NewKey+"&password="+NewPsw,
......
......@@ -159,7 +159,7 @@
<input type="hidden" name="type" value="-1">
<ul class="inline-btn">
<li><a class="btn btn_pri_block btn-orange" href="#home">返回</a></li>
<li><a class="submit btn larg " >确定注册</a></li>
<li><input type="button" class="submit btn larg" id="btn-regist" value="确定注册"></li>
</ul>
</form>
</div>
......@@ -654,7 +654,7 @@
<i>{{? Core.Data.is_guest == 1}}正式账号:{{??}}旧密码:{{?}}</i>
<label>
<input {{? Core.Data.is_guest == 1}}type="text"{{??}}type="password"{{?}} class="old_pwd required " name="{{? Core.Data.is_guest >= 1}}username{{??}}password{{?}}" value="{{? Core.Data.new_pwd}}{{=Core.Data.new_pwd}}{{?}}" required="required" placeholder="{{? Core.Data.is_guest == 1}}请输入6-18位字母或数字{{??}}请输入旧密码{{?}}" required/>
<input {{? Core.Data.is_guest == 1}}type="text"{{??}}type="password"{{?}} class="old_pwd required " name="{{? Core.Data.is_guest >= 1}}username{{??}}password{{?}}" value="{{? Core.Data.new_pwd}}{{=Core.Data.new_pwd}}{{?}}" required="required" placeholder="{{? Core.Data.is_guest == 1}}请输入3-18位字母或数字{{??}}请输入旧密码{{?}}" required/>
</label>
</div>
<div class="input new-sdk-psw clearfix">
......
......@@ -539,17 +539,17 @@ function initMatching(){
if (result.code == -10) {
// 未登录,跳转的登录界面
} else if (result.code == 0) {
if (func && typeof func == "function") {
context ? func.call(context, result) : func(result);
}
if (typeof(result.msg) == '$object' && result.msg.msg)
result.msg = result.msg.msg;
}
if ($obj[0].tagName == "FORM") {
$obj[0].disabled = false;
$obj.find("input, button").attr('disabled', null);
$obj.find("input[type='text'],input[type='password'],input[name='password'], button").attr('disabled', null);
var $but_input = $obj.find('[type=submit]');
if ($but_input.is('button')) {
$but_input.html(temp);
......
......@@ -384,18 +384,28 @@
that.$c.on('click', '[type=submit],.submit', function(e) {
var passWordReg = /^[0-9a-zA-Z]+$/;
e.preventDefault();
if(/[A-Z]/.test(that.$c.find("input[name='username']").val())){
Core.showTips("账号不能有大写字母!");
}else if(/[A-Z]/.test(that.$c.find("input[name='password']").val())){
Core.showTips("密码不能有大写字母!");
}else if(that.$c.find("input[name='password']").val().length<6 || that.$c.find("input[name='password']").val().length>16){
Core.showTips("密码长度为6-16位字符!");
}else if(!that.$c.find('.checkbox-2').length>0){
Core.showTips('请同意'+Core.PLATFORM_NAME+'网络协议',1);
}else if(!passWordReg.test(that.$c.find("input[name='password']").val())){
Core.showTips('请输入数字字母组成的密码!', true);
return false;
}else{
//如果是游客的话则调用安卓截屏方法
if (that.$c.find('[name="username"]').val() == that.$c.find('[name="old_usernmae"]').val() && window.android != undefined && window.android.screenShot != undefined ){
window.android.screenShot();
}
}
$(this).attr("disabled",true);
$(this).css({"background":"#999"});
$(this).parent("li").css({"background":"#999"});
Core.ajax_do(that.$c.find('.ajax'), that.register_cb, that);
}
return false;
......@@ -418,21 +428,30 @@
that.$c.find('[name="old_usernmae"]').val(random_name)
that.$c.find('[name="password"]').val(random_passwd)
that.$c.find('[name="type"]').val(-1)
that.$c.find("input#btn-regist").attr('disabled', null);
that.$c.find('.submit').css({"background":"#00beef"});
that.$c.find('.submit').parent("li").css({"background":"#00beef"});
}
Register.prototype.cache = Login.prototype.cache;
Register.prototype.register_cb = function(result) {
Core.updateData(result.msg);
Core.first_user = this.$c.find('[name="username"]').val()
Core.first_password = this.$c.find('[name="password"]').val()
Core.first_user = this.$c.find('[name="username"]').val();
Core.first_password = this.$c.find('[name="password"]').val();
// 显示一个注册成功信息,并跳转到home
this.cache();
Core.showTips('成功注册,欢迎使用' + Core.PLATFORM_NAME + '手游平台');
Core.updateMod('home');
this.$c.find("input#btn-regist").attr('disabled', null);
this.$c.find('.submit').css({"background":"#00beef"});
this.$c.find('.submit').parent("li").css({"background":"#00beef"});
}
Register.prototype.show_after = function() {
this.set_random();
}
Core.registerMod('register', Register);
......@@ -587,9 +606,14 @@
that.$c.on("click","#js_confirm_resetnewpsw",function(){
var NewPsw = that.$c.find("#js_reset_newpsw").val(),
NewKey = that.$c.find("input[name='pwd_code']").val(),
passWordReg = /^[0-9a-zA-Z]+$/,
account = $("input[name='loginUserName']").val();
var names = localStorage.getItem('user_names');
names = JSON.parse(names);
if(!passWordReg.test(NewPsw)){
Core.showTips('请输入数字字母组成的密码!', true);
return false;
}
Core.ajax({
type:"post",
url:"/user/reset_passwd?pwd_code="+NewKey+"&password="+NewPsw,
......
......@@ -159,7 +159,7 @@
<input type="hidden" name="type" value="-1">
<ul class="inline-btn">
<li><a class="btn btn_pri_block btn-orange" href="#home">返回</a></li>
<li><a class="submit btn larg " >确定注册</a></li>
<li><input type="button" class="submit btn larg" id="btn-regist" value="确定注册"></li>
</ul>
</form>
</div>
......@@ -654,7 +654,7 @@
<i>{{? Core.Data.is_guest == 1}}正式账号:{{??}}旧密码:{{?}}</i>
<label>
<input {{? Core.Data.is_guest == 1}}type="text"{{??}}type="password"{{?}} class="old_pwd required " name="{{? Core.Data.is_guest >= 1}}username{{??}}password{{?}}" value="{{? Core.Data.new_pwd}}{{=Core.Data.new_pwd}}{{?}}" required="required" placeholder="{{? Core.Data.is_guest == 1}}请输入6-18位字母或数字{{??}}请输入旧密码{{?}}" required/>
<input {{? Core.Data.is_guest == 1}}type="text"{{??}}type="password"{{?}} class="old_pwd required " name="{{? Core.Data.is_guest >= 1}}username{{??}}password{{?}}" value="{{? Core.Data.new_pwd}}{{=Core.Data.new_pwd}}{{?}}" required="required" placeholder="{{? Core.Data.is_guest == 1}}请输入3-18位字母或数字{{??}}请输入旧密码{{?}}" required/>
</label>
</div>
<div class="input new-sdk-psw clearfix">
......