1 line
9.2 KiB
JavaScript
1 line
9.2 KiB
JavaScript
|
|
define(function(){
var GW_JS = function(){};
GW_JS.prototype.SendAjax = function(url,callback){
$.ajax({
type : 'GET',
cache : true,
url : url,
dataType : "jsonp",
jsonp:'jsonpCallback',
async:false,
success:callback
})
};
var GW = new GW_JS();
GW.config = function(obj){
var defaultConfig = {
GameId : "",
GameName :"",
Slide:{
SlideId : "",
SlideBox : ""
},
Login:{
LoginBox:"",
LoginUser:"",
LoginPass:"",
LoginSubmit:""
},
SwitchTab:{
TabNav:"",
TabContent:"",
TabCurrent:"",
TabActive:"",
TabEvent:"",
TabFind:"",
TabMore:""
},
Server:{
ServerTemplate:"",
ServerBox:"",
ServerL:0
}
};
GW.extend = obj?$.extend(defaultConfig,obj):defaultConfig;
};
GW.slide = function(){
var D = GW.extend.Slide;
var id = D.SlideId;
var obj = D.SlideBox;
if(id && obj){
/*GW.SendAjax('//' + location.host + '/index.php?m=poster&c=index&a=show_poster&type=JSON&id=' + id, function(result){
var list = result.Data;
var str="<div class='hd'><ul>";
for (var i in list){
str += "<li>"+(++i)+"</li>";
}
str += "</ul></div><div class='bd'><ul>";
for (var i in list){
str += "<li><a href='"+list[i].url+"' target='_blank'><img src='"+list[i].src+"' /></a></li>";
}
str += "</ul></div>";
$(obj).html(str);
$(obj).slide({mainCell:".bd ul",effect:"fade",autoPlay:true});
});*/
var str = '';
str += '<div class="hd">';
str += ' <ul>';
str += ' <li class="on">1</li>';
str += ' <li>2</li>';
str += ' <li>3</li>';
str += ' <li>4</li>';
str += ' <li>5</li>';
str += ' </ul>';
str += '</div>';
str += '<div class="bd">';
str += ' <ul>';
str += ' <li><a href="javascript:void(0);"><img src="static/home/img/slide_1.jpg"></a></li>';
str += ' <li><a href="javascript:void(0);"><img src="static/home/img/slide_2.jpg"></a></li>';
str += ' <li><a href="javascript:void(0);"><img src="static/home/img/slide_3.jpg"></a></li>';
str += ' <li><a href="javascript:void(0);"><img src="static/home/img/slide_4.jpg"></a></li>';
str += ' <li><a href="javascript:void(0);"><img src="static/home/img/slide_5.jpg"></a></li>';
str += ' </ul>';
str += '</div>';
$(obj).html(str);
$(obj).slide({mainCell:".bd ul",effect:"fade",autoPlay:true});
}
};
/*GW.login = function(){
var D = GW.extend.Login;
var LoginBox = D.LoginBox||"";
var LoginSubmit = D.LoginSubmit||"";
function loginSubmit(UserName,PassWord){
GW.SendAjax('//' + location.host + '/index.php?m=member&c=email&a=checkUsername&service=login&cn=' + UserName + '&pwd=' + PassWord, function(data){
if (data.result == 'err0001') {
alert('用户名或密码错误');
return false;
}
if (data.result == 'pwderror') {
alert('密码错误');
return false;
}
if (data.result == 'success') {
GW.loginSuccess(data);
GW.loginSuccessTOP(data)
}
})
};
function regLogin
|