You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

409 lines
18 KiB
HTML

5 years ago
<extend name="Public/promote_base" />
<block name="css">
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/manager.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<style>
.my_text {
position: relative;
padding: 0 10px;
border: 1px solid #D5D5D5;
border-radius: 5px;
outline: none;
font-size: 14px;
font-family: inherit;
height: 38px;
line-height: 38px;
}
#submit1 {
background: #526782;
border-radius: 5px;
border: none;
color: #FFF;
cursor: pointer;
transition: .8s;
height: 38px;
line-height: 38px;
outline: none;
font-size: 14px;
font-family: inherit;
width: 120px;
}
.del-act {
color: #19ADED;
text-decoration: none;
line-height: 68px;
border-collapse: collapse;
border-spacing: 0;
}
.add-act {
color: #19ADED;
text-decoration: none;
line-height: 68px;
border-collapse: collapse;
border-spacing: 0;
}
</style>
</block>
<block name="body">
<form method="post" enctype="multipart/form-data" id="form1" action="javascript:;">
<div class="page-search normal_list query-recharge-search jssearch">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>测试资源</span><span>测试资源申请></span><span>新增测试账号</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_shenqing.png">
<span class="title_main">新增测试账号</span>
<span class="details">说明:新增测试账号</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<div id="">
<div class="form-group normal_space fr" id='support_quota' style="line-height: 37px;">
</div>
<div class="form-group normal_space fr">
<span id="server_js">
<select id="server_id" name="server_name" class="reselect select_gallery"
style="width:101px">
<option server-id="0" value="0">请选择区服</option>
<volist name=":getServer_name_on($_GET['game_name'],2)" id="vo">
<option data-server-id="{$vo.id}" value="{$vo.server_name}" <if
condition="$_GET['server_name'] eq $vo['server_name']">selected="selected"
</if>>{$vo.server_name}</option>
</volist>
<!-- <option value="{:$_GET['server_name']}"> {:$_GET['server_name']}
</option> -->
</select>
</span>
</div>
<div class="form-group normal_space fr">
<select id="game_id" name="game_name" class="reselect select_gallery">
<option game-id="0" value="0">请选择游戏</option>
<volist name=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.game_name}">{$vo.game_name}</option>
</volist>
</select>
</div>
</div>
</div>
<div class="page-list apply-app_apply-list query-recharge-list">
<div class="trunk-content article">
<div class="tabcon trunk-list">
<table class="table normal_table">
<tr class="odd">
<th>测试账号</th>
<th>密码</th>
<th>角色名称</th>
<th>资源数量</th>
<th>备注</th>
<th>操作</th>
</tr>
<tr class="table_tr" data-val='0'>
<td>
<div class="from-element from-input">
<input type="text" title="账号" placeholder="账号" class="my_text"
name='user_account[]'></div>
</td>
<td>
<div class="from-element from-input">
<input type="text" title="密码" placeholder="密码" class="my_text"
name='user_password[]'>
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" title="角色名称" placeholder="角色名称" class="my_text"
name='role_name[]'>
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" maxlength="19" placeholder="申请元宝或钻石数量" title="申请数量"
class="my_text" name='apply_resource[]'
onkeyup="value=value.replace(/[^\d]/g,'')">
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" placeholder="备注" maxlength="100" class="my_text"
name='apply_remark[]'>
</div>
</td>
<td>
<a href="javascript:;" class="support-act del-act">删除</a>
<a href="javascript:;" class="support-act add-act" style="display: none;">新增</a>
</td>
</tr>
<tr class="table_tr" data-val='1'>
<td>
<div class="from-element from-input">
<input type="text" title="账号" placeholder="账号" class="my_text"
name='user_account[]'></div>
</td>
<td>
<div class="from-element from-input">
<input type="text" title="密码" placeholder="密码" class="my_text"
name='user_password[]'>
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" title="角色名称" placeholder="角色名称" class="my_text"
name='role_name[]'>
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" maxlength="19" placeholder="申请元宝或钻石数量" title="申请数量"
class="my_text" name='apply_resource[]'
onkeyup="value=value.replace(/[^\d]/g,'')">
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" placeholder="备注" maxlength="100" class="my_text"
name='apply_remark[]'>
</div>
</td>
<td>
<a href="javascript:;" class="support-act del-act">删除</a>
<a href="javascript:;" class="support-act add-act" style="display: none;">新增</a>
</td>
</tr>
<tr class="table_tr" data-val='0'>
<td>
<div class="from-element from-input">
<input type="text" title="账号" placeholder="账号" class="my_text"
name='user_account[]'></div>
</td>
<td>
<div class="from-element from-input">
<input type="text" title="密码" placeholder="密码" class="my_text"
name='user_password[]'>
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" title="角色名称" placeholder="角色名称" class="my_text"
name='role_name[]'>
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" maxlength="19" placeholder="申请元宝或钻石数量" title="申请数量"
class="my_text" name='apply_resource[]'
onkeyup="value=value.replace(/[^\d]/g,'')">
</div>
</td>
<td>
<div class="from-element from-input">
<input type="text" placeholder="备注" maxlength="100" class="my_text"
name='apply_remark[]'>
</div>
</td>
<td>
<a href="javascript:;" class="support-act del-act">删除</a>
<a href="javascript:;" class="support-act add-act"
style="display: inline-block;">新增</a>
</td>
</tr>
</table>
<div class="import" style="padding-left:90%;margin-bottom: 15px;">
<input type="submit" class="submit" id='submit1' value="保存" url="{:U('Support/add')}">
</div>
</div>
</div>
</div>
</form>
</block>
<block name="script">
<link rel="stylesheet" type="text/css" href="__CSS__/p_jquery.datetimepicker.css">
<script type="text/javascript" src="__JS__/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript">
$().ready(function () {
$("#pagehtml a").on("click", function (event) {
event.preventDefault();//使a自带的方法失效即无法调整到href中的URL(http://www.baidu.com)
var geturl = $(this).attr('href');
$('#data_form').attr('action', geturl);
$('#data_form').submit();
});
$('#sdate').datetimepicker({
lang: 'ch',
format: 'Y-m-d',
formatDate: 'Y-m-d',
timepicker: false
});
$(".select_gallery").select2();
$('#edate').datetimepicker({
lang: 'ch',
format: 'Y-m-d',
formatDate: 'Y-m-d',
timepicker: false
});
});
</script>
<script type="text/javascript">
//去除空值
function serializeNotNull(serStr) {
return serStr.split("&").filter(str => !str.endsWith("=")).join("&");
}
var gload_game_id = 0;
var gload_server_id = 0;
$("#submit1").click(function () {
var game_id = $('#game_id').val();
var server_id = $('#server_id').val();
if (game_id == 0 || game_id == '') {
layer.msg('请选择游戏');
return false;
}
if (server_id == 0 || server_id == '') {
layer.msg('请选择区服');
return false;
}
var data = $("form").serialize();
var g_game_id = $("#game_id option:selected").attr('game-id');
var g_server_id = $("#server_id option:selected").attr('server-id');
data = "game_id="+g_game_id+"&server_id="+g_server_id+"&"+data;
$.ajax({
url: "{:U('add')}",
type: "post",
data: data,
dataType: 'json',
success: function (data) {
if (data.status == 0) {
layer.msg(data.msg);
} else {
layer.msg('申请成功');
setTimeout(function () {
window.location.href = "{:U('index')}";
}, 1500);
}
}
})
});
$("#game_id").change(function () {
$.ajax({
url: "{:U('getServer')}",
type: "post",
data: { game_id: $("#game_id option:selected").attr('game-id'), status: 2 },
dataType: 'json',
success: function (data) {
console.log();
str = "<option value=''>请选择区服</option>";
var support_quota = "<span>单角色可申请上限0</span>";
for (var i in data) {
str += "<option server-id="+data[i].id+" value='" + data[i].server_name + "'>" + data[i].server_name + "</option>"
var support_quota = "<span>单角色可申请上限:" + data[i].support_quota + "</span>"
}
$('#support_quota').html(support_quota);
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
})
$("#server_js").click(function (event) {
var game_id = $("#game_id").val();
if (game_id == 0) {
layer.msg('请先选择游戏');
}
});
$('.table').on("click", '.add-act', function (event) {
$(".table").find("tr:last").find('td:last').find('a:last').css("display", 'none');
var rowNum = $(".table tr").size() - 1;
var html = "<tr class='table_tr' data-val='" + rowNum + "'><td><div class='from-element from-input'><input type='text' class='my_text' title='账号' placeholder='账号' name='user_account[]' ></div></td><td><div class='from-element from-input'><input type='text' title='密码' class='my_text' placeholder='密码' name='user_password[]'></div></td><td><div class='from-element from-input'><input type='text' title='角色名称' placeholder='角色名称' class='my_text' name='role_name[]'></div></td><td><div class='from-element from-input'><input type='text' maxlength='19' placeholder='申请元宝或钻石数量' title='申请数量' class='my_text' name='support_num[]' onkeyup = " + '"' + "value=value.replace(/[^\\d]/g,'')" + '"' + "></div></td><td><div class='from-element from-input'><input type='text' placeholder='备注' class='my_text' maxlength='100' name='remarks[]'></div></td><td><a href='javascript:;' class='support-act del-act'>删除</a>&nbsp<a href='javascript:;' class='support-act add-act' style='display: inline-block;' >新增</a></td></tr>";
$(".table").append(html);
});
$('.table').on("click", '.del-act', function (event) {
var rowNum = $(".table tr").size() - 1;
if (rowNum > 1) {
$(this).closest("tr").remove();
$(".table").find("tr:last").find('td:last').find('a:last').css("display", ' inline-block');
}
});
</script>
</block>