外团推广功能提交

master
zhengyongxing 4 years ago
parent 3855d8d3a9
commit 9c49d8bedc

@ -1448,6 +1448,26 @@ class MarketPercentageController extends ThinkController
}
public function delcompanybelonggame() {
$id = $_REQUEST["id"];
if (!$id) {
$this->ajaxReturn(['msg'=>"参数传递错误","status"=>0]);
}
$is_del = M("company_belong_game","tab_")
->where(['id'=>$id])
->delete();
if ($is_del) {
$this->ajaxReturn(['msg'=>"删除成功","status"=>1]);
} else {
$this->ajaxReturn(['msg'=>"删除失败","status"=>0]);
}
}
public function showGame() {
$data = $_REQUEST;

@ -33,6 +33,7 @@
<th>游戏类型</th>
<th>原游戏名称</th>
<th>现游戏名称</th>
<th>结算流水类型</th>
<th>生效时间</th>
<th colspan="2">比例分成</th>
</tr>
@ -54,9 +55,11 @@
<td rowspan="{$data.row}">{$data.original_package_name}</td>
<td rowspan="{$data.row}">{$data.relation_game_name}</td>
<notempty name="data['valid'][0]">
<td rowspan="{$data['sec_row'][0]}">{$data['turnover_types'][0]}</td>
<td rowspan="{$data['sec_row'][0]}">{$data['valid'][0]}</td>
<else />
<td>--</td>
<td>--</td>
</notempty>
<notempty name="data['turnover_ratios'][0][0]">
<td >{$data['turnover_ratios'][0][0]['name']|default="--"}</td>
@ -71,14 +74,10 @@
<foreach name="data['valid']" item="valid" key="keys">
<if condition="$keys gt 0">
<tr>
<td rowspan="{$data['sec_row'][$keys]}">{$data['turnover_types'][$keys]}</td>
<td rowspan="{$data['sec_row'][$keys]}">{$valid|default="--"}</td>
<td>{$data['turnover_ratios'][$keys][0]['name']|default="--"}</td>
<td>{$data['turnover_ratios'][$keys][0]['ratio']|showPercent}</td>
<td rowspan="{$data['sec_row'][$keys]}">
<foreach name="data['oplist'][$keys]" item="vo" >
{$vo}
</foreach>
</td>
</tr>
<foreach name="data['turnover_ratios'][$keys]" item="game_ratio" key="gamekey">
<if condition="$gamekey gt 0">

@ -31,8 +31,9 @@
<th>现包名</th>
<th>原包名</th>
<th>公司类型</th>
<th>结算流水类型</th>
<th colspan="2">比例分成</th>
<th>时间</th>
<th>生效时间</th>
<th>操作人</th>
</tr>
</thead>
@ -50,26 +51,47 @@
<td rowspan="{$data.row}">{$data.relation_game_name}</td>
<td rowspan="{$data.row}">{$data.original_package_name}</td>
<td rowspan="{$data.row}">{$data.company_belong}</td>
<notempty name="data['turnover_ratio'][0]">
<td>{$data['turnover_ratio'][0]['name']|default="--"}</td>
<td>{$data['turnover_ratio'][0]['ratio']|showPercent}</td>
<else />
<notempty name="data['turnover_ratios'][0][0]">
<td rowspan="{$data['sec_row'][0]}">{$data['turnover_types'][0]|default="--"}</td>
<td >{$data['turnover_ratios'][0][0]['name']|default="--"}</td>
<td >{$data['turnover_ratios'][0][0]['ratio']|showPercent}</td>
<td rowspan="{$data['sec_row'][0]}">{$data['valid'][0]|default="--"}</td>
<else />
<td>--</td>
<td>--</td>
</notempty>
<td rowspan="{$data.row}">{$data.create_time}</td>
<td>--</td>
<td>--</td>
</notempty>
<td rowspan="{$data.row}">{$data.admin_name}</td>
</tr>
<if condition="$data['row'] gt 1">
<foreach name="data['turnover_ratio']" item="game_ratio" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game_ratio['name']|default="--"}</td>
<td>{$game_ratio['ratio']|showPercent}</td>
</tr>
</if>
</foreach>
</if>
<foreach name="data['valid']" item="valid" key="keys">
<if condition="$keys gt 0">
<tr>
<td rowspan="{$data['sec_row'][$keys]}">{$data['turnover_types'][$keys]|default="无"}</td>
<td>{$data['turnover_ratios'][$keys][0]['name']|default="--"}</td>
<td>{$data['turnover_ratios'][$keys][0]['ratio']|showPercent}</td>
<td rowspan="{$data['sec_row'][$keys]}">{$valid|default="--"}</td>
</tr>
<foreach name="data['turnover_ratios'][$keys]" item="game_ratio" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game_ratio['name']|default="--"}</td>
<td>{$game_ratio['ratio']|showPercent}</td>
</tr>
</if>
</foreach>
<else/>
<foreach name="data['turnover_ratios'][$keys]" item="game_ratio" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game_ratio['name']|default="--"}</td>
<td>{$game_ratio['ratio']|showPercent}</td>
</tr>
</if>
</foreach>
</if>
</foreach>
</volist>
</if>
</tbody>

@ -0,0 +1,411 @@
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script src="__STATIC__/jquery.form.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<style>
.tabcon1711 input.time {
width: 150px;
}
#form .txt_area {
width: 300px;
height: 150px;
}
.tabcon1711 .form_unit {
margin-left: 2px;
}
.tabcon1711 .mustmark {
margin-left:-7px;
}
.list-ratio {
display: table;
}
.list-ratio .li-ratio {
display: flex;
margin-bottom: 20px;
align-items: center;
}
.list-ratio .li-ratio .turnover, .list-ratio .li-ratio .turnover-ratio {
position: relative;
}
.list-ratio .li-ratio .turnover span, .list-ratio .li-ratio .turnover-ratio .error-message {
color: red;
position: absolute;
left: 0;
top: 30px;
white-space: nowrap;
display: none;
}
.iconfont-btn {
cursor: pointer;
}
.iconfont-style {
font-size: 18px;
color: #fff;
border-radius: 4px;
border: 0;
padding: 5px;
margin-left: 10px;
}
.iconfont-selected {
background-color: #0A9AF2;
}
.iconfont-selected:hover {
background-color: #03a9f4;
}
.iconfont-unselected {
background-color: #999;
}
.iconfont-unselected:hover {
background-color: #ababab;
}
input[type=number]{
padding: 4px 6px;
font-size: 12px;
line-height: 20px;
color: #555;
vertical-align: middle;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #fff;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-moz-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">特殊比例申请</h3>
<!-- <p class="description_text">说明:此功是创建推广员时所需填写信息</p>-->
</div>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('addcompanybelonggame')}" method="post" class="form-horizontal">
<!-- 基础文档模型 -->
<div id="tab1" class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l"><i class="mustmark">*</i>生效期限:</td>
<td class="r table_radio">
<div style="float: left;">
<input type="text" class="txt time" name="begin_time" id="begin_time" placeholder="开始时间" value="">
-
<input type="text" class="txt time" name="end_time" id="end_time" placeholder="结束时间" value="">
</div>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>游戏:</td>
<td class="r">
<a class="ajax-view" data-id="{$data.id}">选择游戏</a>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>已申请游戏:</td>
<td class="r promote_id" id="game_name">
</td>
</tr>
</tbody>
</table>
</div>
<div class="form-item cf">
<input style="display: none" value="" name="game_ids" class="show_game_ids">
<button class="submit_btn mlspacing" id="submit" type="submit" target-form="form-horizontal">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</form>
<div class="pro_promot" style="display:none">
<form action="{:U('MarketPercentage/showGame')}" id="ajaxForm" method="post" />
<input type="hidden" name="promote_id" id="se_promote_id" value="" />
<div class="pro_promot_main">
<div class="pro_promot_title">
<div class="fl pro_promot_title_text">
<div class="fl pro_promot_title_bigtext"> 可申请游戏</div> 选中的游戏将在对应的推广员后台进行展示,推广员可进行游戏申请</div>
<div class="pro_promot_close fr"><img src="__IMG__/icon_close.png"></div>
</div>
<div class="pro_promot_con">
<!-- <div class="pro_promot_account">推广员账号:<span class="pro_promot_number"></span></div>-->
<div class="pro_promot_select">
<div class="pro_promot_select_title fl">选择游戏:</div>
<div class="pro_promot_select_list fl">
<a class="pro_promot_select_list_con fl active pro_promot_all pro_promot_mr20">全部 </a>
<a class="pro_promot_select_list_con fl" data-index="A">A</a>
<a class="pro_promot_select_list_con fl" data-index="B">B</a>
<a class="pro_promot_select_list_con fl" data-index="C">C</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="D">D</a>
<a class="pro_promot_select_list_con fl" data-index="E">E</a>
<a class="pro_promot_select_list_con fl" data-index="F">F</a>
<a class="pro_promot_select_list_con fl" data-index="G">G</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="H">H</a>
<a class="pro_promot_select_list_con fl" data-index="I">I</a>
<a class="pro_promot_select_list_con fl" data-index="J">J</a>
<a class="pro_promot_select_list_con fl" data-index="K">K</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="L">L</a>
<a class="pro_promot_select_list_con fl" data-index="M">M</a>
<a class="pro_promot_select_list_con fl" data-index="N">N</a>
<a class="pro_promot_select_list_con fl" data-index="O">O</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="P">P</a>
<a class="pro_promot_select_list_con fl" data-index="Q">Q</a>
<a class="pro_promot_select_list_con fl" data-index="R">R</a>
<a class="pro_promot_select_list_con fl" data-index="S">S</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="T">T</a>
<a class="pro_promot_select_list_con fl" data-index="U">U</a>
<a class="pro_promot_select_list_con fl" data-index="V">V</a>
<a class="pro_promot_select_list_con fl" data-index="W">W</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="X">X</a>
<a class="pro_promot_select_list_con fl" data-index="Y">Y</a>
<a class="pro_promot_select_list_con fl" data-index="Z">Z</a>
</div>
</div>
<div class="clear"></div>
<div class="pro_promot_game">
<div class="jsgamecheckallbox z_clearfix" >
<label class="custom-label">
<input type="checkbox" class="form_control jsgamecheckall" >
<i class="label_icon"></i>
<span class="label_text">全选</span></label>
</div>
<ul id="game_list" class="z_clearfix game_list" style="clear: both;">
</ul>
</div>
<div class="clear"></div>
<div class="pro_promot_btn">
<div class="fl pro_promot_btn_confirm">确定</div>
<div class="fr pro_promot_btn_cancel">取消</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script src="__STATIC__/czinputcheck.js?v=1.29" type="text/javascript"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('index')}");
$(".select_gallery").select2();
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#submit').click(function (e) {
//查看是否报错
var target = $('#form').get(0).action;
var query = $('#form').serialize();
var that = this;
$(that).addClass('disabled').attr('autocomplete','off').prop('disabled',true);
$.post(target,query).success(function(data){
if(data.status == 1) {
layer.msg(data.msg);
setTimeout(function(){
window.location.href = "{:U('MarketPercentage/companybelonggame')}";
},2000);
} else {
layer.msg(data.msg);
$(that).addClass('disabled').attr('autocomplete','on').prop('disabled',false);
}
});
});
showTab();
var game_data = [];
var push_data = [];
$('#relation_game_id').change(function (e) {
var original_package_name = $('#relation_game_id option:selected').data("original");
if(original_package_name == ''){
original_package_name = '未配置原包名'
}
$("#original_package_name").html(original_package_name);
});
//点击字母按照条件按钮筛选
$(".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');
var checked = 'checked';
$.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 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(game_data.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{
$(".jsgamecheckall").attr('checked',false);
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
checked = '';
}
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>');
});
$(".jsgamecheckall").attr('checked',checked);
$("#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{
var tip_msg = res.info ? res.info : '操作失败';
layer.msg(tip_msg);
}
});
});
//保存修改
$(".pro_promot_btn_confirm").click(function(){
$("#ajaxForm").ajaxSubmit(function(res){
if (res.status == 1) {
$("#game_name").empty();
layer.msg(res.msg);
var data = res.data;
var span = "";
for (var key in data) {
span += "<span style='margin-left: 15px'>"+data[key]['relation_game_name']+"</span>";
if ((parseInt(key)+1)%5 == 0) {
span += "<br>";
}
game_data.push(data[key]['relation_game_id']);
push_data.push(data[key]['relation_game_id']);
}
// push_data = JSON.stringify(push_data);
$(".show_game_ids").val(push_data);
$("#game_name").append(span);
$(".pro_promot").hide();
} else {
layer.msg(res.msg);
}
});
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);
}
});
});
}
});
</script>
</block>

@ -0,0 +1,272 @@
<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>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<link rel="stylesheet" href="__CSS__/promote.css" type="text/css"/>
<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}
.textarea-style {
width: 195px;
height: 150px;
padding-left: 5px;
}
.mustmark {
color: #FF0000;
font-style: normal;
margin: 0 3px;
margin-left:-7px
}
tr{
border-bottom: 1px solid #e6e6e6;
}
.data_list table td{
line-height: 2;
}
</style>
<div class="cf top_nav_list">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">外团推广游戏</h3>
<p class="description_text">说明:外团可推广游戏数据</p>
</div>
<div class="fl button_list">
<div class="tools">
<a class=" " href="{:U('addcompanybelonggame')}"><span class="button_icon button_icon1"></span>新增</a>
</div>
</div>
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="relation_game_id" name="relation_game_id" class="select_gallery" >
<option value="">现包名</option>
<volist name="gameList" id="vo">
<option value="{$vo.relation_game_id}" <if condition="$vo.relation_game_id eq I('relation_game_id')">selected</if> >{$vo.relation_game_name}</option>
</volist>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="生效时间开始" />
&nbsp;-&nbsp;
<div class="input-append date" style="display:inline-block">
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="生效时间结束" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('MarketPercentage/companybelonggame','model='.$model['name'] .'&row='.I('row') . '&group=' . $group,false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>生效时间</th>
<th>原包名</th>
<th>现包名</th>
<th>游戏类型</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else/>
<volist name="data" id="data">
<tr>
<td rowspan="{$data.row}">{$data.begin_time}-{$data.end_time}</td>
<td>{$data['game_data']['0']['original_package_name']|default="--"}</td>
<td>{$data['game_data']['0']['relation_game_name']|default="--"}</td>
<td>{$data['game_data']['0']['game_type_name']|default="--"}</td>
<td rowspan="{$data.row}">
<a href="{:U('editcompanybelonggame', array('id'=>$data['id']))}" class="">修改</a>
<a data-url="{:U('delcompanybelonggame', array('id'=>$data['id']))}" class="ratio_del">删除</a>
</td>
</tr>
<if condition="$data['row'] gt 1">
<foreach name="data['game_data']" item="game_data" key="gamekey">
<if condition="$gamekey neq 0">
<tr>
<td>{$game_data['original_package_name']|default="--"}</td>
<td>{$game_data['relation_game_name']|default="--"}</td>
<td>{$game_data['relation_game_name']|default="--"}</td>
</tr>
</if>
</foreach>
</if>
</volist>
</if>
</tbody>
</table>
</div>
</div>
<div class="page">
<!-- <a class="sch-btn export-btn" id="downloadexcel" url="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出</a>-->
{$_page|default=''}
</div>
<!--弹出层-->
<div class="promote-layer mb20">
<form id="ajaxForm" action="{:U('set_withdraw')}" method="post">
<ol class="promote-con">
<li class="promote-con-con " id="deny">
<div class="mb20">
<span class="promote-name">备注:</span>
<textarea class="textarea-style" name="remark" id="remark"></textarea>
</div>
<a class="ajax-post pack" style="cursor: pointer;" target-form="ids" url="{:U('setStatus',array('status'=>-1))}"><div class="promote-btn">拒绝</div></a>
</li>
</ol>
</form>
</div>
</block>
<block name="script">
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('GameRatioMould/index')}");
$(function(){
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#time_end').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm',
language:"zh-CN",
// minView:2,
weekStart: 1,
todayBtn: true,
todayHighlight: false,
startView: 3,
minView: 3,
forceParse: 0,
autoclose:true,
pickerPosition:'bottom-left'
})
//搜索功能
$("#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();
}
});
$("#downloadexcel").on("click",function(){
var url = $(this).attr("url");
var title = '游戏分成比例模板,请耐心等待数据处理....';
var index = layer.load(2);
layer.open({
type: 2,
title: title,
shadeClose: false,
shade: 0.8,
area: ['40%', '30%'],
content: url,
success:function(){
layer.closeAll();
}
});
})
$(".ratio_del").on("click",function(){
var url = $(this).data("url");
layer.confirm('删除后将无法恢复,请慎重选择', {
closeBtn:0,
title:false,
btn: ['取消','删除'] //按钮
}, function(index){
layer.close(index);
}, function(){
$.get(url,function(data){
if(data.status == 1){
layer.msg('<span style="color:white">'+data.msg+'<span>',{time: 1000},function(){
window.location.reload();
});
}else{
layer.msg(data.msg,{icon: 2});
}
});
});
})
})
</script>
</block>

@ -0,0 +1,411 @@
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script src="__STATIC__/jquery.form.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<style>
.tabcon1711 input.time {
width: 150px;
}
#form .txt_area {
width: 300px;
height: 150px;
}
.tabcon1711 .form_unit {
margin-left: 2px;
}
.tabcon1711 .mustmark {
margin-left:-7px;
}
.list-ratio {
display: table;
}
.list-ratio .li-ratio {
display: flex;
margin-bottom: 20px;
align-items: center;
}
.list-ratio .li-ratio .turnover, .list-ratio .li-ratio .turnover-ratio {
position: relative;
}
.list-ratio .li-ratio .turnover span, .list-ratio .li-ratio .turnover-ratio .error-message {
color: red;
position: absolute;
left: 0;
top: 30px;
white-space: nowrap;
display: none;
}
.iconfont-btn {
cursor: pointer;
}
.iconfont-style {
font-size: 18px;
color: #fff;
border-radius: 4px;
border: 0;
padding: 5px;
margin-left: 10px;
}
.iconfont-selected {
background-color: #0A9AF2;
}
.iconfont-selected:hover {
background-color: #03a9f4;
}
.iconfont-unselected {
background-color: #999;
}
.iconfont-unselected:hover {
background-color: #ababab;
}
input[type=number]{
padding: 4px 6px;
font-size: 12px;
line-height: 20px;
color: #555;
vertical-align: middle;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #fff;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-moz-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">特殊比例申请</h3>
<!-- <p class="description_text">说明:此功是创建推广员时所需填写信息</p>-->
</div>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('editcompanybelonggame')}" method="post" class="form-horizontal">
<!-- 基础文档模型 -->
<div id="tab1" class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l"><i class="mustmark">*</i>生效期限:</td>
<td class="r table_radio">
<div style="float: left;">
<input type="text" class="txt time" name="begin_time" id="begin_time" placeholder="开始时间" value="{$data['begin_time']}">
-
<input type="text" class="txt time" name="end_time" id="end_time" placeholder="结束时间" value="{$data['end_time']}">
</div>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>游戏:</td>
<td class="r">
<a class="ajax-view" data-id="{$data.id}">选择游戏</a>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>已申请游戏:</td>
<td class="r promote_id" id="game_name">
{$data['span_str']}
</td>
</tr>
</tbody>
</table>
</div>
<!-- {$data['game_ids']}-->
<div class="form-item cf">
<input style="display: none" value="{$_GET['id']}" name="id" >
<input style="display: none" value="{$data['ids']}" name="game_ids" class="show_game_ids">
<button class="submit_btn mlspacing" id="submit" type="submit" target-form="form-horizontal">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</form>
<div class="pro_promot" style="display:none">
<form action="{:U('MarketPercentage/showGame')}" id="ajaxForm" method="post" />
<input type="hidden" name="promote_id" id="se_promote_id" value="" />
<div class="pro_promot_main">
<div class="pro_promot_title">
<div class="fl pro_promot_title_text">
<div class="fl pro_promot_title_bigtext"> 可申请游戏</div> 选中的游戏将在对应的推广员后台进行展示,推广员可进行游戏申请</div>
<div class="pro_promot_close fr"><img src="__IMG__/icon_close.png"></div>
</div>
<div class="pro_promot_con">
<!-- <div class="pro_promot_account">推广员账号:<span class="pro_promot_number"></span></div>-->
<div class="pro_promot_select">
<div class="pro_promot_select_title fl">选择游戏:</div>
<div class="pro_promot_select_list fl">
<a class="pro_promot_select_list_con fl active pro_promot_all pro_promot_mr20">全部 </a>
<a class="pro_promot_select_list_con fl" data-index="A">A</a>
<a class="pro_promot_select_list_con fl" data-index="B">B</a>
<a class="pro_promot_select_list_con fl" data-index="C">C</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="D">D</a>
<a class="pro_promot_select_list_con fl" data-index="E">E</a>
<a class="pro_promot_select_list_con fl" data-index="F">F</a>
<a class="pro_promot_select_list_con fl" data-index="G">G</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="H">H</a>
<a class="pro_promot_select_list_con fl" data-index="I">I</a>
<a class="pro_promot_select_list_con fl" data-index="J">J</a>
<a class="pro_promot_select_list_con fl" data-index="K">K</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="L">L</a>
<a class="pro_promot_select_list_con fl" data-index="M">M</a>
<a class="pro_promot_select_list_con fl" data-index="N">N</a>
<a class="pro_promot_select_list_con fl" data-index="O">O</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="P">P</a>
<a class="pro_promot_select_list_con fl" data-index="Q">Q</a>
<a class="pro_promot_select_list_con fl" data-index="R">R</a>
<a class="pro_promot_select_list_con fl" data-index="S">S</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="T">T</a>
<a class="pro_promot_select_list_con fl" data-index="U">U</a>
<a class="pro_promot_select_list_con fl" data-index="V">V</a>
<a class="pro_promot_select_list_con fl" data-index="W">W</a>
<a class="pro_promot_select_list_con fl pro_promot_mr20" data-index="X">X</a>
<a class="pro_promot_select_list_con fl" data-index="Y">Y</a>
<a class="pro_promot_select_list_con fl" data-index="Z">Z</a>
</div>
</div>
<div class="clear"></div>
<div class="pro_promot_game">
<div class="jsgamecheckallbox z_clearfix" >
<label class="custom-label">
<input type="checkbox" class="form_control jsgamecheckall" >
<i class="label_icon"></i>
<span class="label_text">全选</span></label>
</div>
<ul id="game_list" class="z_clearfix game_list" style="clear: both;">
</ul>
</div>
<div class="clear"></div>
<div class="pro_promot_btn">
<div class="fl pro_promot_btn_confirm">确定</div>
<div class="fr pro_promot_btn_cancel">取消</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script src="__STATIC__/czinputcheck.js?v=1.29" type="text/javascript"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('index')}");
$(".select_gallery").select2();
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#submit').click(function (e) {
//查看是否报错
var target = $('#form').get(0).action;
var query = $('#form').serialize();
var that = this;
$(that).addClass('disabled').attr('autocomplete','off').prop('disabled',true);
$.post(target,query).success(function(data){
if(data.status == 1) {
layer.msg(data.msg);
setTimeout(function(){
window.location.href = "{:U('MarketPercentage/companybelonggame')}";
},2000);
} else {
layer.msg(data.msg);
$(that).addClass('disabled').attr('autocomplete','on').prop('disabled',false);
}
});
});
showTab();
// var get_push_data = "{$data['game_ids']}";
var game_data = "{$data['game_ids']}";
var push_data = "{$data['ids']}";
$('#relation_game_id').change(function (e) {
var original_package_name = $('#relation_game_id option:selected').data("original");
if(original_package_name == ''){
original_package_name = '未配置原包名'
}
$("#original_package_name").html(original_package_name);
});
//点击字母按照条件按钮筛选
$(".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');
var checked = 'checked';
$.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 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(game_data.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{
$(".jsgamecheckall").attr('checked',false);
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
checked = '';
}
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>');
});
$(".jsgamecheckall").attr('checked',checked);
$("#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{
var tip_msg = res.info ? res.info : '操作失败';
layer.msg(tip_msg);
}
});
});
//保存修改
$(".pro_promot_btn_confirm").click(function(){
$("#ajaxForm").ajaxSubmit(function(res){
if (res.status == 1) {
$("#game_name").empty();
layer.msg(res.msg);
var data = res.data;
var span = "";
push_data = [];
game_data = [];
for (var key in data) {
span += "<span style='margin-left: 15px'>"+data[key]['relation_game_name']+"</span>";
if ((parseInt(key)+1)%5 == 0) {
span += "<br>";
}
game_data.push(data[key]['relation_game_id']);
push_data.push(data[key]['relation_game_id']);
}
$(".show_game_ids").val(push_data);
$("#game_name").append(span);
$(".pro_promot").hide();
} else {
layer.msg(res.msg);
}
});
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);
}
});
});
}
});
</script>
</block>
Loading…
Cancel
Save