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.

642 lines
22 KiB
HTML

<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
</style>
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a <if condition="(I('type') eq 1) or (I('type') eq '') "> class="tabchose" </if> href="{:U('supportNumberList',array('type'=>1))}">资源管理</a>
</div>
<h3 class="page_title">资源管理</h3>
<if condition="(I('type',1) eq 1) ">
<p class="description_text">说明:此功能是资源管理的功能</p>
<else/>
<p class="description_text">说明:此功是查看并管理混服申请的功能</p>
</if>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list" style="margin-bottom:15px">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
<option value="">游戏名称</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 class="input-list input-list-server search_label_rehab">
<select id="server_id" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
<if condition="$_GET['server_name'] neq ''"><option value="{$_GET['server_name']}">{$_GET['server_name']}</option></if>
</select>
</div>
<div class="input-list">
<input type="text" name="role_name" placeholder="角色名称" class="" value="{:I('role_name')}"/>&nbsp;
</div>
<div class="input-list">
<input type="text" name="user_account" placeholder="测试账号" class="" value="{:I('user_account')}"/>&nbsp;
</div>
<!-- <div class="input-list">-->
<!-- <input type="text" name="promote_name" placeholder="所属推广员" class="" value="{:I('promote_name')}"/>&nbsp;-->
<!-- </div>-->
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
<option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>
<option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>
<option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>
<option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>
</select>
-
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">
<option value="">请选择推广员</option>
</select>
</div>
</empty>
<input type="hidden" name="" value="" class="sortBy">
<input type="hidden" name="type" value="{$_GET['type']}">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('TestResource/supportNumberList','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
<div class="input-list button_list" style="margin-left: 120px">
<div class="tools">
<empty name="show_status">
<a class="fr" id="batch_unfreeze"><span class="button_icon button_icon9"></span>批量开启</a>
<!-- <a class="fr" href="{:U('add?model='.$model['id'])}"><span class="button_icon button_icon1"></span>新增测试账号</a>-->
<a class="fl" id="batch_freeze"><span class="button_icon button_icon5 "></span>批量锁定</a>
</empty>
</div>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<empty name="show_status">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>产品名称</th>
<th>区服</th>
<th>测试账号</th>
<th>所属推广员</th>
<th>角色名称</th>
<th>设备信息</th>
<th>状态</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($data)">
<tr>
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "data">
<volist name="data" id="s">
<tr data-id="{$s.user_id}">
<td><input class="ids" type="checkbox" value="{$s['id']}" name="ids[]" ></td>
<td>{$s.game_name}</td>
<td>{$s.server_name}</td>
<td>{$s.user_account}</td>
<td>{$s.promote_account}</td>
<td>{$s.role_name}</td>
<td>
<if condition="$s['device_number'] eq ''">尚未登录,无设备号
<else/>
<!--<if condition="$is_admin eq true ">
{$s.device_number}
<else />
{$s.device_number|encryptStr}
</if>-->
{$s.device_number}
</if>
</td>
<td>
<if condition="$s['check_status'] eq 0">冻结
<else/>启用
</if>
</td>
<td>{$s.create_time}</td>
<td>
<if condition="$s['check_status'] eq 1">
<a href="javascript:;" class="froze-btn editbtn">冻结</a>
<else/>
<a href="javascript:;" class="unfroze-btn editbtn">启用</a>
<!-- <a class="confirm ajax-get" href="{:U('TestResource/unfreezeSupport?id='.$s['id'])}">启用</a>-->
</if>
<a href="javascript:;" data-id="{$s.user_id}" class="changePassward-btn editbtn">重置密码</a>
</td>
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</empty>
</div>
<div class="page">
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Promote/lists/type/{:I('type',1)}">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('testResource/supportNumberList')}');
$(".select_gallery").select2();
$(function(){
$('.froze-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
layer.confirm('是否确认冻结帐号?', {icon: 3, title:'提示',skin:'textColor'}, function(index){
$.ajax({
url: "{:U('TestResource/freezeSupport')}",
data: {support_id: id},
type: 'post',
dataType: 'json',
success: function(response) {
layer.msg(response.msg, {time: 1000,skin:'msgClolor'}, function() {
window.location.href = window.location.href
})
}
})
})
}
})
var promote_id = "{:I('promote_id')}";
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevelResource')}",
type:"get",
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
});
$("#promote_level").change();
$('#batch_freeze').click(function () {
var ids = $('.ids:checked');
if (ids.length > 0) {
var str = new Array();
ids.each(function () {
str.push($(this).val());
});
param = str.join(',');
} else {
layer.msg('请选择要操作的数据',{skin:'textColor'});
return false;
}
var url = "{:U('batchFreeze','','')}";
layer.confirm('是否冻结选中推广员下的资源账号?', {
title:'冻结资源账号',
icon:3,
skin:'textColor',
btn: ['冻结','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: url,
data: {id:param,status:0},
dataType: 'json',
async: false,
success:function(data){
if(data.status==1){
layer.msg(data.msg,{time: 1000,skin:'msgClolor'});
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
// window.location.href = url;
}, function(){
layer.close();
});
});
$('#batch_unfreeze').click(function () {
var ids = $('.ids:checked');
if (ids.length > 0) {
var str = new Array();
ids.each(function () {
str.push($(this).val());
});
param = str.join(',');
} else {
layer.msg('请选择要操作的数据',{skin:'textColor'});
return false;
}
var url = "{:U('batchFreeze','','')}";
layer.confirm('是否冻结选中推广员下的资源账号?', {
title:'冻结资源账号',
icon:3,
skin:'textColor',
btn: ['冻结','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: url,
data: {id:param,status:1},
dataType: 'json',
async: false,
success:function(data){
if(data.status==1){
layer.msg(data.msg,{time: 1000,skin:'msgClolor'});
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}, function(){
layer.close();
});
});
$('.unfroze-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
layer.confirm('是否确认启用帐号?', {icon: 3, title:'提示',skin:'textColor'}, function(index){
$.ajax({
url: "{:U('TestResource/unfreezeSupport')}",
data: {support_id: id},
type: 'post',
dataType: 'json',
success: function(response) {
layer.msg(response.msg, {time: 1000,skin:'msgClolor'}, function() {
window.location.href = window.location.href
})
}
})
})
}
})
$('.changePassward-btn').on({
click: function() {
var id = $(this).attr('data-id')
console.log(id);
layer.confirm('是否确认重置账号密码?', {icon: 3, title:'提示',skin:'textColor'}, function(index){
$.ajax({
url: "{:U('TestResource/rechangePassward')}",
data: {support_id: id},
type: 'post',
dataType: 'json',
success: function(response) {
console.log(response)
layer.confirm(response.msg, {icon: 3, title:'提示',skin:'textColor'}, function() {
window.location.href = window.location.href
})
}
})
})
}
})
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
$("#admin").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#admin #i_list_id').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$(this).closest('.drop-down').find('#i_list_idh').val(val);
});
$("#admin #i_list_li").find("a").each(function(){
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
$(this).closest('.drop-down').find("#i_list_id").val(text);
$(this).closest('.drop-down').find('#i_list_idh').val(text);
})
});
//下拉内容框
$(".drop-down2").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
/* 状态搜索子菜单 */
/*渠道删除*/
$('.delete').click(function(){
var id = $(this).attr('data-id');
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
title:'确定要删除该渠道?',
icon:0,
btn: ['删除','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: "{:U('del_promote')}",
dataType: 'json',
async: false,
data: {id:id},
success:function(data){
if(data.status==1){
layer.msg(data.msg);
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}, function(){
layer.close();
});
})
})
</script>
<script type="text/javascript">
//点击字母按照条件按钮筛选
$(".pro_promot_select_list_con").click(function(){
//选中高亮样式
$(this).addClass('active');
$(this).siblings().removeClass('active');
var that = $(this);
var index = $(this).attr("data-index");
$("#game_list li").each(function(index,ele){
var short = $(this).attr('data-short');
$(this).show();
if(that.attr('data-index')){
if(that.attr('data-index')!=short.charAt(0)){
$(this).hide();
}
}
})
});
//打开弹窗
$(".ajax-view").click(function(){
//获取游戏列表
var url = "{:U('Promote/getPromoteGame')}";
var id = $(this).attr('data-id');
$.post(url,{id:id},function(res){
if(res.code==1){
$(".pro_promot_select_list a").eq(0).addClass('active');
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
var game_list = res.data.game_list;
var promote_info = res.data.promote_info;
var lis = [];
$.each(game_list,function(index,ele){
if(ele.game_name.length>6){
ele.game_name = ele.game_name .substring(0,6)+"..."
}
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
if(promote_info['game_ids']==''){
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
}else{
if(promote_info['game_ids'].indexOf(ele.id)>-1){
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
}else{
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
}
}
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
lis.push('</li>');
});
$("#game_list").html(lis.join(''));
$(".pro_promot_number").text(res.data.promote_info.account);
$("#se_promote_id").val(res.data.promote_info.id);
$(".pro_promot").css("display","block");
jsgameid();
}else{
alert('请求失败');
}
});
});
//保存修改
$(".pro_promot_btn_confirm").click(function(){
$("#ajaxForm").ajaxSubmit(function(res){
layer.msg(res.msg);
$(".pro_promot").hide();
});
return false;
});
//关闭弹窗
$(".pro_promot_close").click(function(){
$(".pro_promot").css("display","none");
});
//取消修改
$(".pro_promot_btn_cancel").click(function(){
$(".pro_promot").css("display","none");
layer.msg('修改已取消');
});
$(".jsgamecheckall").click(function(){
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
});
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
function jsgameid(){
$(".jsgameid").click(function(){
var option = $(this).closest('ul').find(".jsgameid"),
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
option.each(function(i){
if(!this.checked){
checkall.prop("checked", false);
return false;
}else{
checkall.prop("checked", true);
}
});
});
}
$("#game_id").change(function(){
$.ajax({
url:"{:U('Ajax/getServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
});
$('#batch_add').click(function () {
var ids = $('.ids:checked');
if (ids.length > 0) {
var str = new Array();
ids.each(function () {
str.push($(this).val());
});
param = str.join(',');
} else {
layer.msg('请选择要操作的数据',{skin:'textColor'});
return false;
}
var url = "{:U('apply','','')}" + '/id/' + param;
window.location.href = url;
});
</script>
<style>
.textColor .layui-layer-content{color: #000000;}
.msgClolor .layui-layer-content{color: #ffffff;background:#000; opacity: 0.8;text-align: center}
</style>
</block>