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.

204 lines
8.8 KiB
HTML

5 years ago
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<div class="cf main-place top_nav_list navtab_list">
{:W('Index/navigation',array('value'=>'Site/app','compare'=>'Adv/app_adv_pos_lists'))}
<h3 class="page_title">添加广告</h3>
<p class="description_text"></p>
</div>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="tab_nav stabnav17112 jstabnav box_mt">
<ul>
<li data-tab="tab1" class="current"><a href="javascript:void(0);">基础</a></li></li>
</ul></div>
<div class="tab-content tabcon1711 tabcon17112">
<!-- 表单 -->
<form id="form" action="{:U('add_app_adv?model='.$model['id'])}" 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">广告标题:</td>
<td class="r">
<input type="text" class="txt " name="title" value="" >
</td>
</tr>
<tr>
<td class="l">广告链接:</td>
<td class="r">
<input type="text" class="txt " name="url" value="">
</td>
</tr>
<tr>
<td class="l">开始时间:</td>
<td class="r">
<input type="text" class="txt time1" name="start_time" value="" placeholder="默认当前时间">
</td>
</tr>
<tr>
<td class="l">结束时间:</td>
<td class="r">
<input type="text" class="txt time2" name="end_time" value="" placeholder="默认没有时间限制">
</td>
</tr>
<tr>
<td class="l">广告排序:</td>
<td class="r">
<input type="text" class="txt" name="sort" value="0">
</td>
</tr>
<tr>
<td class="l">打开方式:</td>
<td class="r table_radio">
<span class="form_radio">
<label>
<input type="radio" class="inp_radio" value="_blank" name="target" checked="checked"> 新页面
</label>
<label>
<input type="radio" class="inp_radio" value="_self" name="target" > 本页面
</label></span>
</td>
</tr>
<tr class="picbox">
<td class="l"><span style="color:red">*</span>广告图片:</td>
<td class="r"><?php $setWidth=intval($advpos['width']);$setHeight=intval($advpos['height']); ?>
<input type="file" id="upload_picture_pic">
<input type="hidden" name="data" id="pic_id" data-width="{$setWidth}" data-height="{$setHeight}"/>
<div class="upload-img-box">
<notempty name="data['data']">
<div class="upload-pre-item">
<span class="placeholder-graphic placeholder-graphic_adv" style="<if condition='$setWidth egt $setHeight'>width:120px;height:{:intval($setHeight*120/$setWidth)}px<else />width:{:intval($setWidth*120/$setHeight)}px;height:120px;</if>"><img src="{$data['data']|get_cover='path'}"/></span>
</div>
</notempty>
</div>
<span class="infonotice" style="top:20px;" >图片大小为2M以内图片分辨率<notempty name='advpos.width'>{$advpos.width}<else />--</notempty> * <notempty name="advpos.height">{$advpos.height}<else />--</notempty>PX支持PNG、JPG、JPEG格式{:str_replace('广告位','',$advpos['title'])}时显示</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="form-item cf">
<input type='hidden' name="pos_id" value="{:I('pos_id')}" />
<button class=" submit_btn ajax-post 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>
</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="Site/app">
</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">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<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" src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Site/app')}');
//Think.setValue("module", {$data.module|default = 'media'});
$(function(){
$("#game_name").val($("#game_id option:selected").text());
$('.time1').datetimepicker({
format: 'yyyy-mm-dd hh:ii',
language:"zh-CN",
minView:0,startDate:new Date(),
autoclose:true
}).change(function(){
var start = new Date($(this).val()).getTime();
var end = new Date($('.time2').val()).getTime();
if(isNaN(end)) {return false;}
if(start>=end) {layer.msg('开始时间必须小于结束时间');return false;}
return false;
});
$('.time2').datetimepicker({
format: 'yyyy-mm-dd hh:ii',
language:"zh-CN",
minView:0,startDate:new Date(),
autoclose:true
}).change(function(){
var end = new Date($(this).val()).getTime();
var start = new Date($('.time1').val()).getTime();
if(isNaN(start)) {return false;}
if(start>=end) {layer.msg('开始时间必须小于结束时间');return false;}
return false;
});
showTab();
});
$('#submit').click(function(){
$('#form').submit();
});
/* 初始化上传插件 */
$("#upload_picture_pic").uploadify({
"height" : 30,
"swf" : "__STATIC__/uploadify/uploadify.swf",
"fileObjName" : "download",
"buttonText" : "上传图标",
"uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id(),'flag'=>true))}",
"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 setWidth = parseInt($.trim($('#pic_id').attr('data-width'))),setHeight = parseInt($.trim($('#pic_id').attr('data-height')));
var style = '';
if(setWidth>=setHeight) {style = 'width:120px;height:'+parseInt(setHeight*120/setWidth)+'px';} else {style = 'height:120px;width:'+parseInt(setWidth*120/setHeight)+'px';}
$("#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 + '"/></span></div>'
);
} else {
updateAlert(data.info);
setTimeout(function(){
$('#top-alert').find('button').click();
$(that).removeClass('disabled').prop('disabled',false);
},1500);
}
}
</script>
</block>