工会web
This commit is contained in:
146
GonghuiWeb/www/m/js/one/gh.js
Normal file
146
GonghuiWeb/www/m/js/one/gh.js
Normal file
@@ -0,0 +1,146 @@
|
||||
function dh(ty){
|
||||
if(!ty){
|
||||
ty = 'main';
|
||||
}
|
||||
$(".tab .xfl").removeClass('tab_dhs');
|
||||
$("#tab_"+ty).addClass('tab_dhs');
|
||||
loadnr(ty);
|
||||
}
|
||||
function loadnr(ty,idd,sort){
|
||||
var w_width =$(window).width();
|
||||
var w_height =$(window).height();
|
||||
var left_height = w_height-25;
|
||||
var right_width = w_width-120;
|
||||
layer.open({type:2,shade:false});
|
||||
if(ty == 'mgold'){
|
||||
var murl = "/gh/mgold.php";
|
||||
}else{
|
||||
var murl = "/gh/index.php";
|
||||
}
|
||||
$.get(murl, {
|
||||
ty : ty,
|
||||
md5 : md5,
|
||||
idd : idd,
|
||||
sort : sort,
|
||||
gameid : gid
|
||||
}, function(data, status) {
|
||||
$("#content").html(data);
|
||||
$(".pf-left").height(left_height);
|
||||
$(".gdinfo").width(right_width);
|
||||
});
|
||||
}
|
||||
loadnr('main');
|
||||
|
||||
function remind_error(tit,widths){
|
||||
if(!widths){
|
||||
widths=180;
|
||||
}
|
||||
layer.closeAll();
|
||||
layer.open({content: tit,style: 'width:'+widths+'px;',btn: '我知道了'});
|
||||
}
|
||||
//创建公会
|
||||
function union_add(){
|
||||
var obj = {
|
||||
gameid : gid,
|
||||
ty : 'add',
|
||||
uname : $("input[name='uname']").val(),
|
||||
ucard : $("input[name='ucard']").val()
|
||||
};
|
||||
if(!obj.uname){
|
||||
remind_error('请填写完整!');
|
||||
return false;
|
||||
}
|
||||
$.get("/gh/cl.php",obj, function(data, status) {
|
||||
layer.closeAll();
|
||||
if(data == 'ok'){
|
||||
loadnr('main');
|
||||
var html = '<div class="xfl xfs-14 tab_dh" id="tab_my" onclick="dh(\'my\');">我的数据</a></div>';
|
||||
html += '<div class="xfl xfs-14 tab_dh" id="tab_data" onclick="dh(\'data\');">开房数据</a></div>';
|
||||
html += '<div class="xfl xfs-14 tab_dh" id="tab_adm" onclick="dh(\'adm\');">公会管理</a></div>';
|
||||
html += '<div class="xfl xfs-14 tab_dh" id="tab_js" onclick="dh(\'js\');">公会介绍</a></div>';
|
||||
html += '<input type="hidden" id="un-ren" value="1">';
|
||||
$("#union_menu").html(html);
|
||||
}else{
|
||||
remind_error(data,'220');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//带提示操作
|
||||
function union_tit(ty,idd,titnr,ida){
|
||||
if(ty == 'out'){//退出公会
|
||||
var tit = "是否退出公会?";
|
||||
var obj = {
|
||||
gameid : gid,
|
||||
ty : ty,
|
||||
uid : idd,
|
||||
unid : ida
|
||||
};
|
||||
}else if(ty == 'fang'){//用户转公会房卡
|
||||
var fang = $("#fang").val();
|
||||
if(fang < 10){
|
||||
remind_error("转入房卡最少10张起",'220');
|
||||
return false;
|
||||
}
|
||||
tit = "转入"+fang+"张房卡<br>一旦转入不能转出";
|
||||
var obj = {ty:'zhuan',gameid:gid,fang:fang};
|
||||
}else{
|
||||
var obj = {ty:ty,gameid:gid};
|
||||
}
|
||||
if(titnr){
|
||||
var tit = titnr;
|
||||
}
|
||||
layer.open({content: tit,style: 'width:200px;',btn: ['确定', '取消'],yes: function(index){
|
||||
layer.open({type:2,shade:false});
|
||||
$.get('/gh/cl.php', obj, function(data, status) {
|
||||
layer.closeAll();
|
||||
if(data == 'ok'){
|
||||
if(ty == 'out' && titnr){//退出公会
|
||||
loadnr('main',ida);
|
||||
}else{
|
||||
loadnr('adm');
|
||||
}
|
||||
}else{
|
||||
remind_error(data,'220');
|
||||
}
|
||||
});
|
||||
}});
|
||||
}
|
||||
//不带提示操作
|
||||
function union_edit(ty){
|
||||
if(ty == 'join'){//添加公会
|
||||
var gids = $("#gids").val();
|
||||
var unionid = $("#unionid").val();
|
||||
var opens = $('input:radio[name=open]:checked').val();
|
||||
if(!gids){
|
||||
remind_error("请输入游戏ID","220");
|
||||
return false;
|
||||
}
|
||||
var obj = {ty:'join',gameid:gid,gid:gids,opens:opens};
|
||||
}else{//公会信息修改
|
||||
var names = $("#cname").val();
|
||||
if(!names){
|
||||
remind_error("公会名称必须输入","220");
|
||||
return false;
|
||||
}
|
||||
var nr = $("#cgg").val();
|
||||
var obj = {ty:'edit',gameid:gid,names:names};
|
||||
}
|
||||
|
||||
layer.open({type:2,shade:false});
|
||||
$.get('/gh/cl.php', obj, function(data, status) {
|
||||
layer.closeAll();
|
||||
if(data == 'ok'){
|
||||
layer.open({content: "操作成功!",style: 'width:220px;',btn: '我知道了',yes: function(index){
|
||||
if(ty == 'join'){
|
||||
dh('main');
|
||||
loadnr('main',unionid);
|
||||
}else{
|
||||
loadnr('adm');
|
||||
}
|
||||
}});
|
||||
}else{
|
||||
remind_error(data,'220');
|
||||
}
|
||||
});
|
||||
}
|
||||
166
GonghuiWeb/www/m/js/one/gong.js
Normal file
166
GonghuiWeb/www/m/js/one/gong.js
Normal file
@@ -0,0 +1,166 @@
|
||||
function dh(ty){
|
||||
if(!ty){
|
||||
ty = 'main';
|
||||
}
|
||||
$(".tab .xfl").removeClass('tab_dhs');
|
||||
$("#tab_"+ty).addClass('tab_dhs');
|
||||
loadnr(ty);
|
||||
}
|
||||
function loadnr(ty,idd,sort){
|
||||
var w_width =$(window).width();
|
||||
var w_height =$(window).height();
|
||||
var left_height = w_height-25;
|
||||
var right_width = w_width-120;
|
||||
layer.open({type:2,shade:false});
|
||||
if(ty == 'mgold'){
|
||||
var murl = "/gong/mgold.php";
|
||||
}else{
|
||||
var murl = "/gong/index.php";
|
||||
}
|
||||
$.get(murl, {
|
||||
ty : ty,
|
||||
md5 : md5,
|
||||
idd : idd,
|
||||
sort : sort,
|
||||
gameid : gid
|
||||
}, function(data, status) {
|
||||
$("#content").html(data);
|
||||
$(".pf-left").height(left_height);
|
||||
$(".gdinfo").width(right_width);
|
||||
});
|
||||
}
|
||||
loadnr('main');
|
||||
|
||||
function remind_error(tit,widths){
|
||||
if(!widths){
|
||||
widths=180;
|
||||
}
|
||||
layer.closeAll();
|
||||
layer.open({content: tit,style: 'width:'+widths+'px;',btn: '我知道了'});
|
||||
}
|
||||
//创建公会
|
||||
function union_add(){
|
||||
var obj = {
|
||||
gameid : gid,
|
||||
ty : 'add',
|
||||
uname : $("input[name='uname']").val(),
|
||||
ucard : $("input[name='ucard']").val()
|
||||
};
|
||||
if(!obj.uname){
|
||||
remind_error('请填写完整!');
|
||||
return false;
|
||||
}
|
||||
$.get("/gong/cl.php",obj, function(data, status) {
|
||||
layer.closeAll();
|
||||
if(data == 'ok'){
|
||||
loadnr('main');
|
||||
var html = '<div class="xfl xfs-14 tab_dh" id="tab_my" onclick="dh(\'my\');">我的数据</a></div>';
|
||||
html += '<div class="xfl xfs-14 tab_dh" id="tab_data" onclick="dh(\'data\');">开房数据</a></div>';
|
||||
html += '<div class="xfl xfs-14 tab_dh" id="tab_adm" onclick="dh(\'adm\');">公会管理</a></div>';
|
||||
html += '<div class="xfl xfs-14 tab_dh" id="tab_js" onclick="dh(\'js\');">公会介绍</a></div>';
|
||||
html += '<input type="hidden" id="un-ren" value="1">';
|
||||
$("#union_menu").html(html);
|
||||
}else{
|
||||
remind_error(data,'220');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//带提示操作
|
||||
function union_tit(ty,idd,titnr,ida){
|
||||
if(ty == 'out'){//退出公会
|
||||
var tit = "是否退出公会?";
|
||||
var obj = {
|
||||
gameid : gid,
|
||||
ty : ty,
|
||||
uid : idd,
|
||||
unid : ida
|
||||
};
|
||||
}else if(ty == 'fang'){//用户转公会房卡
|
||||
var fang = $("#fang").val();
|
||||
if(fang < 10){
|
||||
remind_error("转入房卡最少10张起",'220');
|
||||
return false;
|
||||
}
|
||||
tit = "转入"+fang+"张房卡<br>一旦转入不能转出";
|
||||
var obj = {ty:'zhuan',gameid:gid,fang:fang};
|
||||
}else{
|
||||
var obj = {ty:ty,gameid:gid};
|
||||
}
|
||||
if(titnr){
|
||||
var tit = titnr;
|
||||
}
|
||||
layer.open({content: tit,style: 'width:200px;',btn: ['确定', '取消'],yes: function(index){
|
||||
layer.open({type:2,shade:false});
|
||||
$.get('/gong/cl.php', obj, function(data, status) {
|
||||
layer.closeAll();
|
||||
if(data == 'ok'){
|
||||
if(ty == 'out' && titnr){//退出公会
|
||||
loadnr('main',ida);
|
||||
}else{
|
||||
loadnr('adm');
|
||||
}
|
||||
}else{
|
||||
remind_error(data,'220');
|
||||
}
|
||||
});
|
||||
}});
|
||||
}
|
||||
//不带提示操作
|
||||
function union_edit(ty){
|
||||
if(ty == 'join'){//添加公会
|
||||
var gids = $("#gids").val();
|
||||
var unionid = $("#unionid").val();
|
||||
var opens = $('input:radio[name=open]:checked').val();
|
||||
if(!gids){
|
||||
remind_error("请输入游戏ID","220");
|
||||
return false;
|
||||
}
|
||||
var obj = {ty:'join',gameid:gid,gid:gids,opens:opens};
|
||||
}else{//公会信息修改
|
||||
var names = $("#cname").val();
|
||||
if(!names){
|
||||
remind_error("公会名称必须输入","220");
|
||||
return false;
|
||||
}
|
||||
var nr = $("#cgg").val();
|
||||
var obj = {ty:'edit',gameid:gid,names:names};
|
||||
}
|
||||
|
||||
layer.open({type:2,shade:false});
|
||||
$.get('/gong/cl.php', obj, function(data, status) {
|
||||
layer.closeAll();
|
||||
if(data == 'ok'){
|
||||
layer.open({content: "操作成功!",style: 'width:220px;',btn: '我知道了',yes: function(index){
|
||||
if(ty == 'join'){
|
||||
dh('main');
|
||||
loadnr('main',unionid);
|
||||
}else{
|
||||
loadnr('adm');
|
||||
}
|
||||
}});
|
||||
}else{
|
||||
remind_error(data,'220');
|
||||
}
|
||||
});
|
||||
}
|
||||
//删除日期数据
|
||||
function del_date(idd){
|
||||
layer.open({content: '是否删除数据?',style: 'width:200px;',btn: ['删除', '取消'],yes: function(index){
|
||||
layer.open({type:2,shade:false});
|
||||
$.get('/gong/cl.php', {
|
||||
gameid : gid,
|
||||
ty : 'del_date',
|
||||
idd : idd
|
||||
}, function(data, status) {
|
||||
layer.closeAll();
|
||||
if(data == 'ok'){
|
||||
loadnr('data','month');
|
||||
}else{
|
||||
remind_error(data,'220');
|
||||
}
|
||||
});
|
||||
}});
|
||||
}
|
||||
|
||||
|
||||
78
GonghuiWeb/www/m/js/one/lottery.js
Normal file
78
GonghuiWeb/www/m/js/one/lottery.js
Normal file
@@ -0,0 +1,78 @@
|
||||
var lottery_zt=0;
|
||||
var $lottery = $("#lottery");
|
||||
var lottery_indexs=-1;//当前转动到哪个位置,起点位置
|
||||
var lottery_count=$lottery.find(".lottery-unit").length;//总共有多少个位置
|
||||
var lottery_timer=0; //setTimeout的ID,用clearTimeout清除
|
||||
var lottery_speed=20; //初始转动速度
|
||||
var lottery_times=0; //转动次数
|
||||
var lottery_cycle=50; //转动基本次数:即至少需要转动多少次再进入抽奖环节
|
||||
var lottery_prize=-1; //中奖位置
|
||||
|
||||
function rolls(){
|
||||
$lottery.find(".lottery-unit-"+lottery_indexs).removeClass("active");
|
||||
lottery_indexs += 1;
|
||||
if (lottery_indexs>lottery_count-1) {
|
||||
lottery_indexs = 0;
|
||||
};
|
||||
$lottery.find(".lottery-unit-"+lottery_indexs).addClass("active");
|
||||
return false;
|
||||
}
|
||||
function roll(){
|
||||
lottery_times += 1;
|
||||
rolls();
|
||||
if (lottery_times > lottery_cycle+10 && lottery_prize==lottery_indexs) {
|
||||
clearTimeout(lottery_timer);
|
||||
lottery_prize=-1;
|
||||
lottery_times=0;
|
||||
lottery_zt=0;
|
||||
$("#djcj_txt").text("点击抽奖");
|
||||
//$("#lottery_ck").attr("onclick","acj()");
|
||||
var d = new Date(),str = '';
|
||||
str = d.getMonth() + 1+'-'+d.getDate()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();
|
||||
$("#lottery_log").prepend("<li>"+nickname+"<br>抽到 "+lottery_prize_yuanbao+"个元宝<br><font color='red'>今天</font> "+str+"</li>");
|
||||
var ybs = $("#yuanbao").text();
|
||||
$("#yuanbao").text(parseInt(ybs)+parseInt(lottery_prize_yuanbao));
|
||||
}else{
|
||||
if (lottery_times<lottery_cycle) {
|
||||
lottery_speed -= 10;
|
||||
}else if(lottery_times==lottery_cycle) {
|
||||
//var index = Math.random()*(lottery_count)|0;
|
||||
lottery_prize = lottery_prize_index;
|
||||
}else{
|
||||
if (lottery_times > lottery_cycle+10 && ((lottery_prize==0 && lottery_prize_index==7) || lottery_prize==lottery_prize_index+1)) {
|
||||
lottery_speed += 110;
|
||||
}else{
|
||||
lottery_speed += 20;
|
||||
}
|
||||
}
|
||||
if (lottery_speed<40) {
|
||||
lottery_speed=40;
|
||||
};
|
||||
lottery_timer = setTimeout(roll,lottery_speed);
|
||||
}
|
||||
}
|
||||
function acj(){
|
||||
if(!lottery_zt){
|
||||
layer.open({type:2,shade:false});
|
||||
$("#djcj_txt").html("<font color='#999'>抽奖中...</font>");
|
||||
$.getJSON("/dh/lottery.php?gameid="+gid,function(ret){
|
||||
//alert(JSON.stringify(ret));
|
||||
layer.closeAll();
|
||||
//$("#lottery_ck").removeAttr("onclick");
|
||||
if(ret.prize){
|
||||
$("#lottery_game").html(ret.game+"/32");
|
||||
lottery_speed=100;
|
||||
lottery_prize_index = ret.prize;
|
||||
lottery_prize_yuanbao = ret.yuanbao;
|
||||
roll();
|
||||
zt++;
|
||||
}else{
|
||||
if(ret.error == 'no'){
|
||||
$("#djcj_txt").html("请先玩游戏");
|
||||
}else{
|
||||
$("#djcj_txt").html("请稍后再试");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
25
GonghuiWeb/www/m/js/one/mj.js
Normal file
25
GonghuiWeb/www/m/js/one/mj.js
Normal file
@@ -0,0 +1,25 @@
|
||||
function dh(ty){
|
||||
if(!ty){
|
||||
ty = 'main';
|
||||
}
|
||||
$(".tab .xfl").removeClass('tab_dhs');
|
||||
$("#tab_"+ty).addClass('tab_dhs');
|
||||
loadnr(ty);
|
||||
}
|
||||
function loadnr(ty){
|
||||
var w_width =$(window).width();
|
||||
var w_height =$(window).height();
|
||||
var left_height = w_height-25;
|
||||
var right_width = w_width-120;
|
||||
layer.open({type:2,shade:false});
|
||||
$.get('/dh/index.php', {
|
||||
ty : ty,
|
||||
md5 : md5,
|
||||
gameid : gid
|
||||
}, function(data, status) {
|
||||
$("#content").html(data);
|
||||
$(".pf-left").height(left_height);
|
||||
$(".gdinfo").width(right_width);
|
||||
});
|
||||
}
|
||||
loadnr('cj');
|
||||
Reference in New Issue
Block a user