fastreg.js
1.34 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
/**
*
*/
QRegister = {
clickImgCode : function( nspace ,imgCodeId) {
var dt = new Date();
var group = '';
if(nspace){
group = "&g="+nspace;
}
var imgcode = 'imgcode';
if(imgCodeId){
imgcode = imgCodeId;
}
var src = "/passport/images?t=" + dt.getTime() + group;
$('#'+imgcode).attr('src', src);
return false;
},
showBox: function()
{
$.get('/passport/reg/fastreg', {"return_type":"json","coupon_id":couponId,"redirect":redirect}, function(html){
if(html != '')
{
$('#loginBox').html(html);
}
});
},
register:function()
{
var username = $('#email').val();
$.post('/passport/reg/auth',$('#fastregForm').serialize(),function(data){
if(data.code == 200){
var rd = $('#redirect').val();
if(typeof rd == 'undefined' || rd == '')
{
$('#loginBox').html('<div class="loginbox2"><p><span>'+username+'</span></p></div> ');
}else{
location.href = rd;
}
return true;
}
alert(data.message);
return false;
}, 'json');
},
loginBox : function()
{
$.get('/passport/reg/loginmenu',{}, function(html){
if(html != '')
{
document.write(html);
}
});
}
};
QRegister.showBox();