@ -616,8 +616,12 @@
< / tr >
< empty name = "game_ratio[1]" >
< tr class = "bns" >
< td class = "l noticeinfo" > CP流水大于等于 < / td >
< td class = "l noticeinfo" > CP总 流水< / td >
< td class = "r" >
< select name = "instanceof" style = "width: 50px;margin-right: 5px" >
< option value = "1" > ≥< / option >
< option value = "2" > >< / option >
< / select >
< input type = "text" class = "txt table_text_input" name = "game_amount" value = "" placeholder = "" style = "width: 55px" >
< span class = "form_unit" style = "margin: 0 10px" > 分成比例< / span >
< input type = "text" class = "txt table_text_input" name = "game_ratio" value = "" placeholder = "" style = "width: 50px" >
@ -629,8 +633,12 @@
< foreach name = "game_ratio" item = "vo" key = "k" >
< if condition = "$k gt 0" >
< tr class = "bns" >
< td class = "l noticeinfo" > CP流水大于等于 < / td >
< td class = "l noticeinfo" > CP总 流水< / td >
< td class = "r" >
< select name = "instanceof" style = "width: 50px;margin-right: 5px" >
< option value = "1" < if condition = "$vo['instanceof'] eq 1" > selected < / if > >≥< / option >
< option value = "2" < if condition = "$vo['instanceof'] eq 2" > selected < / if > >>< / option >
< / select >
< input type = "text" class = "txt table_text_input" name = "game_amount" value = "{$vo['begin_total_amount']}" placeholder = "" style = "width: 55px" > < span class = "form_unit" style = "margin: 0 10px" > 分成比例< / span >
< input type = "text" class = "txt table_text_input" name = "game_ratio" value = "{$vo['ratio']}" placeholder = "" style = "width: 50px" > < span class = "form_unit" > %< / span >
< if condition = "$k eq 1" >
@ -2238,8 +2246,12 @@
< script >
$(".bnt_add").bind("click",function(){
var a= '< tr class = "bns" data-id = "0" > '+
'< td class = "l noticeinfo" > CP流水大于等于 < / td > ' +
'< td class = "l noticeinfo" > CP总 流水< / td > ' +
'< td class = "r" > '+
'< select name = "instanceof" style = "width: 50px;margin-right: 5px" > '+
'< option value = "1" > ≥< / option > '+
'< option value = "2" > >< / option > '+
'< / select > '+
'< input type = "text" class = "txt table_text_input" name = "game_amount" value = "" placeholder = "" style = "width: 55px" > ' +
'< span class = "form_unit" style = "margin: 0 10px" > 分成比例< / span > '+
'< input type = "text" class = "txt table_text_input" name = "game_ratio" value = "" placeholder = "" style = "width: 50px" > ' +
@ -2254,38 +2266,47 @@
$(document).on('click', '.bnt_remove', function(){
var that = $(this).parents("tr.bns");
var data_id = $(this).attr("data-id");
layer.confirm('你确定要删除本档分成比例吗?', {icon: 3, title:'提示'}, function(index){
layer.close(index);
$.ajax({
//请求方式
type : "POST",
dataType: "json",
url : "{:U('delete_ratio')}",
data : {
data_id :data_id,
game_id:'{$game_id}'
},
//请求成功
success : function(result) {
if(result.result==1){
$(that).remove();
layer.msg(result.desc);
/*setTimeout(function(){
location.reload();
},1500);*/
}else{
layer.msg(result.desc);
if(data_id>0){
layer.confirm('你确定要删除本档分成比例吗?', {icon: 3, title:'提示'}, function(index){
layer.close(index);
$.ajax({
//请求方式
type : "POST",
dataType: "json",
url : "{:U('delete_ratio')}",
data : {
data_id :data_id,
game_id:'{$game_id}'
},
//请求成功
success : function(result) {
if(result.result==1){
$(that).remove();
layer.msg(result.desc);
/*setTimeout(function(){
location.reload();
},1500);*/
}else{
layer.msg(result.desc);
}
},
//请求失败,包含具体的错误信息
error : function(e){
console.log(e.status);
console.log(e.responseText);
}
},
//请求失败,包含具体的错误信息
error : function(e){
console.log(e.status);
console.log(e.responseText);
}
});
});
});
}else{
$(that).remove();
}
});
$(document).on('input propertychange', 'select[name=instanceof]', function(){
var that = $(this).parents("tr.bns");
$(that).find("button[class=bnt_save]").css("display","")
})
$(document).on('input propertychange', 'input[name=game_ratio]', function(){
var that = $(this).parents("tr.bns");
$(that).find("button[class=bnt_save]").css("display","")
@ -2297,11 +2318,11 @@
})
/* $('input[name=game_ratio]').live('input propertychange', function()
{
//获取input 元素,并实时监听用户输入
//逻辑
})*/
/* $('input[name=game_ratio]').live('input propertychange', function()
{
//获取input 元素,并实时监听用户输入
//逻辑
})*/
$(document).on('click', '.bnt_save', function(){
@ -2310,6 +2331,7 @@
var that = $(this).parents("tr.bns");
var total_amount = $(that).find("input[name=game_amount]").val();
var game_ratio = $(that).find("input[name=game_ratio]").val();
var instanceofs = $(that).find("select[name=instanceof]").val();
$.ajax({
//请求方式
type : "POST",
@ -2320,7 +2342,8 @@
data_id :data_id,
total_amount:total_amount,
game_ratio:game_ratio,
game_id:'{$game_id}'
game_id:'{$game_id}',
instanceof:instanceofs
},
//请求成功
success : function(result) {