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

master
zhengchanglong 5 years ago
parent 5ac23b6a5b
commit b34eec98ee

@ -634,7 +634,7 @@
<td class="r">
<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之间的数字">
<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>
</td>
</tr>
@ -646,7 +646,7 @@
<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">
<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>
</tr>
<else />
@ -663,7 +663,7 @@
<else/>
<button type="button" class="bnt_remove" data-id="{$vo['id']}"></button>
</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>
</tr>
</if>
@ -2269,7 +2269,7 @@
'<input type="text" class="txt table_text_input" name="game_ratio" value="" placeholder="" style="width: 50px">' +
'<span class="form_unit">% </span>' +
'<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>'+
'</tr>';
$(".bns:last").after(a);
@ -2294,9 +2294,9 @@
if(result.result==1){
$(that).remove();
layer.msg(result.desc);
setTimeout(function(){
/*setTimeout(function(){
location.reload();
},1500);
},1500);*/
}else{
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(){
var data_id = $(this).attr("data-id");
var data_type =$(this).attr("data-type");
@ -2332,9 +2350,10 @@
success : function(result) {
if(result.result==1){
layer.msg(result.desc);
setTimeout(function(){
$(that).find("button[class=bnt_save]").css("display","none")
/*setTimeout(function(){
location.reload();
},1500);
},1500);*/
}else{
layer.msg(result.desc);
}

Loading…
Cancel
Save