1402 lines
75 KiB
JavaScript
1402 lines
75 KiB
JavaScript
var game = 'all';
|
||
var is_cs = 2;
|
||
var table_list = '';
|
||
var username = '';
|
||
$(function(){
|
||
$('#baccarat').click(function(){
|
||
game = 'baccarat';
|
||
check_table();
|
||
$('#baccarat').addClass('yellow');
|
||
$('#dt').removeClass('yellow');
|
||
$('#nn').removeClass('yellow');
|
||
$('#tc').removeClass('yellow');
|
||
$('#all').removeClass('yellow');
|
||
});
|
||
$('#dt').click(function(){
|
||
game = 'dt';
|
||
$('#dt').addClass('yellow');
|
||
$('#baccarat').removeClass('yellow');
|
||
$('#nn').removeClass('yellow');
|
||
$('#tc').removeClass('yellow');
|
||
$('#all').removeClass('yellow');
|
||
check_table();
|
||
});
|
||
$('#nn').click(function(){
|
||
game = 'nn';
|
||
$('#nn').addClass('yellow');
|
||
$('#baccarat').removeClass('yellow');
|
||
$('#dt').removeClass('yellow');
|
||
$('#tc').removeClass('yellow');
|
||
$('#all').removeClass('yellow');
|
||
check_table();
|
||
});
|
||
$('#tc').click(function(){
|
||
game = 'tc';
|
||
$('#tc').addClass('yellow');
|
||
$('#baccarat').removeClass('yellow');
|
||
$('#dt').removeClass('yellow');
|
||
$('#nn').removeClass('yellow');
|
||
$('#all').removeClass('yellow');
|
||
check_table();
|
||
});
|
||
$('#all').click(function(){
|
||
game = 'all';
|
||
$('#all').addClass('yellow');
|
||
$('#baccarat').removeClass('yellow');
|
||
$('#dt').removeClass('yellow');
|
||
$('#nn').removeClass('yellow');
|
||
$('#tc').removeClass('yellow');
|
||
check_table();
|
||
});
|
||
$('#check_zc').click(function(){
|
||
var is_on = $('#check_zc').hasClass("on");
|
||
if(is_on){
|
||
$('#check_zc').removeClass("on");
|
||
is_cs = 2;
|
||
}else{
|
||
$('#check_zc').addClass("on");
|
||
is_cs = 1;
|
||
}
|
||
check_table();
|
||
})
|
||
$('#md_ensure').click(function(){
|
||
var table_arr = [];
|
||
$('input[name="table_list"]:checked').each(function(){
|
||
table_arr.push($(this).val());
|
||
});
|
||
table_list = table_arr.join(',');
|
||
check_table();
|
||
$('#modal-1').removeClass("md-show");
|
||
})
|
||
$('#select_number').click(function(){
|
||
username = $('#username').val();
|
||
check_table();
|
||
})
|
||
$('#login_out').click(function(){
|
||
//询问框
|
||
layer.confirm('是否退出登录?', {
|
||
btn: ['是的','取消'] //按钮
|
||
}, function(){
|
||
window.location.href="/login/logout";
|
||
}, function(){
|
||
|
||
});
|
||
|
||
})
|
||
|
||
var preUsers = new Array();
|
||
setInterval(function () {
|
||
var query = new Object();
|
||
var isPlayed = false;
|
||
var curUsers = new Array();
|
||
$.ajax({
|
||
url:'/index/on_line',
|
||
data:query,
|
||
dataType:"json",
|
||
type:"POST",
|
||
async:false,
|
||
success:function(data){
|
||
var str = '';
|
||
if(data){
|
||
for(var i=0;i<data.length;i++){
|
||
str += '<tr>';
|
||
str += '<td>'+data[i]['username']+'</td>';
|
||
str += '<td>'+data[i]['table_name']+'</td>';
|
||
str += '<td>'+data[i]['client']+'</td>';
|
||
str += '</tr>';
|
||
if(!isPlayed && !preUsers.includes(data[i]['username'])) {
|
||
isPlayed = true;
|
||
$('#new-user-come').attr("src",new_user_mp3_url);
|
||
document.getElementById('new-user-come').play();
|
||
}
|
||
curUsers.push(data[i]['username']);
|
||
}
|
||
}else{
|
||
str += '<tr>';
|
||
str += '<td colspan="3">暂无在线玩家</td>';
|
||
str += '</tr>';
|
||
}
|
||
|
||
preUsers = curUsers;
|
||
|
||
$('.on_line_info').empty().append(str);
|
||
}
|
||
});
|
||
}, 50000);
|
||
|
||
})
|
||
|
||
|
||
//socketio
|
||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?connect=user&userid="+userid+"&login_token="+online_token+"&account="+account,{transports: ['websocket']});
|
||
websocket.on('reconnecting', (timeout) => {
|
||
//触发重连
|
||
layer.msg('服务断开,正在重新连接...', {
|
||
icon: 16,
|
||
shade: 0.6,
|
||
time:0,
|
||
});
|
||
});
|
||
websocket.on('reconnect', (timeout) => {
|
||
//重连成功
|
||
layer.closeAll();
|
||
layer.msg('服务重新连接成功');
|
||
});
|
||
//开始下注
|
||
websocket.on('startBet',function(data){
|
||
refresh_table(data.table_id);
|
||
refresh_open_table(data.table_id);
|
||
refresh_table_bet(data.table_id);
|
||
});
|
||
//开始下注倒计时
|
||
websocket.on('startBetCountDown',function(data){
|
||
table_result = '#'+data.table_id+' .table_result';
|
||
$(table_result).html(data.count_down);
|
||
$(table_result).removeClass('font_22_size');
|
||
$(table_result).addClass('font_70_size');
|
||
refresh_open_table(data.table_id);
|
||
});
|
||
//结束下注
|
||
websocket.on('endBet',function(data){
|
||
table_result = '#'+data.table_id+' .table_result';
|
||
$(table_result).html('等待开牌');
|
||
$(table_result).removeClass('font_70_size');
|
||
refresh_open_table(data.table_id);
|
||
});
|
||
//抢庄倒计时
|
||
websocket.on('startRobCountDown',function(data){
|
||
table_result = '#'+data.table_id+' .table_result';
|
||
$(table_result).html(data.count_down);
|
||
$(table_result).removeClass('font_22_size');
|
||
$(table_result).addClass('font_70_size');
|
||
table_tip = '#'+data.table_id+' .info_tip';
|
||
$(table_tip).html('抢庄中');
|
||
refresh_open_table(data.table_id);
|
||
});
|
||
//抢庄结束
|
||
websocket.on('endRob',function(data){
|
||
table_result = '#'+data.table_id+' .table_result';
|
||
$(table_result).html('');
|
||
$(table_result).removeClass('font_70_size');
|
||
refresh_open_table(data.table_id);
|
||
get_banker(data.table_id)
|
||
});
|
||
websocket.on('TctoBetTotal',function(data){
|
||
refresh_table(data.table_id);
|
||
refresh_open_table(data.table_id);
|
||
refresh_table_bet(data.table_id);
|
||
$('#tip').attr("src",mp3_url);
|
||
document.getElementById('tip').play();
|
||
});
|
||
websocket.on('allBetAmount',function(data){
|
||
refresh_table(data.table_id);
|
||
refresh_open_table(data.table_id);
|
||
refresh_table_bet(data.table_id);
|
||
$('#tip').attr("src",mp3_url);
|
||
document.getElementById('tip').play();
|
||
});
|
||
websocket.on('NntoBetTotal',function(data){
|
||
refresh_table(data.table_id);
|
||
refresh_open_table(data.table_id);
|
||
refresh_table_bet(data.table_id);
|
||
$('#tip').attr("src",mp3_url);
|
||
document.getElementById('tip').play();
|
||
});
|
||
//百家乐开奖
|
||
websocket.on('openingBaccaratResult',function(data){
|
||
table_result = '#'+data.table_id+' .table_result';
|
||
if(data.round.opening == '1'){
|
||
resule = '庄赢';
|
||
if(data.round.pair == 1){
|
||
resule = '庄-庄对';
|
||
}else if(data.round.pair == 2){
|
||
resule = '庄-闲对';
|
||
}else if(data.round.pair == 3){
|
||
resule = '庄-庄闲对';
|
||
}
|
||
}else if(data.round.opening == '2'){
|
||
resule = '闲赢';
|
||
if(data.round.pair == 1){
|
||
resule = '闲-庄对';
|
||
}else if(data.round.pair == 2){
|
||
resule = '闲-闲对';
|
||
}else if(data.round.pair == 3){
|
||
resule = '闲-庄闲对';
|
||
}
|
||
}else if(data.round.opening == '3'){
|
||
resule = '和局';
|
||
if(data.round.pair == 1){
|
||
resule = '和-庄对';
|
||
}else if(data.round.pair == 2){
|
||
resule = '和-庄对';
|
||
}else if(data.round.pair == 3){
|
||
resule = '和-庄闲对';
|
||
}
|
||
}
|
||
$(table_result).html(resule);
|
||
table_number = '#'+data.table_id+' .table_number';
|
||
$(table_number).html('第 '+data.round.boot_num+' 靴 '+data.round.number_tab_number+' 口');
|
||
$('#'+data.table_id).attr("boot_id",data.round.boot_id);
|
||
$('#'+data.table_id).attr("boot_num",data.round.boot_num);
|
||
$('#'+data.table_id).attr("number",data.round.number_tab_number);
|
||
var box_alert_id = $('#modal-2').attr('box_table_id');
|
||
if(data.table_id == box_alert_id){
|
||
$('#modal-2').attr("box_boot_id",data.round.boot_id);
|
||
$('#modal-2').attr("box_number",data.round.number_tab_number);
|
||
}
|
||
refresh_waybill(data.table_id,data.round.boot_id);
|
||
});
|
||
//龙虎开奖
|
||
websocket.on('openingDtResult',function(data){
|
||
table_result = '#'+data.table_id+' .table_result';
|
||
if(data.round.opening == '1'){
|
||
resule = '龙赢';
|
||
}else if(data.round.opening == '2'){
|
||
resule = '虎赢';
|
||
}else if(data.round.opening == '3'){
|
||
resule = '和局';
|
||
}
|
||
$(table_result).html(resule);
|
||
table_number = '#'+data.table_id+' .table_number';
|
||
$(table_number).html('第 '+data.round.boot_num+' 靴 '+data.round.number_tab_number+' 口');
|
||
$('#'+data.table_id).attr("boot_id",data.round.boot_id);
|
||
$('#'+data.table_id).attr("boot_num",data.round.boot_num);
|
||
$('#'+data.table_id).attr("number",data.round.number_tab_number);
|
||
var box_alert_id = $('#modal-2').attr('box_table_id');
|
||
if(data.table_id == box_alert_id){
|
||
$('#modal-2').attr("box_boot_id",data.round.boot_id);
|
||
$('#modal-2').attr("box_number",data.round.number_tab_number);
|
||
}
|
||
refresh_waybill(data.table_id,data.round.boot_id);
|
||
});
|
||
//牛牛开奖
|
||
websocket.on('openingNnResult',function(data){
|
||
resule = '';
|
||
table_result = '#'+data.table_id+' .table_result';
|
||
if(data.round.win_player_1 == '1'){
|
||
resule = '闲一 ';
|
||
}
|
||
if(data.round.win_player_2 == '1'){
|
||
resule = resule + '闲二 ';
|
||
}
|
||
if(data.round.win_player_3 == '1'){
|
||
resule = resule + '闲三';
|
||
}
|
||
if(data.round.win_player_1 == '0' && data.round.win_player_2 == '0' && data.round.win_player_3 == '0'){
|
||
resule = '庄赢';
|
||
}
|
||
if(resule.length >= 8){
|
||
$(table_result).addClass('font_22_size');
|
||
}
|
||
$(table_result).html(resule);
|
||
table_number = '#'+data.table_id+' .table_number';
|
||
$(table_number).html('第 '+data.round.boot_num+' 靴 '+data.round.number_tab_number+' 口');
|
||
$('#'+data.table_id).attr("boot_id",data.round.boot_id);
|
||
$('#'+data.table_id).attr("boot_num",data.round.boot_num);
|
||
$('#'+data.table_id).attr("number",data.round.number_tab_number);
|
||
var box_alert_id = $('#modal-2').attr('box_table_id');
|
||
if(data.table_id == box_alert_id){
|
||
$('#modal-2').attr("box_boot_id",data.round.boot_id);
|
||
$('#modal-2').attr("box_number",data.round.number_tab_number);
|
||
}
|
||
});
|
||
|
||
//三卡开奖
|
||
websocket.on('openingTcResult',function(data){
|
||
resule = '';
|
||
table_result = '#'+data.table_id+' .table_result';
|
||
if(data.round.win_player_1 == '1'){
|
||
resule = '闲一 ';
|
||
}
|
||
if(data.round.win_player_2 == '1'){
|
||
resule = resule + '闲二 ';
|
||
}
|
||
if(data.round.win_player_3 == '1'){
|
||
resule = resule + '闲三';
|
||
}
|
||
if(data.round.win_player_1 == '0' && data.round.win_player_2 == '0' && data.round.win_player_3 == '0'){
|
||
resule = '庄赢';
|
||
}
|
||
if(resule.length >= 8){
|
||
$(table_result).addClass('font_22_size');
|
||
}
|
||
$(table_result).html(resule);
|
||
table_number = '#'+data.table_id+' .table_number';
|
||
$(table_number).html('第 '+data.round.boot_num+' 靴 '+data.round.number_tab_number+' 口');
|
||
$('#'+data.table_id).attr("boot_id",data.round.boot_id);
|
||
$('#'+data.table_id).attr("boot_num",data.round.boot_num);
|
||
$('#'+data.table_id).attr("number",data.round.number_tab_number);
|
||
var box_alert_id = $('#modal-2').attr('box_table_id');
|
||
if(data.table_id == box_alert_id){
|
||
$('#modal-2').attr("box_boot_id",data.round.boot_id);
|
||
$('#modal-2').attr("box_number",data.round.number_tab_number);
|
||
}
|
||
});
|
||
// ----------------------------------------------------------
|
||
|
||
function check_table(){
|
||
var query = new Object();
|
||
query.game = game;
|
||
query.is_cs = is_cs;
|
||
query.table_list = table_list;
|
||
query.username = username;
|
||
$.ajax({
|
||
url:'/index/check_table',
|
||
data:query,
|
||
dataType:"json",
|
||
type:"POST",
|
||
async:false,
|
||
success:function(data){
|
||
if(data['msg']){
|
||
layer.msg(data['msg']);
|
||
$('#username').val('');
|
||
return false;
|
||
username = '';
|
||
}
|
||
if(data['bet_person']){
|
||
$('#bet_person').html(data.bet_person+'人');
|
||
}
|
||
if(data['table_info']){
|
||
table_info = data['table_info'];
|
||
var str = '';
|
||
for(var i=0;i<table_info.length;i++){
|
||
str += '<div class="table_info md-trigger" id='+table_info[i]['id']+' data-modal="modal-2" table_name='+table_info[i]['table_name']+' boot_id='+table_info[i]['boot_id']+' boot_num='+table_info[i]['boot_num']+' number='+table_info[i]['number']+' table_id='+table_info[i]['id']+' onclick="open_table(this)">';
|
||
if(table_info[i]['game_id'] == 1 || table_info[i]['game_id'] == 2){
|
||
if(table_info[i]['game_id'] == 1){
|
||
str += '<div class="info_left" style="height: 230px">';
|
||
}else{
|
||
str += '<div class="info_left">';
|
||
}
|
||
str += '<div class="table_name">'+table_info[i]['table_name']+'</div>';
|
||
str += '<div class="table_result">'+table_info[i]['status']+'</div>';
|
||
str += '<div class="table_number">第 '+table_info[i]['boot_num']+' 靴 '+table_info[i]['number']+' 口</div>';
|
||
}else if(table_info[i]['game_id'] == 4 || table_info[i]['game_id'] == 5){
|
||
str += '<div class="info_left" style="height: 190px;">';
|
||
str += '<div class="table_name">'+table_info[i]['table_name']+'</div>';
|
||
str += '<div class="table_result">'+table_info[i]['status']+'</div>';
|
||
str += '<div class="info_tip" style="height: 30px;color: #fff; text-align: center; font-size: 20px; line-height: 30px;"></div>';
|
||
str += '<div class="table_number">第 '+table_info[i]['boot_num']+' 靴 '+table_info[i]['number']+' 口</div>';
|
||
}
|
||
|
||
str += '</div>';
|
||
|
||
if(table_info[i]['game_id'] == 1){
|
||
str += '<div class="info_right">';
|
||
str += '<div class="number_bet" style="height: 180px;">';
|
||
str += '<div><div class="result_word">庄</div><div class="result_money">'+table_info[i]['banker_amount']+'</div></div>';
|
||
str += '<div><div class="result_word">闲</div><div class="result_money">'+table_info[i]['player_amount']+'</div></div>';
|
||
str += '<div><div class="result_word">和</div><div class="result_money">'+table_info[i]['tie_amount']+'</div></div>';
|
||
str += '<div><div class="result_word">庄对</div><div class="result_money">'+table_info[i]['banker_pair_amount']+'</div></div>';
|
||
str += '<div><div class="result_word">闲对</div><div class="result_money">'+table_info[i]['player_pair_amount']+'</div></div>';
|
||
str += '<div><div class="result_word">幸运六</div><div class="result_money">'+table_info[i]['luck_six_amount']+'</div></div>';
|
||
str += '<div><div class="result_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">大</div><div class="result_money">'+table_info[i]['big_amount']+'</div></div>';
|
||
str += '<div><div class="result_word">小</div><div class="result_money">'+table_info[i]['small_amount']+'</div></div>';
|
||
}else if(table_info[i]['game_id'] == 2){
|
||
str += '<div class="info_right">';
|
||
str += '<div class="number_bet">';
|
||
str += '<div><div class="result_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">龙</div><div class="result_money">'+table_info[i]['banker_amount']+'</div></div>';
|
||
str += '<div><div class="result_word">虎</div><div class="result_money">'+table_info[i]['player_amount']+'</div></div>';
|
||
str += '<div><div class="result_word">和</div><div class="result_money">'+table_info[i]['tie_amount']+'</div></div>';
|
||
}else if(table_info[i]['game_id'] == 4){
|
||
str += '<div class="info_right" style="width: 660px;height: 190px;">';
|
||
str += '<div class="number_bet" style="width: 30%;">';
|
||
str += '<div><div class="result_word">闲一平倍</div><div class="result_money">'+table_info[i]['amount_player_1']+'</div></div>';
|
||
str += '<div><div class="result_word">闲一翻倍</div><div class="result_money">'+table_info[i]['amount_player_1_times']+'</div></div>';
|
||
str += '<div><div class="forecast_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">闲二平倍</div><div class="result_money">'+table_info[i]['amount_player_2']+'</div></div>';
|
||
str += '<div><div class="result_word">闲二翻倍</div><div class="result_money">'+table_info[i]['amount_player_2_times']+'</div></div>';
|
||
str += '<div><div class="forecast_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">闲二平倍</div><div class="result_money">'+table_info[i]['amount_player_3']+'</div></div>';
|
||
str += '<div><div class="result_word">闲二翻倍</div><div class="result_money">'+table_info[i]['amount_player_3_times']+'</div></div>';
|
||
}else if(table_info[i]['game_id'] == 5){
|
||
str += '<div class="info_right" style="width: 1400px;height: 190px;">';
|
||
str += '<div class="number_bet" style="width: 10%;">';
|
||
str += '<div><div class="result_word">闲一平倍</div><div class="result_money">'+table_info[i]['amount_player_1']+'</div></div>';
|
||
str += '<div><div class="result_word">闲一翻倍</div><div class="result_money">'+table_info[i]['amount_player_1_times']+'</div></div>';
|
||
str += '<div><div class="forecast_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">闲二平倍</div><div class="result_money">'+table_info[i]['amount_player_2']+'</div></div>';
|
||
str += '<div><div class="result_word">闲二翻倍</div><div class="result_money">'+table_info[i]['amount_player_2_times']+'</div></div>';
|
||
str += '<div><div class="forecast_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">闲二平倍</div><div class="result_money">'+table_info[i]['amount_player_3']+'</div></div>';
|
||
str += '<div><div class="result_word">闲二翻倍</div><div class="result_money">'+table_info[i]['amount_player_3_times']+'</div></div>';
|
||
}
|
||
str += '</div>';
|
||
if(table_info[i]['game_id'] == 1){
|
||
str += '<div class="number_forecast">';
|
||
str += '<div><div class="forecast_word">开庄</div><div class="result_money">'+table_info[i]['banker_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开闲</div><div class="result_money">'+table_info[i]['player_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开和</div><div class="result_money">'+table_info[i]['tie_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开庄对</div><div class="result_money">'+table_info[i]['banker_pair_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开闲对</div><div class="result_money">'+table_info[i]['player_pair_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开两张幸运六</div><div class="result_money">'+table_info[i]['luck_six_2_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开三张幸运六</div><div class="result_money">'+table_info[i]['luck_six_3_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开大</div><div class="result_money">'+table_info[i]['big_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开小</div><div class="result_money">'+table_info[i]['small_forecast']+'</div></div>';
|
||
}else if(table_info[i]['game_id'] == 2){
|
||
str += '<div class="number_forecast">';
|
||
str += '<div><div class="forecast_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="forecast_word">开龙</div><div class="result_money">'+table_info[i]['banker_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开虎</div><div class="result_money">'+table_info[i]['player_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">开和</div><div class="result_money">'+table_info[i]['tie_forecast']+'</div></div>';
|
||
}else if(table_info[i]['game_id'] == 4){
|
||
str += '<div class="number_forecast" style="width: 70%;">';
|
||
str += '<div><div class="forecast_word">闲一赢</div><div class="result_money">'+table_info[i]['player_1_forecast']+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一~牛六:</div><div class="result_money">'+table_info[i]['player_1_times_n1_n6_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛七~牛九:</div><div class="result_money">'+table_info[i]['player_1_times_n7_n9_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+table_info[i]['player_1_times_nn_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">五公:</div><div class="result_money">'+table_info[i]['player_1_times_5n_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '<div><div class="forecast_word">闲二赢</div><div class="result_money">'+table_info[i]['player_2_forecast']+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一~牛六:</div><div class="result_money">'+table_info[i]['player_2_times_n1_n6_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛七~牛九:</div><div class="result_money">'+table_info[i]['player_2_times_n7_n9_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+table_info[i]['player_2_times_nn_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">五公:</div><div class="result_money">'+table_info[i]['player_2_times_5n_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '<div><div class="forecast_word">闲三赢</div><div class="result_money">'+table_info[i]['player_3_forecast']+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一~牛六:</div><div class="result_money">'+table_info[i]['player_3_times_n1_n6_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛七~牛九:</div><div class="result_money">'+table_info[i]['player_3_times_n7_n9_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+table_info[i]['player_3_times_nn_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">五公:</div><div class="result_money">'+table_info[i]['player_3_times_5n_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
}else if(table_info[i]['game_id'] == 5){
|
||
str += '<div class="number_forecast" style="width: 90%;">';
|
||
str += '<div><div class="forecast_word" style="width: 30%">闲一赢</div><div class="result_money" style="width: 70%">'+table_info[i]['player_1_forecast']+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一:</div><div class="result_money">'+table_info[i]['player_1_times_n1_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛二:</div><div class="result_money">'+table_info[i]['player_1_times_n2_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛三:</div><div class="result_money">'+table_info[i]['player_1_times_n3_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛四:</div><div class="result_money">'+table_info[i]['player_1_times_n4_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛五:</div><div class="result_money">'+table_info[i]['player_1_times_n5_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛六:</div><div class="result_money">'+table_info[i]['player_1_times_n6_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛七:</div><div class="result_money">'+table_info[i]['player_1_times_n7_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛八:</div><div class="result_money">'+table_info[i]['player_1_times_n8_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛九:</div><div class="result_money">'+table_info[i]['player_1_times_n9_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+table_info[i]['player_1_times_nn_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">豹子:</div><div class="result_money">'+table_info[i]['player_1_times_bz_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">同花顺:</div><div class="result_money">'+table_info[i]['player_1_times_ths_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">皇家同花顺:</div><div class="result_money">'+table_info[i]['player_1_times_hjths_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '<div><div class="forecast_word" style="width: 30%">闲二赢</div><div class="result_money" style="width: 70%">'+table_info[i]['player_2_forecast']+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一:</div><div class="result_money">'+table_info[i]['player_2_times_n1_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛二:</div><div class="result_money">'+table_info[i]['player_2_times_n2_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛三:</div><div class="result_money">'+table_info[i]['player_2_times_n3_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛四:</div><div class="result_money">'+table_info[i]['player_2_times_n4_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛五:</div><div class="result_money">'+table_info[i]['player_2_times_n5_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛六:</div><div class="result_money">'+table_info[i]['player_2_times_n6_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛七:</div><div class="result_money">'+table_info[i]['player_2_times_n7_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛八:</div><div class="result_money">'+table_info[i]['player_2_times_n8_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛九:</div><div class="result_money">'+table_info[i]['player_2_times_n9_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+table_info[i]['player_2_times_nn_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">豹子:</div><div class="result_money">'+table_info[i]['player_2_times_bz_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">同花顺:</div><div class="result_money">'+table_info[i]['player_2_times_ths_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">皇家同花顺:</div><div class="result_money">'+table_info[i]['player_2_times_hjths_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '<div><div class="forecast_word" style="width: 30%">闲三赢</div><div class="result_money" style="width: 70%">'+table_info[i]['player_3_forecast']+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一:</div><div class="result_money">'+table_info[i]['player_3_times_n1_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛二:</div><div class="result_money">'+table_info[i]['player_3_times_n2_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛三:</div><div class="result_money">'+table_info[i]['player_3_times_n3_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛四:</div><div class="result_money">'+table_info[i]['player_3_times_n4_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛五:</div><div class="result_money">'+table_info[i]['player_3_times_n5_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛六:</div><div class="result_money">'+table_info[i]['player_3_times_n6_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛七:</div><div class="result_money">'+table_info[i]['player_3_times_n7_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛八:</div><div class="result_money">'+table_info[i]['player_3_times_n8_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛九:</div><div class="result_money">'+table_info[i]['player_3_times_n9_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+table_info[i]['player_3_times_nn_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">豹子:</div><div class="result_money">'+table_info[i]['player_3_times_bz_forecast']+'</div></div>';
|
||
str += '<div><div class="forecast_word">同花顺:</div><div class="result_money">'+table_info[i]['player_3_times_ths_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">皇家同花顺:</div><div class="result_money">'+table_info[i]['player_3_times_hjths_forecast']+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
}
|
||
str += '</div>';
|
||
if(table_info[i]['game_id'] == 1){
|
||
if(table_info[i]['difference_type'] == 1){
|
||
str += '<div class="difference red">庄闲差:'+table_info[i]['difference']+'</div>';
|
||
}else if(table_info[i]['difference_type'] == 2){
|
||
str += '<div class="difference blue">庄闲差:'+table_info[i]['difference']+'</div>';
|
||
}else{
|
||
str += '<div class="difference">庄闲差:'+table_info[i]['difference']+'</div>';
|
||
}
|
||
}
|
||
if(table_info[i]['game_id'] == 2){
|
||
if(table_info[i]['difference_type'] == 1){
|
||
str += '<div class="difference red">龙虎差:'+table_info[i]['difference']+'</div>';
|
||
}else if(table_info[i]['difference_type'] == 2){
|
||
str += '<div class="difference blue">龙虎差:'+table_info[i]['difference']+'</div>';
|
||
}else{
|
||
str += '<div class="difference">龙虎差:'+table_info[i]['difference']+'</div>';
|
||
}
|
||
}
|
||
|
||
str += '</div>';
|
||
if(table_info[i]['game_id'] == 1 || table_info[i]['game_id'] == 2){
|
||
str += '<div class="info_waybill" style="height: 150px; width: 300px; background-color: #fff; float: left;">';
|
||
str += '<div class="waybill_show" style="width: 100%;height: 150px;"><canvas id="canvas_'+table_info[i]['id']+'"></canvas></div>';
|
||
str += '</div>';
|
||
}
|
||
str += '<div class="info_bottom">';
|
||
str += '<table>';
|
||
str += '<thead>';
|
||
str += '<th>代理名</th>';
|
||
str += '<th>玩家</th>';
|
||
str += '<th>下注详情</th>';
|
||
str += '<th>下注时间</th>';
|
||
str += '</thead>';
|
||
str += '<tbody class="info_bottom_bet">';
|
||
var table_bet_info = table_info[i]['bet_info'];
|
||
if(table_bet_info.length == 0){
|
||
str += '<tr>';
|
||
str += '<td colspan="4">暂无下注信息</td>';
|
||
str += '</tr>';
|
||
}else{
|
||
for(var y=0;y<table_bet_info.length;y++){
|
||
str += '<tr>';
|
||
str += '<td style="background-color: #ffeb3b;">'+table_bet_info[y]['agent_parent_username']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+table_bet_info[y]['username']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+table_bet_info[y]['bet_contect']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+table_bet_info[y]['create_time']+'</td>';
|
||
str += '</tr>';
|
||
}
|
||
}
|
||
str += '</tbody>';
|
||
str += '</table>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
|
||
$('.center').empty().append(str);
|
||
}
|
||
|
||
for(var i=0;i<table_info.length;i++){
|
||
if(table_info[i]['game_id'] == 1 || table_info[i]['game_id'] == 2){
|
||
var waybill_data = table_info[i]['waybill'];
|
||
var id = '#canvas_'+table_info[i]['id'];
|
||
requestData_show(waybill_data,id);
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
}
|
||
});
|
||
}
|
||
function open_table(obj){
|
||
$('#modal-2').addClass('md-show');
|
||
var query = new Object();
|
||
query.table_id = $(obj).attr('table_id');
|
||
query.boot_id = $(obj).attr('boot_id');
|
||
query.number = $(obj).attr('number');
|
||
$.ajax({
|
||
url:'/index/table_bet_info',
|
||
data:query,
|
||
dataType:"json",
|
||
type:"POST",
|
||
async:false,
|
||
success:function(data){
|
||
if(data.game_id == 1 || data.game_id == 2){
|
||
$('#modal-2').css('width','1200px');
|
||
$(".little_table_info").css("width", "510px");
|
||
if(data.game_id == 1){
|
||
$(".little_table_info_box").css("height", "230px");
|
||
var str_dom = '<div class="info_left" style="height: 230px;">' + $('#'+query.table_id+' .info_left').html() + '</div><div class="info_right" >';
|
||
}else{
|
||
$(".little_table_info_box").css("height", "150px");
|
||
var str_dom = '<div class="info_left">' + $('#'+query.table_id+' .info_left').html() + '</div><div class="info_right" >';
|
||
}
|
||
|
||
|
||
str_dom += $('#'+query.table_id+' .info_right').html() + '</div>';
|
||
$('.little_table_info').empty().append(str_dom);
|
||
$('#modal-2').attr("box_table_id",query.table_id);
|
||
$('#modal-2').attr("box_boot_id",query.boot_id);
|
||
$('#modal-2').attr("box_number",query.number);
|
||
$('.waybill').show();
|
||
requestData(data.waybill);
|
||
}
|
||
if(data.game_id == 4){
|
||
$('#modal-2').css('width','1200px');
|
||
$(".little_table_info").css("width", "770px");
|
||
$(".little_table_info_box").css("height", "190px");
|
||
var str_dom = '<div class="info_left" style="height: 190px;">' + $('#'+query.table_id+' .info_left').html() + '</div><div class="info_right" style="width: 459px;height: 190px;">';
|
||
str_dom += $('#'+query.table_id+' .info_right').html() + '</div>';
|
||
$('.little_table_info').empty().append(str_dom);
|
||
$('#modal-2').attr("box_table_id",query.table_id);
|
||
$('#modal-2').attr("box_boot_id",query.boot_id);
|
||
$('#modal-2').attr("box_number",query.number);
|
||
$('.waybill').hide();
|
||
}
|
||
if(data.game_id == 5){
|
||
$('#modal-2').css('width','1600px');
|
||
$(".little_table_info").css("width", "1550px");
|
||
$(".little_table_info_box").css("height", "190px");
|
||
var str_dom = '<div class="info_left" style="height: 190px;">' + $('#'+query.table_id+' .info_left').html() + '</div><div class="info_right" style="width: 1400px;height: 190px;">';
|
||
str_dom += $('#'+query.table_id+' .info_right').html() + '</div>';
|
||
$('.little_table_info').empty().append(str_dom);
|
||
$('#modal-2').attr("box_table_id",query.table_id);
|
||
$('#modal-2').attr("box_boot_id",query.boot_id);
|
||
$('#modal-2').attr("box_number",query.number);
|
||
$('.waybill').hide();
|
||
}
|
||
$('#online_player').html(data.online_player);
|
||
$('#height_username').html(data.height_username);
|
||
var str = '';
|
||
str += '<thead>';
|
||
str += '<th>代理名</th>';
|
||
str += '<th>顶级占成</th>';
|
||
str += '<th>账号</th>';
|
||
str += '<th>会员名</th>';
|
||
str += '<th>当前余额</th>';
|
||
str += '<th>下注时间</th>';
|
||
if(data.game_id == 1){
|
||
str += '<th>下庄</th>';
|
||
str += '<th>下闲</th>';
|
||
str += '<th>下和</th>';
|
||
str += '<th>下庄对</th>';
|
||
str += '<th>下闲对</th>';
|
||
}else if(data.game_id == 2){
|
||
str += '<th>下龙</th>';
|
||
str += '<th>下虎</th>';
|
||
str += '<th>下和</th>';
|
||
}else if(data.game_id == 4 || data.game_id == 5){
|
||
str += '<th>闲一平倍</th>';
|
||
str += '<th>闲一翻倍</th>';
|
||
str += '<th>闲二平倍</th>';
|
||
str += '<th>闲二翻倍</th>';
|
||
str += '<th>闲三平倍</th>';
|
||
str += '<th>闲三翻倍</th>';
|
||
}
|
||
// str += '<th>下注时间</th>';
|
||
str += '</thead>';
|
||
if(data.number_bet){
|
||
for(var i=0;i<data.number_bet.length;i++){
|
||
str += '<tr>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['agent_parent_username']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['parent_agent_cs']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['username']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['nickname']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['money']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['create_time']+'</td>';
|
||
if(data.game_id == 1 || data.game_id == 2){
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['banker_amount']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['player_amount']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['tie_amount']+'</td>';
|
||
if(data.game_id == 1){
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['banker_pair_amount']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['player_pair_amount']+'</td>';
|
||
}
|
||
}else{
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_1']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_1_times']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_2']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_2_times']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_3']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_3_times']+'</td>';
|
||
}
|
||
str += '</tr>';
|
||
}
|
||
}
|
||
$('.gridtable').empty().append(str);
|
||
}
|
||
});
|
||
}
|
||
function refresh_open_table(id){
|
||
var query = new Object();
|
||
query.table_id = $('#modal-2').attr("box_table_id");
|
||
if(id != query.table_id){
|
||
return false;
|
||
}
|
||
query.boot_id = $('#modal-2').attr("box_boot_id");
|
||
query.number = $('#modal-2').attr("box_number");
|
||
|
||
$.ajax({
|
||
url:'/index/table_bet_info',
|
||
data:query,
|
||
dataType:"json",
|
||
type:"POST",
|
||
async:false,
|
||
success:function(data){
|
||
|
||
if(data.game_id == 1 || data.game_id == 2){
|
||
var str_dom = '<div class="info_left">' + $('#'+query.table_id+' .info_left').html() + '</div><div class="info_right">';
|
||
}else if(data.game_id == 4){
|
||
var str_dom = '<div class="info_left" style="height: 190px;">' + $('#'+query.table_id+' .info_left').html() + '</div><div class="info_right" style="width: 459px;height: 190px;">';
|
||
}else if(data.game_id == 5){
|
||
var str_dom = '<div class="info_left" style="height: 190px;">' + $('#'+query.table_id+' .info_left').html() + '</div><div class="info_right" style="width: 950px;height: 190px;">';
|
||
}
|
||
str_dom += $('#'+query.table_id+' .info_right').html() + '</div>';
|
||
$('.little_table_info').empty().append(str_dom);
|
||
requestData(data.waybill);
|
||
var str = '';
|
||
str += '<thead>';
|
||
str += '<th>代理名</th>';
|
||
str += '<th>顶级占成</th>';
|
||
str += '<th>账号</th>';
|
||
str += '<th>会员名</th>';
|
||
str += '<th>当前余额</th>';
|
||
str += '<th>下注时间</th>';
|
||
if(data.game_id == 1){
|
||
str += '<th>下庄</th>';
|
||
str += '<th>下闲</th>';
|
||
str += '<th>下和</th>';
|
||
str += '<th>下庄对</th>';
|
||
str += '<th>下闲对</th>';
|
||
}else if(data.game_id == 2){
|
||
str += '<th>下龙</th>';
|
||
str += '<th>下虎</th>';
|
||
str += '<th>下和</th>';
|
||
}else if(data.game_id == 4 || data.game_id == 5){
|
||
str += '<th>闲一平倍</th>';
|
||
str += '<th>闲一翻倍</th>';
|
||
str += '<th>闲二平倍</th>';
|
||
str += '<th>闲二翻倍</th>';
|
||
str += '<th>闲三平倍</th>';
|
||
str += '<th>闲三翻倍</th>';
|
||
}
|
||
str += '</thead>';
|
||
if(data.number_bet){
|
||
for(var i=0;i<data.number_bet.length;i++){
|
||
str += '<tr>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['agent_parent_username']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['parent_agent_cs']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['username']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['nickname']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['money']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['create_time']+'</td>';
|
||
if(data.game_id == 1 || data.game_id == 2){
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['banker_amount']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['player_amount']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['tie_amount']+'</td>';
|
||
if(data.game_id == 1){
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['banker_pair_amount']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['player_pair_amount']+'</td>';
|
||
}
|
||
}else if(data.game_id == 4 || data.game_id == 5){
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_1']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_1_times']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_2']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_2_times']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_3']+'</td>';
|
||
str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['amount_player_3_times']+'</td>';
|
||
}
|
||
// str += '<td><span class="offline">踢人</span></td>';
|
||
str += '</tr>';
|
||
}
|
||
}
|
||
$('.gridtable').empty().append(str);
|
||
}
|
||
});
|
||
|
||
}
|
||
function refresh_table_bet(id){
|
||
var query = new Object();
|
||
query.table_id = $('#'+ id).attr("table_id");
|
||
query.boot_id = $('#'+ id).attr("boot_id");
|
||
query.number = $('#'+ id).attr("number");
|
||
$.ajax({
|
||
url:'/index/table_bet_info',
|
||
data:query,
|
||
dataType:"json",
|
||
type:"POST",
|
||
async:false,
|
||
success:function(data){
|
||
var bet_str = '';
|
||
|
||
if(data.number_bet.length >0){
|
||
for(var i=0;i<data.number_bet.length;i++){
|
||
var bet_info = '';
|
||
bet_str += '<tr>';
|
||
bet_str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['agent_parent_username']+'</td>';
|
||
bet_str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['username']+'</td>';
|
||
if(data.game_id == 1){
|
||
if(data['number_bet'][i]['banker_amount'] > 0){
|
||
bet_info += '庄:'+data['number_bet'][i]['banker_amount']+' ';
|
||
}
|
||
if(data['number_bet'][i]['player_amount'] > 0){
|
||
bet_info += '闲:'+data['number_bet'][i]['player_amount']+' ';
|
||
}
|
||
if(data['number_bet'][i]['tie_amount'] > 0){
|
||
bet_info += '和:'+data['number_bet'][i]['tie_amount']+' ';
|
||
}
|
||
if(data['number_bet'][i]['banker_pair_amount'] > 0){
|
||
bet_info += '庄对:'+data['number_bet'][i]['banker_pair_amount']+' ';
|
||
}
|
||
if(data['number_bet'][i]['player_pair_amount'] > 0){
|
||
bet_info += '闲对:'+data['number_bet'][i]['player_pair_amount']+' ';
|
||
}
|
||
}
|
||
if(data.game_id == 2){
|
||
if(data['number_bet'][i]['banker_amount'] > 0){
|
||
bet_info += '龙:'+data['number_bet'][i]['banker_amount']+' ';
|
||
}
|
||
if(data['number_bet'][i]['player_amount'] > 0){
|
||
bet_info += '虎:'+data['number_bet'][i]['player_amount']+' ';
|
||
}
|
||
if(data['number_bet'][i]['tie_amount'] > 0){
|
||
bet_info += '和:'+data['number_bet'][i]['tie_amount']+' ';
|
||
}
|
||
}
|
||
if(data.game_id == 4 || data.game_id == 5){
|
||
if(data['number_bet'][i]['amount_player_1'] > 0){
|
||
bet_info += '闲一平倍:'+data['number_bet'][i]['amount_player_1']+' ';
|
||
}
|
||
if(data['number_bet'][i]['amount_player_1_times'] > 0){
|
||
bet_info += '闲一翻倍:'+data['number_bet'][i]['amount_player_1_times']+' ';
|
||
}
|
||
if(data['number_bet'][i]['amount_player_2'] > 0){
|
||
bet_info += '闲二平倍:'+data['number_bet'][i]['amount_player_2']+' ';
|
||
}
|
||
if(data['number_bet'][i]['amount_player_2_times'] > 0){
|
||
bet_info += '闲二翻倍:'+data['number_bet'][i]['amount_player_2_times']+' ';
|
||
}
|
||
if(data['number_bet'][i]['amount_player_3'] > 0){
|
||
bet_info += '闲三平倍:'+data['number_bet'][i]['amount_player_3']+' ';
|
||
}
|
||
if(data['number_bet'][i]['amount_player_3_times'] > 0){
|
||
bet_info += '闲三翻倍:'+data['number_bet'][i]['amount_player_3_times']+' ';
|
||
}
|
||
}
|
||
bet_str += '<td style="background-color: #ffeb3b;">'+bet_info+'</td>';
|
||
bet_str += '<td style="background-color: #ffeb3b;">'+data['number_bet'][i]['create_time']+'</td>';
|
||
bet_str += '</tr>';
|
||
}
|
||
}else{
|
||
bet_str += '<tr>';
|
||
bet_str += '<td colspan="4">暂无下注信息</td>';
|
||
bet_str += '</tr>';
|
||
}
|
||
$('#'+id+' .info_bottom_bet').empty().append(bet_str);
|
||
}
|
||
});
|
||
|
||
}
|
||
function refresh_table(table_id){
|
||
if($('#'+table_id).length > 0){
|
||
var query = new Object();
|
||
query.table_id = table_id;
|
||
query.is_cs = is_cs;
|
||
query.username = username;
|
||
$.ajax({
|
||
url:'/index/refresh_bet',
|
||
data:query,
|
||
dataType:"json",
|
||
type:"POST",
|
||
async:false,
|
||
success:function(data){
|
||
$('#bet_person').html(data.bet_person+'人');
|
||
var str = '';
|
||
|
||
if(data.game_id == 1){
|
||
$('#'+table_id+' .info_right').css({"width":"360px","height":"150px"});
|
||
str += '<div class="number_bet" style="height: 180px">';
|
||
str += '<div><div class="result_word">庄</div><div class="result_money">'+data.banker_amount+'</div></div>';
|
||
str += '<div><div class="result_word">闲</div><div class="result_money">'+data.player_amount+'</div></div>';
|
||
str += '<div><div class="result_word">和</div><div class="result_money">'+data.tie_amount+'</div></div>';
|
||
str += '<div><div class="result_word">庄对</div><div class="result_money">'+data.banker_pair_amount+'</div></div>';
|
||
str += '<div><div class="result_word">闲对</div><div class="result_money">'+data.player_pair_amount+'</div></div>';
|
||
str += '<div><div class="result_word">幸运六</div><div class="result_money">'+data.luck_six_amount+'</div></div>';
|
||
str += '<div><div class="result_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">大</div><div class="result_money">'+data.big_amount+'</div></div>';
|
||
str += '<div><div class="result_word">小</div><div class="result_money">'+data.small_amount+'</div></div>';
|
||
}else if(data.game_id == 2){
|
||
$('#'+table_id+' .info_right').css({"width":"360px","height":"150px"});
|
||
str += '<div class="number_bet">';
|
||
str += '<div><div class="result_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">龙</div><div class="result_money">'+data.banker_amount+'</div></div>';
|
||
str += '<div><div class="result_word">虎</div><div class="result_money">'+data.player_amount+'</div></div>';
|
||
str += '<div><div class="result_word">和</div><div class="result_money">'+data.tie_amount+'</div></div>';
|
||
}else if(data.game_id == 4){
|
||
$('#'+table_id+' .info_right').css({"width":"660px","height":"190px"});
|
||
str += '<div class="number_bet" style="width: 30%;">';
|
||
str += '<div><div class="result_word">闲一平倍</div><div class="result_money">'+data.amount_player_1+'</div></div>';
|
||
str += '<div><div class="result_word">闲一翻倍</div><div class="result_money">'+data.amount_player_1_times+'</div></div>';
|
||
str += '<div><div class="result_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">闲二平倍</div><div class="result_money">'+data.amount_player_2+'</div></div>';
|
||
str += '<div><div class="result_word">闲二翻倍</div><div class="result_money">'+data.amount_player_2_times+'</div></div>';
|
||
str += '<div><div class="result_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">闲三平倍</div><div class="result_money">'+data.amount_player_3+'</div></div>';
|
||
str += '<div><div class="result_word">闲三翻倍</div><div class="result_money">'+data.amount_player_3_times+'</div></div>';
|
||
}else if(data.game_id == 5){
|
||
$('#'+table_id+' .info_right').css({"width":"1400px","height":"190px"});
|
||
str += '<div class="number_bet" style="width: 10%;">';
|
||
str += '<div><div class="result_word">闲一平倍</div><div class="result_money">'+data.amount_player_1+'</div></div>';
|
||
str += '<div><div class="result_word">闲一翻倍</div><div class="result_money">'+data.amount_player_1_times+'</div></div>';
|
||
str += '<div><div class="result_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">闲二平倍</div><div class="result_money">'+data.amount_player_2+'</div></div>';
|
||
str += '<div><div class="result_word">闲二翻倍</div><div class="result_money">'+data.amount_player_2_times+'</div></div>';
|
||
str += '<div><div class="result_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="result_word">闲三平倍</div><div class="result_money">'+data.amount_player_3+'</div></div>';
|
||
str += '<div><div class="result_word">闲三翻倍</div><div class="result_money">'+data.amount_player_3_times+'</div></div>';
|
||
}
|
||
|
||
|
||
str += '</div>';
|
||
|
||
if(data.game_id == 1){
|
||
str += '<div class="number_forecast">';
|
||
str += '<div><div class="forecast_word">开庄</div><div class="result_money">'+data.banker_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开闲</div><div class="result_money">'+data.player_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开和</div><div class="result_money">'+data.tie_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开庄对</div><div class="result_money">'+data.banker_pair_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开闲对</div><div class="result_money">'+data.player_pair_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开两张幸运六</div><div class="result_money">'+data.luck_six_2_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开三张幸运六</div><div class="result_money">'+data.luck_six_3_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开大</div><div class="result_money">'+data.big_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开小</div><div class="result_money">'+data.small_forecast+'</div></div>';
|
||
}else if(data.game_id == 2){
|
||
str += '<div class="number_forecast">';
|
||
str += '<div><div class="forecast_word"> </div><div class="result_money"> </div></div>';
|
||
str += '<div><div class="forecast_word">开龙</div><div class="result_money">'+data.banker_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开虎</div><div class="result_money">'+data.player_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">开和</div><div class="result_money">'+data.tie_forecast+'</div></div>';
|
||
}else if(data.game_id == 4){
|
||
str += '<div class="number_forecast" style="width: 70%;">';
|
||
str += '<div><div class="forecast_word">闲一赢</div><div class="result_money">'+data.player_1_forecast+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一~牛六:</div><div class="result_money">'+data.player_1_times_n1_n6_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛七~牛九:</div><div class="result_money">'+data.player_1_times_n7_n9_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+data.player_1_times_nn_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">五公:</div><div class="result_money">'+data.player_1_times_5n_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '<div><div class="forecast_word">闲二赢</div><div class="result_money">'+data.player_2_forecast+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一~牛六:</div><div class="result_money">'+data.player_2_times_n1_n6_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛七~牛九:</div><div class="result_money">'+data.player_2_times_n7_n9_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+data.player_2_times_nn_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">五公:</div><div class="result_money">'+data.player_2_times_5n_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '<div><div class="forecast_word">闲三赢</div><div class="result_money">'+data.player_3_forecast+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一~牛六:</div><div class="result_money">'+data.player_3_times_n1_n6_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛七~牛九:</div><div class="result_money">'+data.player_3_times_n7_n9_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 50%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+data.player_3_times_nn_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">五公:</div><div class="result_money">'+data.player_3_times_5n_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
}else if(data.game_id == 5){
|
||
str += '<div class="number_forecast" style="width: 90%;">';
|
||
str += '<div><div class="forecast_word" style="width: 30%">闲一赢</div><div class="result_money" style="width: 70%">'+data.player_1_forecast+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一:</div><div class="result_money">'+data.player_1_times_n1_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛二:</div><div class="result_money">'+data.player_1_times_n2_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛三:</div><div class="result_money">'+data.player_1_times_n3_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛四:</div><div class="result_money">'+data.player_1_times_n4_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛五:</div><div class="result_money">'+data.player_1_times_n5_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛六:</div><div class="result_money">'+data.player_1_times_n6_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛七:</div><div class="result_money">'+data.player_1_times_n7_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛八:</div><div class="result_money">'+data.player_1_times_n8_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛九:</div><div class="result_money">'+data.player_1_times_n9_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+data.player_1_times_nn_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">豹子:</div><div class="result_money">'+data.player_1_times_bz_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">同花顺:</div><div class="result_money">'+data.player_1_times_ths_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">皇家同花顺:</div><div class="result_money">'+data.player_1_times_hjths_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '<div><div class="forecast_word" style="width: 30%">闲二赢</div><div class="result_money" style="width: 70%">'+data.player_2_forecast+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一:</div><div class="result_money">'+data.player_2_times_n1_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛二:</div><div class="result_money">'+data.player_2_times_n2_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛三:</div><div class="result_money">'+data.player_2_times_n3_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛四:</div><div class="result_money">'+data.player_2_times_n4_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛五:</div><div class="result_money">'+data.player_2_times_n5_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛六:</div><div class="result_money">'+data.player_2_times_n6_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛七:</div><div class="result_money">'+data.player_2_times_n7_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛八:</div><div class="result_money">'+data.player_2_times_n8_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛九:</div><div class="result_money">'+data.player_2_times_n9_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+data.player_2_times_nn_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">豹子:</div><div class="result_money">'+data.player_2_times_bz_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">同花顺:</div><div class="result_money">'+data.player_2_times_ths_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">皇家同花顺:</div><div class="result_money">'+data.player_2_times_hjths_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
str += '<div><div class="forecast_word" style="width: 30%">闲三赢</div><div class="result_money" style="width: 70%">'+data.player_3_forecast+'</div></div>';
|
||
str += '<div class="nn_result_box">';
|
||
str += '<div class="nn_result_box_left" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛一:</div><div class="result_money">'+data.player_3_times_n1_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛二:</div><div class="result_money">'+data.player_3_times_n2_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛三:</div><div class="result_money">'+data.player_3_times_n3_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛四:</div><div class="result_money">'+data.player_3_times_n4_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛五:</div><div class="result_money">'+data.player_3_times_n5_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛六:</div><div class="result_money">'+data.player_3_times_n6_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛七:</div><div class="result_money">'+data.player_3_times_n7_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛八:</div><div class="result_money">'+data.player_3_times_n8_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">牛九:</div><div class="result_money">'+data.player_3_times_n9_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">牛牛:</div><div class="result_money">'+data.player_3_times_nn_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">豹子:</div><div class="result_money">'+data.player_3_times_bz_forecast+'</div></div>';
|
||
str += '<div><div class="forecast_word">同花顺:</div><div class="result_money">'+data.player_3_times_ths_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '<div class="nn_result_box_right" style="width: 14%;float: left;">';
|
||
str += '<div><div class="forecast_word">皇家同花顺:</div><div class="result_money">'+data.player_3_times_hjths_forecast+'</div></div>';
|
||
str += '</div>';
|
||
str += '</div>';
|
||
}
|
||
|
||
str += '</div>';
|
||
if(data.game_id == 1 || data.game_id == 2){
|
||
if(data.difference_type == 1){
|
||
str += '<div class="difference red">庄闲差:'+data.difference+'</div>';
|
||
}else if(data.difference_type == 2){
|
||
str += '<div class="difference blue">庄闲差:'+data.difference+'</div>';
|
||
}else{
|
||
str += '<div class="difference">庄闲差:'+data.difference+'</div>';
|
||
}
|
||
}
|
||
|
||
str += '</div>';
|
||
$('#'+table_id+' .info_right').empty().append(str);
|
||
}
|
||
});
|
||
}
|
||
|
||
}
|
||
|
||
function get_banker(table_id){
|
||
var query = new Object();
|
||
query.table_id = table_id;
|
||
$.ajax({
|
||
url:'/index/get_banker',
|
||
data:query,
|
||
dataType:"json",
|
||
type:"POST",
|
||
async:false,
|
||
success:function(data){
|
||
table_tip = '#'+table_id+' .info_tip';
|
||
$(table_tip).html(data);
|
||
|
||
}
|
||
});
|
||
}
|
||
function requestData(data){
|
||
smallH=$(".waybill").height();
|
||
smallW=$(".waybill").width();
|
||
// 计算单位
|
||
unitsmall=smallH/6;
|
||
// 计算列个数
|
||
colsmall=Math.floor(smallW/unitsmall);
|
||
CanvasTable("#canvas1",unitsmall,6,colsmall,data);
|
||
}
|
||
//刷新路单
|
||
function refresh_waybill(table_id,boot_id){
|
||
var query = new Object();
|
||
query.table_id = table_id;
|
||
query.boot_id = boot_id;
|
||
$.ajax({
|
||
url:'/index/refresh_waybill',
|
||
data:query,
|
||
dataType:"json",
|
||
type:"POST",
|
||
async:false,
|
||
success:function(data){
|
||
id = '#canvas_'+table_id;
|
||
requestData_show(data,id);
|
||
|
||
}
|
||
});
|
||
}
|
||
function requestData_show(data,id){
|
||
smallH=$(".waybill_show").height();
|
||
smallW=$(".waybill_show").width();
|
||
// 计算单位
|
||
unitsmall=smallH/6;
|
||
// 计算列个数
|
||
colsmall=Math.floor(smallW/unitsmall);
|
||
CanvasTable_show(id,unitsmall,6,colsmall,data);
|
||
}
|
||
function CanvasTable(Id,unit,rows,cols,data){
|
||
var width=unit*cols,
|
||
height=unit*rows;
|
||
$(Id).attr("width",width)
|
||
$(Id).attr("height",height)
|
||
var canvasId=$(Id);
|
||
var ctb=canvasId[0].getContext('2d');
|
||
ctb.lineWidth = 1;//线条宽度
|
||
ctb.strokeStyle = "#919191";//线条颜色
|
||
ctb.beginPath();
|
||
ctb.moveTo(0, 0.5);
|
||
ctb.lineTo(width, 0.5);
|
||
for (var i = 0; i <= rows; i++) {
|
||
ctb.moveTo(0, unit*i);
|
||
ctb.lineTo(width, unit*i);
|
||
}
|
||
ctb.closePath()
|
||
ctb.stroke();
|
||
ctb.beginPath();
|
||
ctb.moveTo(0.5, 0);
|
||
ctb.lineTo(0.5, height);
|
||
for (var j = 1; j <= cols; j++) {
|
||
ctb.moveTo(unit*j,0);
|
||
ctb.lineTo(unit*j,height);
|
||
}
|
||
ctb.closePath()
|
||
ctb.stroke();
|
||
if(data.status){
|
||
switch(true){
|
||
case Id=="#canvas1":
|
||
var bigRoad=data.waybill.bigRoad;
|
||
if(bigRoad!=''){
|
||
if(bigRoad[0].result==3&&bigRoad[0].show_x==1&&bigRoad[0].show_y==1){
|
||
BigPathTie(ctb,unit,bigRoad[0].tie_num)
|
||
}else{
|
||
var roadType="bigWay";
|
||
cutRoad(roadType,ctb,unit,bigRoad,cols);
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
function CanvasTable_show(Id,unit,rows,cols,data){
|
||
var width=unit*cols,
|
||
height=unit*rows;
|
||
$(Id).attr("width",width)
|
||
$(Id).attr("height",height)
|
||
var canvasId=$(Id);
|
||
var ctb=canvasId[0].getContext('2d');
|
||
ctb.lineWidth = 1;//线条宽度
|
||
ctb.strokeStyle = "#919191";//线条颜色
|
||
ctb.beginPath();
|
||
ctb.moveTo(0, 0.5);
|
||
ctb.lineTo(width, 0.5);
|
||
for (var i = 0; i <= rows; i++) {
|
||
ctb.moveTo(0, unit*i);
|
||
ctb.lineTo(width, unit*i);
|
||
}
|
||
ctb.closePath()
|
||
ctb.stroke();
|
||
ctb.beginPath();
|
||
ctb.moveTo(0.5, 0);
|
||
ctb.lineTo(0.5, height);
|
||
for (var j = 1; j <= cols; j++) {
|
||
ctb.moveTo(unit*j,0);
|
||
ctb.lineTo(unit*j,height);
|
||
}
|
||
ctb.closePath()
|
||
ctb.stroke();
|
||
if(data.status){
|
||
switch(true){
|
||
case Id==Id:
|
||
var bigRoad=data.waybill.bigRoad;
|
||
if(bigRoad!=''){
|
||
if(bigRoad[0].result==3&&bigRoad[0].show_x==1&&bigRoad[0].show_y==1){
|
||
BigPathTie(ctb,unit,bigRoad[0].tie_num)
|
||
}else{
|
||
var roadType="bigWay";
|
||
cutRoad(roadType,ctb,unit,bigRoad,cols);
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
// 前端路单数据截取
|
||
function cutRoad(roadType,ctb,unit,roadData,cols){
|
||
var L=roadData.length;
|
||
var new_roadData=[];
|
||
var Tab=0
|
||
if(roadType=="showWay"||roadType=="bigWay"){
|
||
Tab=cols-1;
|
||
}else{
|
||
Tab=cols-2;
|
||
}
|
||
var start_x=cols/2+0.25;
|
||
if(L>=1){
|
||
var last_x=roadData[L-1].show_x
|
||
if(last_x>Tab){
|
||
var cut=last_x-Tab
|
||
$.each(roadData,function(i,v){
|
||
if(v.show_x>cut){
|
||
new_roadData.push(v)
|
||
}
|
||
})
|
||
}else{
|
||
new_roadData=roadData;
|
||
cut=0;
|
||
}
|
||
}else{
|
||
new_roadData=roadData;
|
||
cut=0;
|
||
}
|
||
$.each(new_roadData,function(i,v){
|
||
if(roadType=="bigWay"){
|
||
BigPath(ctb,unit,v.show_x-cut,v.show_y,v.result,v.tie_num,v.pair)
|
||
}
|
||
})
|
||
}
|
||
// 局数 数,文字X坐标,文字Y坐标,文字大小风格
|
||
function Font_tie(ctb,num,Font_x,Font_y,fontsize){
|
||
if(num!==undefined){
|
||
ctb.beginPath();
|
||
ctb.font=fontsize;
|
||
ctb.textAlign = 'center';
|
||
ctb.textBaseline = 'middle';
|
||
ctb.fillStyle ="#242424";
|
||
ctb.fillText(num,Font_x,Font_y);
|
||
ctb.stroke();
|
||
}
|
||
}
|
||
// 大路 第一局 和
|
||
function BigPathTie(ctb,unit,order){
|
||
ctb.beginPath();
|
||
ctb.lineWidth = 2.5;//线条宽度
|
||
ctb.strokeStyle = "#3faa96";//线条颜色
|
||
ctb.lineCap = "round";
|
||
ctb.moveTo(unit*0.15,unit/2);
|
||
ctb.lineTo(unit*0.85,unit/2);
|
||
ctb.stroke();
|
||
Font_tie(ctb,order,unit/2, unit/2,unit*0.55+"px Arial");
|
||
}
|
||
|
||
// 大路
|
||
function BigPath(ctb,unit,x,y,type,slash,corners){
|
||
ctb.beginPath();
|
||
ctb.lineWidth = unit*0.15;
|
||
var radius=unit/2
|
||
if(type==2){
|
||
var color="#0543bc";
|
||
}else if(type==1){
|
||
var color="#b20a00"
|
||
}
|
||
ctb.strokeStyle = color;
|
||
ctb.arc(radius+unit*(x-1),radius+unit*(y-1), unit*0.38, 0, Math.PI * 2);
|
||
ctb.closePath()
|
||
ctb.stroke();
|
||
if(slash!=0){
|
||
ctb.beginPath();
|
||
linewidth=unit*0.2;
|
||
ctb.lineWidth = 3;//线条宽度
|
||
ctb.lineCap = "round";
|
||
ctb.strokeStyle = "#1d8701";//线条颜色
|
||
ctb.moveTo(radius+unit*(x-1)-linewidth,radius+unit*(y-1)+linewidth);
|
||
ctb.lineTo(radius+unit*(x-1)+linewidth,radius+unit*(y-1)-linewidth);
|
||
ctb.stroke();
|
||
if(slash>0){
|
||
Font_tie(ctb,slash,radius+unit*(x-1), radius+unit*(y-1),unit*0.66+"px Arial");
|
||
}
|
||
}
|
||
var corner_xy=unit/3.5
|
||
if(corners==1){
|
||
corner(ctb,unit,x,y,corner_xy,'#ff2202');
|
||
}else if(corners==2){
|
||
corner(ctb,unit,x,y,-corner_xy,'#0337ff');
|
||
}else if(corners==3){
|
||
corner(ctb,unit,x,y,corner_xy,'#ff2202');
|
||
corner(ctb,unit,x,y,-corner_xy,'#0337ff');
|
||
}
|
||
}
|
||
function corner(ctb,unit,x,y,corner_xy,corner_color){
|
||
var radius=unit/2
|
||
ctb.beginPath();
|
||
ctb.lineWidth = 0.5;
|
||
ctb.strokeStyle = "#fff";
|
||
ctb.arc(radius+unit*(x-1)-corner_xy, radius+unit*(y-1)-corner_xy, unit*0.13, 0, Math.PI * 2);
|
||
ctb.fillStyle=corner_color;
|
||
ctb.fill();
|
||
ctb.stroke();
|
||
}
|