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.

751 lines
27 KiB
HTML

5 years ago
<extend name="Public/promote_base"/>
<block name="css">
<link rel="stylesheet" href="__CSS__/20170831/select2.min.css" type="text/css"/>
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/game.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<link href="__CSS__/game_detailed.css" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<style type="text/css">
.trunk-list {
position: relative;
min-height: 66vh;
}
.pagenation {
text-align: center;
line-height: 5vh;
}
.lwx_dialog_prompt .layui-layer-content {
padding-top: 15px;
}
.lwx_dialog_title {
margin: 0;
padding: 0;
}
.launch_platform_prompt .layui-layer-input, .lwx_dialog_input, .lwx_dialog_select, .lwx_dialog_textarea {
display: block;
width: 220px;
height: 32px;
margin: 0 auto;
line-height: 32px;
padding: 0 5px;
border: 1px solid #ccc;
box-shadow: 1px 1px 5px rgba(0, 0, 0, .1) inset;
color: #333;
}
.lwx_dialog_select {
width: 272px;
}
.lwx_dialog_textarea {
height: 64px;
width: 260px;
margin-top: 10px;
resize: none;
}
.lwx_dialog_input {
width: 260px;
margin-top: 10px;
}
.launch_platform_prompt .layui-layer-btn, .lwx_dialog_prompt .layui-layer-btn {
text-align: center;
padding-bottom: 25px;
}
.launch_platform_prompt .layui-layer-btn .layui-layer-btn0, .lwx_dialog_prompt .layui-layer-btn .layui-layer-btn0 {
width: 81%;
line-height: 32px;
height: 32px;
margin: 0;
}
.lwx_dialog_notice {
position: absolute;
bottom: 6px;
left: 20px;
font-size: 12px;
color: #999;
}
.lwx_dialog_prompt .select2-container, .select2-container--default .select2-selection--single {
width: 272px !important;
}
.applycbtn {
display: block;
color: #50B370;
}
textarea {
font-family: inherit;
}
.trunk-content {
margin: 0 2%;
}
.pic-prev:hover, .pic-next:hover {
background-color: #4ac5c3;
}
.add-disable {
color: #999;
}
.detailback {
display:none;
width:100%;
z-index: 999;
top:0px;
left:0px;
position:absolute;
background: rgba(47, 79, 79,0.5);
min-height:900px
}
.detailindex {
display: flex;
flex-direction: column;
5 years ago
flex-wrap: wrap;
5 years ago
justify-content:center;
align-items:center;
5 years ago
width:50%;
margin-left:25%;
background: white;opacity: 1.0;
min-height:900px;
}
.detailindex img {
width: 100%;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list apply-index-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>游戏管理></span><span>资料专区</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png"><span class="title_main">资料专区</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<div class="tab marg_top20" style="clear:both;display: flex;">
<form action="{:U('feature',array('row'=>I('get.row'),'type'=>$type))}" method="post" enctype="multipart/form-data"
class="marg_top20">
<div class="form-group normal_space fr">
<input type="submit" class="submit" value="查询" style="background-color: #62A8EA">
</div>
<div class="form-group normal_space fr">
<select id="game_id" name="game_id" class="reselect select_gallery" style="min-width:200px;width: 175px;">
<option value="">请选择游戏名称</option>
<volist name=":get_promote_serach_game()" id="vo">
<option value="{$vo.id}" title="{$vo.relation_game_name}">{$vo.relation_game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space fr" style="display: none;">
<input id="promote_role" name="promote_role">
</div>
</form>
</div>
</div>
<div class="trunk-list">
<div class="div_bgtab">
<ul class="game-ul">
<empty name="list_data">
<ul class="game-ul">
<li class="game-li" style="text-align: center;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
<p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</li>
</ul>
<else/>
<volist name="list_data" id="vo">
<li class="game-li">
<div class="media">
<div class="img-box" onclick="viewGameDetailed({$vo.id})">
<img src="__ROOT__{$vo.icon|get_cover='path'}" />
</div>
<div class="game-msg" style="width: calc(92% - 90px);">
<h5 class="game-title" style="font-weight: normal">
<if condition="$type eq 10">
《{$vo.relation_game_name}》产品资料
<else/>
《{$vo.game_name}》产品资料
</if>
</h5>
<p><span style="color:#76838F">{$vo.features}</span></p>
<!-- <p>
<if condition="$type eq 10">
<span>平台:<span>Android+ios</span>&nbsp;&nbsp;</span>
<else/>
<span>平台:<span>{:getSDKTypeName($vo['sdk_version'])}</span>&nbsp;&nbsp;</span>
</if>
<span>版本:<span>{$vo.version}</span>&nbsp;&nbsp;</span>
<span>大小:<span>{$vo.game_size}</span>&nbsp;&nbsp;</span>
<span>游戏类型:<span>{$vo.game_type_name}</span>&nbsp;&nbsp;</span>
</p>-->
</div>
<div class="game-operating" style="width: 8%;">
<!--<if condition="$type eq 10">
<if condition="addedAboutDoubleSdk($promoteId,$vo['id']) eq 1">
<span class="add-disable" style="cursor: pointer;">已添加</span>
<else/>
<span onclick="commonApply({$vo.id},this,0,10)" style="cursor: pointer;"><u>添加</u></span>
</if>
<else/>
<if condition="$vo.apply_id_1 gt 0">
<span class="add-disable" style="cursor: pointer;">已添加</span>
<else/>
<span onclick="commonApply({$vo.id},this,0,0)" style="cursor: pointer;"><u>添加</u></span>
</if>
</if>-->
<!--<span onclick="commonApply({$vo.id},this,0,0)" style="cursor: pointer;"><u>查看详情</u></span>-->
<span onclick="lookdetail({$vo.id})" style="cursor: pointer;"><u class="lookdetail">查看详情</u></span>
</div>
</div>
</li>
</volist>
</empty>
</ul>
</div>
<div class="pagenation clearfix">
{$_page}
</div>
</div>
</div>
</div>
<div class="detailback" id="detailback">
<div class="detailindex" style="">
</div>
</div>
</block>
<block name="script">
<script src="__STATIC__/zeroclipboard/jquery.zclip.min.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
function lookdetail(id) {
$.ajax({
type: "post",
url: "__URL__/backDetailData",
// dataType: "json",
data: {'id': id},
success:function(res) {
console.log(res)
if(res.code == 10000) {
content = res.info;
html = '';
html += content;
$('.detailindex').html(html);$('.detailindex').val();
$('.detailback').css('display','block')
}else {
content = "暂无资料查询";
html = '';
html += content;
$('.detailindex').html(html);$('.detailindex').val();
$('.detailback').css('display','block')
}
},
fail:function(err) {
console.log('err')
}
})
}
window.onload=function(){
var detailback = document.getElementById("detailback");
document.addEventListener("click",function(){
detailback.style.display="none";
});
detailback.addEventListener("click",function(event){
event=event||window.event;
event.stopPropagation();
});
};
</script>
<script type="text/javascript">
var gameScreenshotCount = 0; //游戏截图数量
var newPromoteId = 0;
setValue('sdk_version', {$Think.request.sdk_version |default = '""'});
setValue('game_id', {$Think.request.game_id |default = '""'});
setValue('promote_id', {$Think.request.promote_id |default = '""'});
setValue('enable_status', {$Think.request.enable_status |default = '""'});
setValue('promote_role', {$Think.request.promote_role |default = 1});
setValue('row', '{:I("row",10)}');
$('.btn-role').on('click', function () {
var thisElement = $(this);
if (!thisElement.hasClass('highlight')) {
var promoteRole = thisElement.attr('promote-role');
console.log(promoteRole);
setValue('promote_role', promoteRole);
$('.btn-role').removeClass('highlight');
thisElement.addClass('highlight');
if (promoteRole == 1) {
location.href = "{:U('index', array('type' => $type))}";
} else {
getPromoteListByRole(promoteRole);
}
}
});
function getPromoteListByRole(promoteRole)
{
$.ajax({
type: "post",
url: "__URL__/getPromoteListByRole",
dataType: "json",
data: {'promote_role': promoteRole},
success: function (data) {
var html = '<option value="">请选择渠道</option>';
if (data.length > 0) {
$.each(data, function (index, item) {
var promoteTitle = item['account'] + '(' + item['nickname'] + ')';
html += '<option value="' + item['id'] + '" title="' + promoteTitle + '">';
html += promoteTitle;
html += '</option>';
});
}
$('#promote_id').html(html);
$('#promote_id').val();
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
}
$(document).ready(function () {
$(".select_gallery").select2();
$('.download').click(function (event) {
var href = $(this).attr('href');
if (href == '#') {
layer.msg("暂无下载内容", {icon: 2, time: 1000});
return false;
}
});
$('a.copy').zclip({
path: '__STATIC__/zeroclipboard/ZeroClipboard.swf',
copy: function () {
if ($(this).attr('pack_status') == undefined) {
return $(this).attr('data-url');
} else {
//alert($(this).attr('pack_status'));
switch ($(this).attr('pack_status')) {
case "1":
return $(this).attr('data-url');
break;
default:
layer.msg("尚未打包", {icon: 2});
break;
}
}
},
beforeCopy: function () {
$(this).addClass("proc");
},
afterCopy: function () {
$(this).removeClass("copy");
if ($(this).attr('data-url') == "" || $(this).attr('data-url') == null) {
layer.msg("暂无下载内容", {icon: 2});
} else if ($(this).attr('data-url') == "#") {
layer.msg("暂无原包,无法复制链接", {icon: 2});
} else {
layer.msg("复制成功", {icon: 1, time: 1000});
}
}
});
$('#batch_application').on('click', function () {
var gameid = '';
$(this).closest('.trunk-content').find('table input[class="ids"]:checked').each(function () {
gameid += ',' + $(this).val();
});
gameid = gameid.slice(1);
if (!gameid) {
layer.msg('你还没有选择任何内容!');
} else {
var select = $('#platform_list');
select.find('select').attr('id', 'lwx_dialog_select').addClass('lwx_dialog_select');
layer.confirm(select.html() + '<input id="lwx_dialog_input" type="text" class="lwx_dialog_input" placeholder="可输入其他平台" value=""><textarea class="lwx_dialog_textarea" id="lwx_dialog_textarea" name="remark" placeholder="备注"></textarea>', {
title: '投放平台', zIndex: 1, skin: 'lwx_dialog_prompt', success: function (layero, index) {
layero.append('<p class="lwx_dialog_notice">注:选择后不可修改</p>');
layero.find(".lwx_dialog_select").select2();
}, btn: ['确定']
}, function (index, layero) {
var select = layero.find('#lwx_dialog_select');
var input = layero.find('#lwx_dialog_input');
var textarea = layero.find('#lwx_dialog_textarea');
var val_s = select.val();
var val_i = input.val();
var remark = textarea.val();
if (!val_s && !val_i) {
layer.msg('请输入投放平台', {type: 1, time: 1500}, function (index) {
layer.close(index);
});
select.focus();
return false;
}
$.ajax({
type: "post",
url: "{:U('batch_apply_game')}",
dataType: "json",
data: {game_id: gameid, platform_id: val_s, platform_name: val_i, remark: remark},
success: function (res) {
if (res.status) {
layer.msg(res.msg, {icon: 1});
setTimeout(function () {
window.location.reload();
}, 1500);
} else {
layer.msg(res.msg, {icon: 2});
}
},
error: function () {
layer.msg('服务器故障', {icon: 5});
}
});
});
}
return false;
});
});
$("#all").click(
function () {
if (this.checked) {
$("input[name='zi']").prop('checked', true)
} else {
$("input[name='zi']").prop('checked', false)
}
}
);
//批量申请
$("#gapply").click(function () {
var chk_value = "";
var pattern_value = "";
$(':checkbox').each(function () {
if ($(this).val() != "" && $(this).prop('checked')) {
chk_value += ("," + $(this).val());
}
});
chk_value = chk_value.substr(1, chk_value.length - 1);
chk_value = chk_value.slice(0);
pattern_value = pattern_value.substr(1, pattern_value.length - 1);
pattern_value = pattern_value.slice(0);
if (chk_value == 0) {
layer.msg('你还没有选择任何内容!');
} else {
$.ajax({
type: "post",
url: "__URL__/gapply",
dataType: "json",
data: {game_id: chk_value},//,pattern:pattern
success: function (res) {
if (res.status) {
layer.msg(res.msg, {icon: 1});
setTimeout(function () {
window.location.reload();
}, 1500);
} else {
layer.msg(res.msg, {icon: 2});
}
},
error: function () {
layer.msg('服务器故障', {icon: 5});
}
})
// $("#gapply").attr('href', '__MODULE__/Apply/gapply/game_id/'+chk_value);//+'/pattern/'+pattern_value
}
});
function errapply($gameid, pattern, obj) {
layer.msg("上级渠道未申请或未通过该游戏,不能申请", {icon: 2});
}
function erapply($gameid, pattern, obj) {
$.ajax({
type: "post",
url: "__URL__/apply",
dataType: "json",
data: {game_id: $gameid, pattern: pattern},
success: function (res) {
if (res.status) {
$(obj).attr("onclick", "").html("<span style='color:#26C7DB'>申请成功</span>").addClass("proc wait");
location.href = "{:U('index')}";
} else {
layer.msg(res.msg, {icon: 2});
}
},
error: function () {
layer.msg('服务器故障', {icon: 5});
}
})
}
function firstapply(gameid, obj, type, version) {
var select = $('#platform_list');
select.find('select').attr('id', 'lwx_dialog_select').addClass('lwx_dialog_select');
layer.confirm(select.html() + '<input id="lwx_dialog_input" type="text" class="lwx_dialog_input" placeholder="可输入其他平台" value=""><textarea class="lwx_dialog_textarea" id="lwx_dialog_textarea" name="remark" placeholder="备注"></textarea>', {
title: '投放平台', zIndex: 1, skin: 'lwx_dialog_prompt', success: function (layero, index) {
layero.append('<p class="lwx_dialog_notice">注:选择后不可修改</p>');
layero.find(".lwx_dialog_select").select2();
}, btn: ['确定']
}, function (index, layero) {
var select = layero.find('#lwx_dialog_select');
var input = layero.find('#lwx_dialog_input');
var textarea = layero.find('#lwx_dialog_textarea');
var val_s = select.val();
var val_i = input.val();
var remark = textarea.val();
if (!val_s && !val_i) {
layer.msg('请输入投放平台', {type: 1, time: 1500}, function (index) {
layer.close(index);
});
select.focus();
return false;
}
$.ajax({
type: 'post',
url: '{:U("apply_game")}',
dataType: 'json',
data: {
game_id: gameid,
sdk_version: version,
platform_id: val_s,
platform_name: val_i,
remark: remark
},
success: function (res) {
if (res.status) {
if (type == 1 && parseInt(res.exist) == 0) {
$(obj).attr("onclick", "").html("<span >审核中</span>").addClass("proc wait");
} else {
$(obj).html("<span >再次申请</span>").addClass("proc wait");
}
layer.msg(res.msg, {icon: 1, time: 1500}, function (index) {
layer.close(index);
});
layer.close(index);
} else {
layer.msg(res.msg, {icon: 2, time: 1500}, function (index) {
layer.close(index);
});
}
},
error: function () {
layer.msg('服务器故障', {icon: 5});
layer.close(index);
}
});
});
}
function commonApply(gameid, obj, type, sdkType) {
var that = $(obj);
if (that.hasClass('no_submit')) {
return false;
}
that.addClass('no_submit');
$.ajax({
type: 'post',
url: '{:U("apply")}',
dataType: 'json',
data: {game_id: gameid, promote_id: {$promoteId}, sdk_type: sdkType},
success: function (res) {
console.log(res);
if (res.status) {
if (type == 1) {
that.attr("onclick", "").html("<span>审核中</span>").addClass("proc wait");
} else {
that.addClass('add-disable');
that.text('已添加');
that.removeAttr('onclick');
}
layer.msg(res.msg, {icon: 1, time: 1500});
} else {
layer.msg(res.msg, {icon: 2, time: 1500});
console.log(res.ret);
}
that.removeClass('no_submit');
},
error: function () {
layer.msg('服务器故障', {icon: 5});
that.removeClass('no_submit');
}
})
}
function yiapply($gameid, obj, type) {
$.ajax({
type: "post",
url: "__URL__/apply",
dataType: "json",
data: {game_id: $gameid},//,pattern:pattern
success: function (res) {
if (res.status) {
if (type == 1) {
$(obj).attr("onclick", "").html("<span style='color:#26C7DB'>审核中</span>").addClass("proc wait");
} else {
$(obj).attr("onclick", "").html("<span style='color:#26C7DB'>申请成功</span>").addClass("proc wait");
}
layer.msg(res.msg, {icon: 1});
} else {
layer.msg(res.msg, {icon: 2});
}
},
error: function () {
layer.msg('服务器故障', {icon: 5});
}
})
}
function package($id, $game_id) {
$.ajax({
type: "post",
url: "__URL__/allpackage",
dataType: "json",
data: {ids: $id, game_id: $game_id},
success: function (result) {
layer.msg(result.info, {icon: 6, time: 3000},
function () {
location.reload();
}
);
},
error: function () {
alert('错误');
}
})
}
//导航高亮
highlight_subnav('{:U("Apply / index")}');
//查看游戏详情
function viewGameDetailed(id) {
$.ajax({
type: "post",
url: "__URL__/viewGameDetailed",
dataType: "json",
data: {'id': id},
success: function (data) {
$('#game_icon').attr('src', data.icon ? data.icon : '');
$('#game_name').text(data.game_name ? data.game_name : '');
$('#version').text(data.version ? data.version : '无');
$('#game_type_name').text(data.game_type_name ? data.game_type_name : '无');
$('#game_size').text(data.game_size ? data.game_size : 0);
$('#create_time').text(data.create_time ? data.create_time : '无');
$('#dow_num').text(data.dow_num ? data.dow_num : 0);
$('#features').text(data.features ? data.features : '无');
gameScreenshotCount = data.screenshot.length; //游戏截图数量
if (gameScreenshotCount > 0) {
var html = '';
$.each(data.screenshot_url, function (index, item) {
html += '<li>';
html += '<img src="' + item + '">';
html += '</li>';
});
$('.game-slide-li').html(html);
}
$('.detail-body').show();
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
}
$('.game-detail-close').on('click', function () {
$('.detail-body').hide();
});
$('.pic-prev').on('click', function () {
var element = $('.game-slides').children('ul');
var oldLeft = element.position().left;
var newLeft = oldLeft + 280;
if (newLeft <= 0 && newLeft % 1 === 0) {
element.css('left', newLeft);
}
});
$('.pic-next').on('click', function () {
var element = $('.game-slides').children('ul');
var oldLeft = element.position().left;
var newLeft = oldLeft - 280;
var minLeft = -(gameScreenshotCount * 280 -560);
if (newLeft >= minLeft && newLeft % 1 === 0) {
element.css('left', newLeft);
}
});
$('.pack-inner').hover(function () {
var element = $(this);
$('.pack-inner').children('.pack-word').hide();
element.children('.pack-word').show();
});
$('#promote_id').on('change', function () {
newPromoteId = $(this).val();
});
</script>
</block>