login.js
2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/**
* founder : zzf
* Creation time : 2015/2/25
* note :
* role :
*/
define(function( require, exports, module ) {
var Alert = require('alert');
var Validate = require('validate');
var Tools = require('tools');
var HTTP = require('http');
//登录
$(".login-btn").click(function(){
new Validate({view : "#login", alerts : Alert}, function(){
Alert.show("验证成功");
});
//console.log(HTTP);
HTTP.send({
url : "../js/javascript/login/ceshi.json",
type : "GET",
success : function(data){
console.log(data);
}
});
return false;
});
//个人用户注册
var registerCat = 0;
$(".m-tab li").click(function(){
registerCat = $(this).index();
$(".m-tab .on").removeClass("on");
$(this).addClass("on");
$(".m-form").hide();
$(".m-form").eq(registerCat).show();
});
var validate = null;
$(".reg-next-1").click(function(){
var isSucceed = false;
if(! registerCat){
validate = new Validate({view : "#user-reg", alerts : Alert}, function(){
Alert.show("验证成功");
isSucceed = true;
});
}else{
validate = new Validate({view : "#firm-reg", alerts : Alert}, function(){
Alert.show("验证成功");
isSucceed = true;
});
};
if(! isSucceed){
return false;
}
});
$(".firm-reg-code").click(function(){
new Tools.securitycode(this);
return false;
});
$(".firm-reg-reg").click(function(){
new Tools.securitycode(this);
return false;
});
//用户信息
$(".reg-name-btn").click(function(){
new Validate({view : "#reg-name", alerts : Alert}, function(){
Alert.show("验证成功");
});
return false;
});
//找回密码-用户名
$(".found-btn-1").click(function(){
var isSucceed = false;
new Validate({view : "#found-view", alerts : Alert}, function(){
Alert.show("验证成功");
isSucceed = true;
});
if(! isSucceed){
return false;
}
});
//找回密码-用户验证
$(".found-btn-2").click(function(){
var isSucceed = false;
new Validate({view : "#found-view-1", alerts : Alert}, function(){
Alert.show("验证成功");
isSucceed = true;
});
if(! isSucceed){
return false;
}
});
$(".found-pas-code").click(function(){
new Tools.securitycode(this);
return false;
});
//找回密码-重置密码
$(".found-btn-3").click(function(){
new Validate({view : "#found-view-2", alerts : Alert}, function(){
Alert.show("验证成功");
});
return false;
});
});