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.

448 lines
20 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<extend name="Public/manage" />
<block name="head">
<link href="__CSS__/user_zxy.css" rel="stylesheet">
<script src="__JS__/bootstrap-datetimepicker.min.js"></script>
<script src="__JS__/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="__JS__/bootstrap-select.min.js"></script>
<script type="text/javascript" src="__ADDONS__/UploadImages.js"></script>
<style type="text/css">
.form-horizontal .control-label{text-align: right;padding-right: 20px;color: #666666;font-size: 14px;}
.mrc_left{width: 120px;}
.bootstrap-select.btn-group .btn .filter-option{color: #999;}
::-webkit-input-placeholder{color: #999;}
:-moz-placeholder{color: #999;}
::-moz-placeholder{color: #999;}
:-ms-input-placeholder{color: #999;}
.mrc_colum2_5{height: auto;}
a.btn.btn_default{width: 76px;border-radius: 5px;border: none;background: #ccc;color: #fff;}
.title{margin: 10px auto;}
.title .addgame_icon{
display: inline-block;
vertical-align: middle;
margin-right: 5px;
width: 17px;
height: 12px;
background: url(__IMG__/gamemanagement_icon_releasegames.png) no-repeat;
background-size: 100%;
}
.title span{vertical-align: middle;color: #666;font-size: 14px;}
.mrc_colum_ml{margin-left:130px}
</style>
</block>
<block name="location">
<a class="z_nav" href="{:U('Game/index')}">游戏管理</a>
<a class="z_nav curt_nav" href="##">发布游戏</a>
</block>
<block name="body" >
<link rel="stylesheet" href="__CSS__/uploadify.css">
<div class="matter">
<div class="matter_right_top game_progress_wrap clearfix game_pro border_right">
<ul>
<li>
<img src="__IMG__/gamemanagement_icon_bussiness.png"/>
<p class="title_pro">商务洽谈</p>
<p>商谈游戏接入事项</p>
</li>
<li>
<img src="__IMG__/gamemanagement_icon_addgame.png"/>
<p class="title_pro">创建游戏</p>
<p>获取APPID和KEY</p>
</li>
<li>
<img src="__IMG__/gamemanagement_icon_access.png"/>
<p class="title_pro">SDK接入</p>
<p>对接SDK到游戏</p>
</li>
<li>
<img src="__IMG__/gamemanagement_icon_examine.png"/>
<p class="title_pro">游戏审核</p>
<p>游戏测试快速审核</p>
</li>
<li>
<img src="__IMG__/gamemanagement_icon_online.png"/>
<p class="title_pro">游戏上线</p>
<p>审核通过,游戏上线</p>
</li>
</ul>
</div>
<div class="title"><i class="addgame_icon"></i><span>发布游戏</span></div>
<div class="matter_right_content border_right">
<form id="add_form" action="{:U('game/add')}" method="post" class="form-horizontal" enctype="multipart/form-data" novalidate="novalidate">
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><span class="must_red">*</span> 游戏名称</label>
<div class="mrc_right4_3_3 mrc input-format ">
<input type="text" class="form-control" name="game_name" placeholder="" value="" >
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><span class="must_red">*</span> 游戏类型</label>
<div class="mrc_right4_3_3 mrc input-format ">
<select name="game_type_id" id="game_type_id" class="form-control" aria-required="true" aria-invalid="true" aria-describedby="game_type_id-error">
<volist name=":get_game_type_all()" id="vo">
<option value="{$vo.id}">{$vo.type_name}</option>
</volist>
</select>
<input name="game_type_name" value="" type="hidden" id="game_type_name">
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><span class="must_red">*</span> 平台类型</label>
<div class="mrc_right4_3_3 mrc input-format">
<div class="radio">
<label class="check_radio radio-primary">
<input type="radio" name="sdk_version" value="1" checked="checked"/>
<span>安卓</span>
</label>
<label class="check_radio radio-primary">
<input type="radio" name="sdk_version" value="2" />
<span>苹果</span>
</label>
<!-- <label><input type="radio" name="sdk_version" value="3" > 双平台</label> -->
</div>
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><span class="must_red">*</span>运营状态</label>
<div class="mrc_right4_3_3 mrc input-format">
<select name="category" id="categoryId" class="form-control" aria-required="true" aria-invalid="true" aria-describedby="open-error">
<volist name=":get_opentype_all()" id="vo">
<option value="{$vo.id}">{$vo.open_name}</option>
</volist>
</select>
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc mrc_colum4_1_6 input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><span class="must_red">*</span> 游戏简介</label>
<div class="mrc_right4_3_3 mrc input-format">
<input type="text" class="form-control" name="features" placeholder="请将游戏简介浓缩为一句话简介,让玩家快速认知游戏。" value="" >
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><font color="red">*</font> 游戏介绍</label>
<div class="mrc_right4_3_3 mrc3 mrc input-format">
<textarea name="introduction" class="form-control" rows="4" placeholder="请填写游戏对玩家而言的亮点和特色内容在50-200个汉字"></textarea>
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><font color="red">*</font>游戏ICON</label>
<div class="mrc_colum2_5 mrc input-format">
<input type="file" id="upload_picture_icon">
<input type="hidden" name="icon" id="cover_id_icon" value="" />
<div class="upload-img-box">
<notempty name="data['icon']">
<div class="upload-pre-item"><img src=""/></div>
</notempty>
</div>
</div>
<div class="mrc_right4_3_3 mrc">
<label class="col-lg-11 control-label matter_notice" style="font-weight: normal;text-align:left;color: #999;">尺寸不得小于512*512px圆角半径113px不强制要求可直接提供512*512px方图</label>
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><font color="red">*</font> 游戏推荐图</label>
<div class="mrc_colum2_5 mrc input-format">
<input type="file" id="upload_picture_cover">
<input type="hidden" name="cover" id="cover_id_cover" value="" />
<div class="upload-img-box">
<notempty name="data['icon']">
<div class="upload-pre-item"><img src=""/></div>
</notempty>
</div>
</div>
<div class="mrc_right4_3_3 mrc">
<label class="col-lg-11 control-label matter_notice" style="font-weight: normal;text-align:left;color: #999;">470*350px用于官网首屏推荐游戏位展示</label>
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><font color="red">*</font> 游戏截图</label>
<div class="mrc_colum2_5 mrc input-format">
{:W('UploadImages/upload', array('key'=>['name'=>'screenshot','class'=>'user_file']))}
</div>
<div class="mrc_right4_3_3 mrc" style="width: 452px;">
<label class="control-label matter_notice" style="font-weight: normal;text-align:left;color: #999;">横版游戏建议尺寸1691280*720px及以上竖版游戏建议尺寸916720*1280px及以上用于游戏详情页内展示</label>
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"> 知识产权</label>
<div class="mrc_colum2_5 mrc input-format">
{:W('UploadImages/upload', array('key'=>['name'=>'accredit_img','class'=>'user_file']))}
</div>
<div class="mrc_right4_3_3 mrc">
<label class="col-lg-11 control-label matter_notice" style="font-weight: normal;text-align:left;color: #999;">请上传游戏授权书或知识产权证明(选填,可在上线前补充)</label>
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"></label>
<div class="mrc_colum4_1_6 mrc">
<input type="submit" class="btn btn_primary user_btn" id="editServer" value="提交">&nbsp;&nbsp;&nbsp;
<a href="javascript:history.go(-1);" class="btn btn_default user_btn_default">取消</a>
</div>
</div>
</form>
</div>
</div>
<script>
$(function() {
$("#game_type_id").change(function(){
var val = $("#game_type_id option:selected").text();
$("#game_type_name").val(val);
})
$("#game_type_id").change();
$('#game_type_id').selectpicker({
size: 15,noneSelectedText:'请选择',
});
$('#categoryId').selectpicker({
size: 15,noneSelectedText:'请选择',
});
$.validator.addMethod("checkFileSize", function(value, element,params){
var size = element.files[0].size;
if (size<params) {
return true;
}
return false;
}, "上传文件大小超出限制");
$.validator.addMethod("checkFileType", function(value, element,params){
var type = element.files[0].type;
if (!type) {type = element.files[0].name;}
var flag = false;
for (var i=0;i<params.length;i++) {
if (type.indexOf(params[i])>-1) {
flag = true;break;
}
}
return flag;
}, "上传文件类型错误");
$("#add_form").validate({
//定义规则
rules:{
game_name: {
required: true,
},
features: {
required: true,
rangelength: [8,18],
},
introduction: {
required: true,
rangelength: [50,200],
},
digest: {
required: true,
},
icon: {
required: true,
checkFileSize: 2000000,
checkFileType: ['image/jpeg','image/png'],
},
shortcut: {
required: true,
checkFileSize: 2000000,
checkFileType: ['image/jpeg','image/png'],
},
sorce: {
required: true,
checkFileType: ['apk','ipa'],
}
},
messages:{
game_name: {
required: "请填写游戏名称",
},
features: {
required: "请填写游戏简介",
rangelength: $.validator.format(" 游戏介绍内容在{0}-{1}字以内"),
},
introduction: {
required: "请填写游戏介绍内容",
rangelength: $.validator.format(" 游戏介绍内容在{0}-{1}字以内"),
},
icon: {
required: "请上传游戏图标",
checkFileSize: "上传文件不能超过2M",
checkFileType: "上传文件类型必须是.jpg 或 .png",
},
shortcut: {
required: "请上传游戏图标",
checkFileSize: "上传文件不能超过2M",
checkFileType: "上传文件类型必须是.jpg 或 .png",
},
sorce: {
required: "请上传游戏原包",
checkFileType: "上传文件类型必须是.apk 或 .ipa",
}
},
submitHandler: function (form) {
var button = $(form).find('#editServer');
if(button.hasClass('nosubmit')) {return false;}
button.addClass('nosubmit');
$.ajax({
type:'post',
dataType:'json',
url:"{:U('Game/add')}",
data:$(form).serializeArray(),
success:function(result) {
if(result.status == 1){
layer.msg(result.info);
setTimeout(function(){
location.href = "{:U('Game/index')}";
},1500);
}else{
layer.msg(result.info);setTimeout(function(){button.removeClass('nosubmit');},1000);
}
},error:function() {
layer.msg("服务器故障,请稍候再试");button.removeClass('nosubmit');
}
});
}
});
});
$.VMenu.show('#menu');
$.VMenu.open('m2.1');
</script>
<script type="text/javascript">
$("#upload_picture_icon").uploadify({
"height" : 30,
"swf" : "__STATIC__/uploadify/uploadify.swf",
"fileObjName" : "download",
"buttonText" : "上传图标",
"uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
"width" : 120,
'removeTimeout' : 1,
'buttonClass' : "user_file",
'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
"onUploadSuccess" : upload_picture_icon,
'onFallback' : function() {
alert('未检测到兼容版本的Flash.');
},
'onUploadStart':function(file){
if(file.size>2*1024*1024) {
layer.msg('上传文件大小不符');
$("#upload_picture_icon").uploadify('cancel',file.id);
}
},
});
function upload_picture_icon(file, data){
var data = $.parseJSON(data);
var src = '';
if(data.status){
$("#cover_id_icon").val(data.id);
src = data.url || '__ROOT__' + data.path;
$("#cover_id_icon").parent().find('.upload-img-box').html(
'<div class="upload-pre-item"><img src="' + src + '" data-id=" '+ data.id + '"/><span class="btn-close btn-close-icon" title="删除图片"></span></div>'
);
$('.btn-close-icon').click(function (event) {
event.preventDefault();
$(this).parent().remove();
picsbox = $("#upload_picture_icon").siblings('.upload-img-box');
picArr = [];
for (var i = 0; i < picsbox.children().length; i++) {
picArr.push(picsbox.children('.upload-pre-item:eq(' + i + ')').find('img').attr('data-id'));
}
;
picStr = picArr.join(',');
$('#cover_id_icon').val(picStr);
});
} else {
layer.msg(data.info,{icon:2});
}
}
$("#upload_picture_cover").uploadify({
"height" : 30,
"swf" : "__STATIC__/uploadify/uploadify.swf",
"fileObjName" : "download",
"buttonText" : "上传图片",
"uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
"width" : 120,
'removeTimeout' : 1,
'buttonClass' : "user_file",
'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
"onUploadSuccess" : upload_picture_cover,
'onFallback' : function() {
alert('未检测到兼容版本的Flash.');
},
'onUploadStart':function(file){
if(file.size>2*1024*1024) {
layer.msg('上传文件大小不符');
$("#upload_picture_cover").uploadify('cancel',file.id);
}
},
});
function upload_picture_cover(file, data){
var data = $.parseJSON(data);
var src = '';
if(data.status){
$("#cover_id_cover").val(data.id);
src = data.url || '__ROOT__' + data.path;
$("#cover_id_cover").parent().find('.upload-img-box').html(
'<div class="upload-pre-item"><img src="' + src + '" data-id=" '+ data.id + '"/><span class="btn-close btn-close-cover" title="删除图片"></span></div>'
);
$('.btn-close-cover').click(function (event) {
event.preventDefault();
$(this).parent().remove();
picsbox = $("#upload_picture_cover").siblings('.upload-img-box');
picArr = [];
for (var i = 0; i < picsbox.children().length; i++) {
picArr.push(picsbox.children('.upload-pre-item:eq(' + i + ')').find('img').attr('data-id'));
}
;
picStr = picArr.join(',');
$('#cover_id_cover').val(picStr);
});
} else {
updateAlert(data.info,'tip_error');
setTimeout(function(){
$('#top-alert').find('button').click();
$(that).removeClass('disabled').prop('disabled',false);
},1500);
}
}
</script>
</block>