游戏分成比例设定体验优化

master
zhengchanglong 5 years ago
parent 5ac23b6a5b
commit b34eec98ee

@ -634,7 +634,7 @@
<td class="r"> <td class="r">
<input type="hidden" class="txt table_text_input" name="game_amount" value="0" > <input type="hidden" class="txt table_text_input" name="game_amount" value="0" >
<input type="text" class="txt table_text_input" name="game_ratio" value="{$game_ratio[0]['ratio']}" placeholder="输入0-100之间的数字"> <input type="text" class="txt table_text_input" name="game_ratio" value="{$game_ratio[0]['ratio']}" placeholder="输入0-100之间的数字">
<span class="form_unit">% <button type="button" class="bnt_save" data-id ="{$game_ratio[0]['id']}" data-type="initial"></button> </span> <span class="form_unit">% <button type="button" class="bnt_save" data-id ="{$game_ratio[0]['id']}" data-type="initial" style="display: none"></button> </span>
<span class="notice-text">CP游戏分成比例</span> <span class="notice-text">CP游戏分成比例</span>
</td> </td>
</tr> </tr>
@ -646,7 +646,7 @@
<span class="form_unit" style="margin: 0 10px">分成比例</span> <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"> <input type="text" class="txt table_text_input" name="game_ratio" value="" placeholder="" style="width: 50px">
<span class="form_unit">% </span> <span class="form_unit">% </span>
<button type="button" class="bnt_add"></button><button type="button" class="bnt_save" data-id="0" data-type="ladder"></button> <button type="button" class="bnt_add"></button><button type="button" class="bnt_save" data-id="0" data-type="ladder" style="display: none"></button>
</td> </td>
</tr> </tr>
<else /> <else />
@ -663,7 +663,7 @@
<else/> <else/>
<button type="button" class="bnt_remove" data-id="{$vo['id']}"></button> <button type="button" class="bnt_remove" data-id="{$vo['id']}"></button>
</if> </if>
<button type="button" class="bnt_save" data-id="{$vo['id']}" data-type="ladder"></button> <button type="button" class="bnt_save" data-id="{$vo['id']}" data-type="ladder" style="display: none"></button>
</td> </td>
</tr> </tr>
</if> </if>
@ -2269,7 +2269,7 @@
'<input type="text" class="txt table_text_input" name="game_ratio" value="" placeholder="" style="width: 50px">' + '<input type="text" class="txt table_text_input" name="game_ratio" value="" placeholder="" style="width: 50px">' +
'<span class="form_unit">% </span>' + '<span class="form_unit">% </span>' +
'<button type="button" class="bnt_remove" data-id="0"></button>' + '<button type="button" class="bnt_remove" data-id="0"></button>' +
'<button type="button" class="bnt_save" data-id="0" data-type="ladder"></button>'+ '<button type="button" class="bnt_save" data-id="0" data-type="ladder" style="display: none"></button>'+
'</td>'+ '</td>'+
'</tr>'; '</tr>';
$(".bns:last").after(a); $(".bns:last").after(a);
@ -2294,9 +2294,9 @@
if(result.result==1){ if(result.result==1){
$(that).remove(); $(that).remove();
layer.msg(result.desc); layer.msg(result.desc);
setTimeout(function(){ /*setTimeout(function(){
location.reload(); location.reload();
},1500); },1500);*/
}else{ }else{
layer.msg(result.desc); layer.msg(result.desc);
} }
@ -2310,6 +2310,24 @@
}); });
}); });
$(document).on('input propertychange', 'input[name=game_ratio]', function(){
var that = $(this).parents("tr.bns");
$(that).find("button[class=bnt_save]").css("display","")
})
$(document).on('input propertychange', 'input[name=game_amount]', function(){
var that = $(this).parents("tr.bns");
$(that).find("button[class=bnt_save]").css("display","")
})
/* $('input[name=game_ratio]').live('input propertychange', function()
{
//获取input 元素,并实时监听用户输入
//逻辑
})*/
$(document).on('click', '.bnt_save', function(){ $(document).on('click', '.bnt_save', function(){
var data_id = $(this).attr("data-id"); var data_id = $(this).attr("data-id");
var data_type =$(this).attr("data-type"); var data_type =$(this).attr("data-type");
@ -2332,9 +2350,10 @@
success : function(result) { success : function(result) {
if(result.result==1){ if(result.result==1){
layer.msg(result.desc); layer.msg(result.desc);
setTimeout(function(){ $(that).find("button[class=bnt_save]").css("display","none")
/*setTimeout(function(){
location.reload(); location.reload();
},1500); },1500);*/
}else{ }else{
layer.msg(result.desc); layer.msg(result.desc);
} }

Loading…
Cancel
Save