287 lines
14 KiB
HTML
287 lines
14 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">
|
|
<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>
|
|
<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; position: relative;top:4px; 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: 7px; left: 10px; font-size: 12px; }
|
|
.bet-box .chip-box{ position: relative; height: 102px; 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); }
|
|
.section-form{
|
|
box-sizing:border-box;
|
|
-moz-box-sizing:border-box; /* Firefox */
|
|
-webkit-box-sizing:border-box; /* Safari */
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="bet-box table-box 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>
|
|
<input class="select-box" id="result" value="{$number_tab.result_en}" readonly>
|
|
</div>
|
|
</div>
|
|
<?php $num = 0; for($i=0; $i<4; $i++): ?>
|
|
<div class="list clearfix">
|
|
<?php for($j=0; $j<6; $j++): $num++ ?>
|
|
<div class="item box-sizing chip">
|
|
<div class="absolute-box">
|
|
<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>
|
|
</div>
|
|
<button class="clear">清除</button>
|
|
<div class="allchip">总金额:<span style="color:#EBAF59">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 endfor; ?>
|
|
</div>
|
|
<?php endfor; ?>
|
|
<div class="footer-box">
|
|
<div class="radio-box result_dt">
|
|
<button class="submit fr" style=" margin:13px 30px;">提交结果</button>
|
|
<span class="item fr tie <?php if($number_tab['result'] == 3) echo "on"; ?>">和<input type="checkbox" name="checkbox" id="tie" value="3" <?php if($number_tab['result'] == 3) echo 'checked="checked"'; ?>></span>
|
|
<span class="item fr player <?php if($number_tab['result'] == 2) echo "on"; ?>">虎<input type="checkbox" name="checkbox" id="player" value="2" <?php if($number_tab['result'] == 2) echo 'checked="checked"'; ?>></span>
|
|
<span class="item fr banker <?php if($number_tab['result'] == 1) echo "on"; ?>">龙<input type="checkbox" name="checkbox" id="banker" value="1" <?php if($number_tab['result'] == 1) echo 'checked="checked"'; ?>></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</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 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());
|
|
if (user_name != "" && user_name != undefined) {
|
|
var data = new Array;
|
|
// 下注额
|
|
if (bet_chip.banker_amount != "" || bet_chip.player_amount != "" || bet_chip.tie_amount != "") {
|
|
data.push(bet_chip)
|
|
}
|
|
if(data.length > 0){
|
|
chip.push(data);
|
|
}
|
|
}
|
|
});
|
|
|
|
/* 获取结果信息 */
|
|
var result = $(".result_dt").find('input:checked').val();
|
|
if(result.length <= 0){
|
|
layer.msg('请选择结果!');
|
|
return false;
|
|
}
|
|
/* 拼装所有要发送的数据, 下注,写入数据库 */
|
|
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 = result;
|
|
|
|
var chip_url = "/waybill/dt_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 == 2){
|
|
$(".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 == 0){
|
|
$(".footer-box .radio-box .banker").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .player").children("input").prop("checked",false);
|
|
$(".footer-box .radio-box .banker").removeClass('on');
|
|
$(".footer-box .radio-box .player").removeClass('on');
|
|
}
|
|
|
|
// 当选中的是庄、闲或和时,直接选中
|
|
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")
|
|
}
|
|
}
|
|
$(".footer-box .radio-box span").click(function(){
|
|
var index = $(this).index() - 1;
|
|
toggleon(index);
|
|
});
|
|
</script> |