|
注册验证......搞不定了!
最后两步,
1、查询手机号码是否注册过
2、查询昵称是否被占用
var user = this.comp('userData').find(['nickname'],[nickname]);
if (user.length<=0) {
var rows = this.comp('userData').find(['username'],[username]);
if (rows.length<=0) {
alert(status);空白
alert(rows);也是空白
- define(function(require){
- var $ = require("jquery");
- var justep = require("$UI/system/lib/justep");
-
- var Model = function(){
- this.callParent();
- };
- Model.prototype.registerClick = function(event){
- var username = this.comp('username').val();
- var password = this.comp('password').val();
- var qrpassword = this.comp('qrpassword').val();
- var xingbie = this.comp('xingbie').val();
- var nickname = this.comp('nickname').val();
- var userData = this.comp('userData');
- var reg = /^0?1[3|4|5|7|8][0-9]\d{8}$/;
- var mima = /^\d{3}$/;
- if(username == "" || password == "" || qrpassword == ""){
- justep.Util.hint("用户名密码不能为空!");
- return;
- };
-
- if(password != qrpassword ){
- justep.Util.hint("密码不一致!");
- return;
- };
-
- if(xingbie = ""){
- justep.Util.hint("请选择您的性别!");
- return;
- };
- var user = this.comp('userData').find(['nickname'],[nickname]);
- if (user.length<=0) {
- var rows = this.comp('userData').find(['username'],[username]);
- if (rows.length<=0) {
- this.comp('userData').newData({
- defaultValues:[{
- "id" : justep.UUID.createUUID(),
- "zcshijain" : new Date(),
- "logshijian" : new Date(),
- "denglu" : "登陆"
- }]
- });
- alert(status);
- alert(rows);
- this.comp('userData').saveData();
- justep.Util.hint("成功!");
- } else {
- justep.Util.hint("号码注册过!");
- }
- } else {
- justep.Util.hint("昵称存在!");
- }
-
- };
- return Model;
- });
复制代码
|
|