|
|
<extend name="Public/promote_base"/>
|
|
|
<block name="css">
|
|
|
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
|
|
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
|
|
<link href="__CSS__/20180207/mixed.css" rel="stylesheet">
|
|
|
<style>
|
|
|
.notice_tip {padding-left:20px;color:#999;font-size:12px;} .formtxt{display:inline-block;width:266px;}
|
|
|
.trunk-list .table2 .r .short {width:122px;}
|
|
|
</style>
|
|
|
</block>
|
|
|
|
|
|
<block name="body">
|
|
|
<div class="page-form normal_list siteGift-add-form">
|
|
|
<div class="trunk-title">
|
|
|
<div class="location">
|
|
|
<div class="location-container">当前位置:<span>联盟站点></span><span>广告列表></span><span>{$meta_title}</span></div>
|
|
|
</div>
|
|
|
<img src="__IMG__/20180207/icon_normal_qqqun.png"><span class="title_main">{$meta_title}</span>
|
|
|
</div>
|
|
|
<div class="trunk-content article">
|
|
|
<div class="trunk-list">
|
|
|
<form action="" novalidate="novalidate" method="post" id="data2">
|
|
|
<table class="table2">
|
|
|
<tr>
|
|
|
<td class="l">广告位置:</td>
|
|
|
<td class="r">
|
|
|
<select name="pos_id" id="pos_id" class="reselect select_gallery" style="width:262px;">
|
|
|
<volist name="position" id="vo">
|
|
|
<option value="{$vo.id}" data-width="{$vo.width}" data-height="{$vo.height}">{:str_replace('联盟站点','',$vo['title'])}</option>
|
|
|
</volist>
|
|
|
</select>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="l"><span class="must_style">*</span>广告标题:</td>
|
|
|
<td class="r">
|
|
|
<input name="title" class="name txt" id="title" type="" value="">
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="l">广告链接:</td>
|
|
|
<td class="r">
|
|
|
<input name="url" class="name txt" id="url" value="">
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="l">有效周期:</td>
|
|
|
<td class="r">
|
|
|
<span class="">
|
|
|
<input type="text" class="txt short time" name="start_time" value="" placeholder="开始时间">
|
|
|
</span>-
|
|
|
<span class="">
|
|
|
<input type="text" class="txt short time" name="end_time" value="" placeholder="结束时间">
|
|
|
</span>
|
|
|
<span class="notice_tip">默认没有时间限制</span>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td class="l">广告排序:</td>
|
|
|
<td class="r">
|
|
|
<input name="sort" class="name txt" id="sort" value="0">
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="l">打开方式:</td>
|
|
|
<td class="r form-radio jspayradio">
|
|
|
<label><input type="radio" name="target" class="name txt" value="_blank" checked="checked"><i></i><span>新页面</span></label>
|
|
|
<label><input type="radio" name="target" class="name txt" value="_self"><i></i><span>本页面</span></label>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="l"><span class="must_style">*</span>广告图:</td>
|
|
|
<td class="r">
|
|
|
<span class="formtxt">
|
|
|
<div class="upload-img-box">
|
|
|
<notempty name="data['data']">
|
|
|
<div class="upload-pre-item">
|
|
|
<span class="placeholder-graphic placeholder-graphic_adv">
|
|
|
<img src="{$data['data']|get_cover='path'}" style="width:100%"/>
|
|
|
</span>
|
|
|
</div>
|
|
|
</notempty>
|
|
|
</div>
|
|
|
<input type="file" id="upload_picture_pic" name="upload_picture">
|
|
|
<input type="hidden" name="data" id="pic_id"/>
|
|
|
</span>
|
|
|
<span class="notice_tip pic-size"></span>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="l"></td>
|
|
|
<td class="r">
|
|
|
<button type="button" class="tjbnt btn" onclick="save()">保存</button>
|
|
|
<a class="back_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();">返回</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</form>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</block>
|
|
|
<block name="script">
|
|
|
<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" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
|
|
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
$(function() {
|
|
|
|
|
|
$('.time').datetimepicker({
|
|
|
scrollMonth:false,
|
|
|
scrollTime:false,
|
|
|
scrollInput:false,
|
|
|
timepicker:true,
|
|
|
format: 'yyyy-mm-dd hh:ii',
|
|
|
language:"zh-CN",
|
|
|
autoclose:true,hour: 13,
|
|
|
minute: 15,
|
|
|
});
|
|
|
|
|
|
$(".select_gallery").select2();
|
|
|
|
|
|
$('.jspayradio input:checked').siblings('i').addClass('current');
|
|
|
|
|
|
$('.jspayradio input').click(function() {
|
|
|
var that=$(this);
|
|
|
$('.jspayradio i').removeClass('current');
|
|
|
if (that.prop('checked')) {
|
|
|
that.siblings('i').addClass('current');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
var pi = $('#pos_id option:selected');
|
|
|
$('.pic-size').text('('+pi.attr('data-width')+'*'+pi.attr('data-height')+')');
|
|
|
|
|
|
$('#pos_id').change(function() {
|
|
|
var option = $(this).find('option:selected');
|
|
|
|
|
|
$('.pic-size').text('('+option.attr('data-width')+'*'+option.attr('data-height')+')');
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
/* 初始化上传插件 */
|
|
|
$("#upload_picture_pic").uploadify({
|
|
|
"height" : 30,
|
|
|
"swf" : "__STATIC__/uploadify/uploadify.swf",
|
|
|
"fileObjName" : "download",
|
|
|
"buttonText" : "上传图标",
|
|
|
"uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
|
|
|
"width" : 120,
|
|
|
'removeTimeout' : 1,
|
|
|
'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
|
|
|
"onUploadSuccess" : upload_picture_pic{$field.name},
|
|
|
'onFallback' : function() {
|
|
|
alert('未检测到兼容版本的Flash.');
|
|
|
}
|
|
|
});
|
|
|
function upload_picture_pic{$field.name}(file, data){
|
|
|
var data = $.parseJSON(data);
|
|
|
var src = '';
|
|
|
if(data.status){
|
|
|
$("#pic_id").val(data.id);
|
|
|
src = data.url || '__ROOT__' + data.path;
|
|
|
//var pi = $('#pos_id option:selected');
|
|
|
//var setWidth = parseInt($.trim(pi.attr('data-width')));
|
|
|
//var setHeight = parseInt($.trim(pi.attr('data-height')));
|
|
|
//var style = 'width:266px;height:'+(setHeight*266/setWidth)+'px';
|
|
|
style = 'width:266px;';
|
|
|
$("#pic_id").parent().find('.upload-img-box').html(
|
|
|
'<div class="upload-pre-item"><span class="placeholder-graphic placeholder-graphic_adv" style="'+style+'"><img src="' + src + '" style="width:100%"/></span></div>'
|
|
|
);
|
|
|
} else {
|
|
|
updateAlert(data.info);
|
|
|
setTimeout(function(){
|
|
|
$('#top-alert').find('button').click();
|
|
|
$(that).removeClass('disabled').prop('disabled',false);
|
|
|
},1500);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var sub = true;
|
|
|
function save() {
|
|
|
if(!sub){
|
|
|
return false;
|
|
|
}
|
|
|
if($('#group_code').val()==''){
|
|
|
layer.msg('请填写QQ群号', {icon: 2});
|
|
|
return false;
|
|
|
}
|
|
|
if($('#in_num').val()==''){
|
|
|
layer.msg('请填写入驻人数', {icon: 2});
|
|
|
return false;
|
|
|
}
|
|
|
var data = $("#data2").serialize();
|
|
|
sub = false;
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
url: "{:U('add')}",
|
|
|
dataType: "json",
|
|
|
data: data,
|
|
|
success: function (res) {
|
|
|
if (res.status != 0) {
|
|
|
layer.msg(res.info, {icon: 1});
|
|
|
setTimeout(function () {
|
|
|
location.href = "{:U('index')}";
|
|
|
},1000)
|
|
|
}
|
|
|
else {
|
|
|
sub = true;
|
|
|
if(res.info=='添加失败:该游戏已经存在'){
|
|
|
layer.msg('添加失败:该游戏已经拥有QQ群号', {icon: 2});
|
|
|
return false;
|
|
|
}else{
|
|
|
layer.msg(res.info, {icon: 2});
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.msg('服务器故障', {icon: 5});
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
//导航高亮
|
|
|
highlight_subnav('{:U('index')}');
|
|
|
</script>
|
|
|
</block>
|