394 lines
15 KiB
HTML
394 lines
15 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Document</title>
|
|
<link rel="stylesheet" type="text/css" href="{$Think.ADMIN_STATIC_DOMAIN}static/admin/waybill/css/waybill.css">
|
|
<style>
|
|
.chipOrCash { position: relative; background: #006070; color: #fff; text-align: center; cursor: pointer; border-radius: 5px; line-height: 23px;
|
|
-webkit-touch-callout: none;
|
|
-webkit-user-select: none;
|
|
-khtml-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.chipOrCash { width: 50px; background: #006070; color: #fff; text-align: center; cursor: pointer; border-radius: 5px; line-height: 23px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; float: right;}
|
|
.allchip{position: absolute; color: #006070; bottom: 11px; left: 10px; font-size: 12px;}
|
|
|
|
.footer-box .radio-box .item{ width:11.5%; }
|
|
</style>
|
|
<script src="{$Think.ADMIN_STATIC_DOMAIN}static/admin/waybill/js/jquery.js"></script>
|
|
<script src="{$Think.ADMIN_STATIC_DOMAIN}static/admin/waybill/layer/layer.js"></script>
|
|
<script type="text/javascript" src="{$Think.ADMIN_STATIC_DOMAIN}static/admin/waybill/js/waybill.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<form class="section-form">
|
|
<div class="bet-box table-box">
|
|
<div class="header-box clearfix">
|
|
<a href="{$backUrl}" class="back" ><div class="item"><label class="item-back">返回</label></div></a>
|
|
<div class="item title">修改路单</div>
|
|
<div class="item">
|
|
<label>桌子: </label>
|
|
<select class="select-box" id="select_table" disabled>
|
|
<option value="{$table.id}">{$table.table_name}</option>
|
|
</select>
|
|
</div>
|
|
<div class="item">
|
|
<label>靴号: </label>
|
|
<select class="select-box" id="select_boot" disabled>
|
|
<option value="{$boot.id}">{$boot.boot_num}</option>
|
|
</select>
|
|
</div>
|
|
<div class="item">
|
|
<label>铺号: </label>
|
|
<select class="select-box" id="select_number" disabled>
|
|
<option value="{$number_tab.id}">{$number_tab.number}</option>
|
|
</select>
|
|
</div>
|
|
<div class="item">
|
|
<label>结果: </label>
|
|
{if condition="$number_tab.pair == 0"}
|
|
<input class="select-box" id="result" value="{$number_tab.result_en}" readonly>
|
|
{else}
|
|
<input class="select-box" id="result" value="{$number_tab.result_en}{$number_tab.pair_en}" readonly>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
<style>
|
|
.bet-box .chip-box{
|
|
position: relative;
|
|
height: 170px;
|
|
overflow: hidden;
|
|
background: #fff;
|
|
transition: 0.6s;
|
|
transform-style: preserve-3d;
|
|
}
|
|
|
|
.bet-box .list-box{
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
backface-visibility: hidden;
|
|
}
|
|
.bet-box .cashbox{
|
|
transform: rotateY(180deg);
|
|
}
|
|
</style>
|
|
<?php $num = 1; ?>
|
|
<?php for($i = 0; $i < 4; $i++) : ?>
|
|
<div class="list clearfix">
|
|
<?php for($j = 0; $j < 6; $j++) : ?>
|
|
|
|
<div class="item box-sizing">
|
|
<div class="absolute-box chip">
|
|
<div class="number-box">
|
|
<span>{$num}</span>
|
|
<input type="text" class="user_name" placeholder="请输入卡号" value="<?php if(isset($bet_list[$i][$j])) echo $bet_list[$i][$j]['user_name'] ?>">
|
|
</div>
|
|
<div class="chip-box">
|
|
<div class="chipbox">
|
|
<div class="item-box">
|
|
<label class="bank">庄</label>
|
|
<input class="box-sizing bet_banker" type="text" placeholder="请输入金额" value="<?php if(isset($bet_list[$i][$j]['banker_amount']) && $bet_list[$i][$j]['banker_amount'] > 0) echo $bet_list[$i][$j]['banker_amount'] ?>">
|
|
</div>
|
|
<div class="item-box">
|
|
<label class="player">闲</label>
|
|
<input class="box-sizing bet_player" type="text" placeholder="请输入金额" value="<?php if(isset($bet_list[$i][$j]['player_amount']) && $bet_list[$i][$j]['player_amount'] > 0) echo $bet_list[$i][$j]['player_amount'] ?>">
|
|
</div>
|
|
<div class="item-box">
|
|
<label class="tie">和</label>
|
|
<input class="box-sizing bet_tie" type="text" placeholder="请输入金额" value="<?php if(isset($bet_list[$i][$j]['tie_amount']) && $bet_list[$i][$j]['tie_amount'] > 0) echo $bet_list[$i][$j]['tie_amount'] ?>">
|
|
</div>
|
|
<div class="item-box">
|
|
<label class="banktie">庄对</label>
|
|
<input class="box-sizing bet_banker_pair" type="text" placeholder="请输入金额" value="<?php if(isset($bet_list[$i][$j]['banker_pair_amount']) && $bet_list[$i][$j]['banker_pair_amount'] > 0) echo $bet_list[$i][$j]['banker_pair_amount'] ?>">
|
|
</div>
|
|
<div class="item-box">
|
|
<label class="playertie">闲对</label>
|
|
<input class="box-sizing bet_player_pair" type="text" placeholder="请输入金额" value="<?php if(isset($bet_list[$i][$j]['player_pair_amount']) && $bet_list[$i][$j]['player_pair_amount'] > 0) echo $bet_list[$i][$j]['player_pair_amount'] ?>">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<button class="clear" type="button">清除</button>
|
|
|
|
<div class="allchip">总金额:<span style="color:#EBAF59" class="">0</span></div>
|
|
<div class="chipOrCash" style="background:#006070;opacity:0;"><input class="chipOrCashId" type="hidden" name="counterOrCash" value="1"/><span>美元</span></div>
|
|
<!-- 已下注的总金额 -->
|
|
<script>
|
|
var chip_box = $('.chip-box');
|
|
var length = chip_box.length - 1;
|
|
var chip = chip_box[length];
|
|
var input = $(chip).find('input');
|
|
var allchip = 0
|
|
input.each(function(){
|
|
allchip += Number($(this).val());
|
|
});
|
|
$(chip).siblings('.allchip').find('span').html(allchip);
|
|
</script>
|
|
</div>
|
|
</div>
|
|
<?php $num++; ?>
|
|
<?php endfor; ?>
|
|
</div>
|
|
<?php endfor; ?>
|
|
|
|
<div class="footer-box">
|
|
<div class="radio-box result_baccarat">
|
|
<span class="item banker <?php if($number_tab['result'] == 1) echo "on"; ?>">庄<input type="checkbox" name="checkbox" id="banker" value="banker" <?php if($number_tab['result'] == 1) echo 'checked="checked"'; ?>></span>
|
|
<span class="item player <?php if($number_tab['result'] == 2) echo "on"; ?>">闲<input type="checkbox" name="checkbox" id="player" value="player" <?php if($number_tab['result'] == 2) echo 'checked="checked"'; ?>></span>
|
|
<span class="item tie <?php if($number_tab['result'] == 3) echo "on"; ?>">和<input type="checkbox" name="checkbox" id="tie" value="tie" <?php if($number_tab['result'] == 3) echo 'checked="checked"'; ?>></span>
|
|
<span class="item banker_pair <?php if($number_tab['result'] == 4) echo "on"; ?>">庄对<input type="checkbox" name="checkbox" id="banker_pair" value="banker_pair" <?php if($number_tab['result'] == 4) echo 'checked="checked"'; ?>></span>
|
|
<span class="item player_pair <?php if($number_tab['result'] == 5) echo "on"; ?>">闲对<input type="checkbox" name="checkbox" id="player_pair" value="player_pair" <?php if($number_tab['result'] == 5) echo 'checked="checked"'; ?>></span>
|
|
{if condition="$table.mode == 2"}
|
|
<span class="item win_six">赢6<input type="checkbox" name="checkbox" id="win_six" value="win_six"></span>
|
|
{/if}
|
|
<button class="submit" type="button">提交结果</button>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html>
|
|
<script>
|
|
$(function(){
|
|
|
|
// 键盘事件
|
|
$('input').keyup(function(){
|
|
//单个客户下注的统计
|
|
var class_name = $(this).attr('class');
|
|
if(class_name == 'user_name'){
|
|
var user_name = $(this).val();
|
|
var counterOrCash = $(this).parent().siblings('.counterOrCash').find('.counterOrCashId').val();
|
|
}else{
|
|
var user_name = $(this).parent().parent().parent().parent().find('.user_name').val();
|
|
var counterOrCash = $(this).parent().parent().parent().siblings('.counterOrCash').children('.counterOrCashId').val();
|
|
}
|
|
if(user_name != "" && user_name != undefined){
|
|
if(class_name == "user_name"){
|
|
var chipbox = $(this).parent().siblings('.chip-box').find('.chipbox');
|
|
var cashbox = $(this).parent().siblings('.chip-box').find('.cashbox');
|
|
var allChipSpan = $(this).parent().siblings('.allchip').find('span');
|
|
}else{
|
|
var chipbox = $(this).parent().parent().parent().find('.chipbox');
|
|
var cashbox = $(this).parent().parent().parent().find('.cashbox');
|
|
var allChipSpan = $(this).parent().parent().parent().siblings('.allchip').find('span');
|
|
}
|
|
var allchip = 0;
|
|
chipbox.each(function(){
|
|
$(this).find('input').each(function(){
|
|
allchip += Number($(this).val());
|
|
})
|
|
});
|
|
cashbox.each(function(){
|
|
$(this).find('input').each(function(){
|
|
allchip += Number($(this).val());
|
|
})
|
|
});
|
|
$(allChipSpan).html(allchip);
|
|
}
|
|
});
|
|
|
|
// 清除数据
|
|
$('.clear').click(function(){
|
|
var chipOrCashId = $(this).siblings('.chipOrCash').find('.chipOrCashId').val();
|
|
$(this).parent().find('input').val('');
|
|
$(this).siblings('.allchip').find('span').html(0);
|
|
$(this).siblings('.chipOrCash').find('.chipOrCashId').val(chipOrCashId);
|
|
});
|
|
|
|
/* 提交下注和结果数据 */
|
|
$('.submit').click(function(){
|
|
/* 获取桌号 靴号 */
|
|
var table_id = $('#select_table').val();
|
|
var boot_id = $('#select_boot').val();
|
|
var number_tab_id = $('#select_number').val();
|
|
|
|
// 数据验证
|
|
if(table_id <= 0){
|
|
layer.msg('请选择桌子!');
|
|
return false;
|
|
}
|
|
if(boot_id <= 0){
|
|
layer.msg('请选择靴号!');
|
|
return false;
|
|
}
|
|
if(number_tab_id <= 0){
|
|
layer.msg('请选择铺号!');
|
|
return false;
|
|
}
|
|
|
|
/* 获取下注信息 */
|
|
var chip = new Array;
|
|
var chip_mark = new Array;
|
|
var item = $('.chip');
|
|
item.each(function(){
|
|
var user_name = $(this).find('.user_name').val();
|
|
var counterOrCash = $(this).find('.counterOrCash').children('input').val();
|
|
var bet_chip = new Object;
|
|
bet_chip.user_name = user_name;
|
|
bet_chip.banker_amount = Number($(this).find('.chipbox').find('.bet_banker').val());
|
|
bet_chip.player_amount = Number($(this).find('.chipbox').find('.bet_player').val());
|
|
bet_chip.tie_amount = Number($(this).find('.chipbox').find('.bet_tie').val());
|
|
bet_chip.banker_pair_amount = Number($(this).find('.chipbox').find('.bet_banker_pair').val());
|
|
bet_chip.player_pair_amount = Number($(this).find('.chipbox').find('.bet_player_pair').val());
|
|
|
|
if (user_name != "" && user_name != undefined) {
|
|
var data = new Array;
|
|
// 下注额筹码
|
|
if (bet_chip.banker_amount != "" || bet_chip.player_amount != "" || bet_chip.tie_amount != "" || bet_chip.banker_pair_amount != "" || bet_chip.player_pair_amount != "") {
|
|
data.push(bet_chip)
|
|
}
|
|
if(data.length > 0){
|
|
chip.push(data);
|
|
}
|
|
}
|
|
});
|
|
|
|
/* 获取结果信息 */
|
|
var input = $(".result_baccarat").find('input:checked');
|
|
var result = new Object;
|
|
if(input.length <= 0){
|
|
layer.msg('请选择结果!');
|
|
return false;
|
|
}else{
|
|
result.pair = null; // 先定义对子为空
|
|
input.each(function(){
|
|
var value = $(this).val();
|
|
// 结果为 庄、闲、和 的数据拼装
|
|
if(value == "banker" || value == "player" || value == "tie"){
|
|
result.result = value;
|
|
}
|
|
// 结果有赢6
|
|
if(value == "win_six"){
|
|
result.special = value;
|
|
}else{
|
|
result.special = null;
|
|
}
|
|
|
|
// 结果为 庄对、闲对 的数据拼装
|
|
if(value == "banker_pair" || value == "player_pair"){
|
|
if(result.pair == null){
|
|
result.pair = value;
|
|
}else{
|
|
result.pair = "both_pair";
|
|
}
|
|
}
|
|
})
|
|
}
|
|
/* 拼装所有要发送的数据, 下注,写入数据库 */
|
|
var query = new Object;
|
|
query.table_id = table_id;
|
|
query.boot_id = boot_id;
|
|
query.number_tab_id = number_tab_id;
|
|
query.status = "edit"; // 用于后台处理数据 区分是添加还是修改的标识
|
|
query.chip = JSON.stringify(chip);
|
|
query.result = JSON.stringify(result);
|
|
|
|
var chip_url = "/waybill/baccarat_chip_in";
|
|
// 提醒管理员是否提交数据到后台
|
|
layer.confirm('确定提交吗?', {
|
|
btn: ['确定','取消'] //按钮
|
|
}, function(){
|
|
var result = ajax(chip_url,query);
|
|
if(result.status == 0){
|
|
layer.alert(result.msg);
|
|
return false;
|
|
}else if(result.status == 1){
|
|
layer.msg(result.msg,{time:1000},function(){
|
|
window.location.reload();
|
|
});
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
// 百家乐选择结果判断和颜色改变
|
|
function toggleon(index){
|
|
// 获取庄、闲、和是否被选中的信息
|
|
var banker = $(".footer-box .radio-box .banker").children("input").is(':checked');
|
|
var player = $(".footer-box .radio-box .player").children("input").is(':checked');
|
|
var tie = $(".footer-box .radio-box .tie").children("input").is(':checked');
|
|
|
|
// 选中庄
|
|
if(banker==true && index == 0){
|
|
$(".footer-box .radio-box .player").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .tie").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .player").removeClass('on');
|
|
$(".footer-box .radio-box .tie").removeClass('on');
|
|
}
|
|
// 选中闲
|
|
else if(player==true && index == 1){
|
|
$(".footer-box .radio-box .banker").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .tie").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .banker").removeClass('on');
|
|
$(".footer-box .radio-box .tie").removeClass('on');
|
|
}
|
|
// 选中和
|
|
else if(tie==true && index == 2){
|
|
$(".footer-box .radio-box .banker").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .player").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .win_six").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .banker").removeClass('on');
|
|
$(".footer-box .radio-box .player").removeClass('on');
|
|
$(".footer-box .radio-box .win_six").removeClass('on');
|
|
}
|
|
|
|
// 重新获取庄、闲、和是否被选中的信息
|
|
var banker = $(".footer-box .radio-box .banker").children("input").is(':checked');
|
|
var player = $(".footer-box .radio-box .player").children("input").is(':checked');
|
|
var tie = $(".footer-box .radio-box .tie").children("input").is(':checked');
|
|
|
|
// 当选中庄对或者闲对时
|
|
if(index == 3 || index == 4){
|
|
// 如果庄、闲或和被选中,庄对或闲对被选中
|
|
if(banker == true || player == true || tie == true){
|
|
var $checked = $(".footer-box .radio-box span").eq(index);
|
|
var checked = $checked.children("input").is(':checked');
|
|
if(checked==true){
|
|
$checked.addClass("on")
|
|
}else{
|
|
$checked.removeClass("on")
|
|
}
|
|
}
|
|
} else if(index == 5){
|
|
if(banker == true || player == true){
|
|
var $checked=$(".footer-box .radio-box span").eq(index);
|
|
var checked=$checked.children("input").is(':checked');
|
|
if(checked==true){
|
|
$checked.addClass("on")
|
|
}else{
|
|
$checked.removeClass("on")
|
|
}
|
|
}
|
|
} else {
|
|
// 当选中的是庄、闲或和时,直接选中
|
|
var $checked=$(".footer-box .radio-box span").eq(index);
|
|
var checked=$checked.children("input").is(':checked');
|
|
if(checked==true){
|
|
$checked.addClass("on")
|
|
}else{
|
|
$checked.removeClass("on")
|
|
}
|
|
}
|
|
// 没有庄、闲或和, 庄对和闲对都取消选中
|
|
if(banker == false && player == false && tie == false){
|
|
$(".footer-box .radio-box span").eq(3).children("input").prop("checked",false);
|
|
$(".footer-box .radio-box span").eq(4).children("input").prop("checked",false);
|
|
$(".footer-box .radio-box span").eq(5).children("input").prop("checked",false);
|
|
$(".footer-box .radio-box span").eq(3).removeClass('on');
|
|
$(".footer-box .radio-box span").eq(4).removeClass('on');
|
|
$(".footer-box .radio-box span").eq(5).removeClass('on');
|
|
}
|
|
}
|
|
$(".footer-box .radio-box span").click(function(){
|
|
var index = $(this).index();
|
|
toggleon(index);
|
|
});
|
|
</script> |