You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

332 lines
14 KiB

2 years ago
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="style/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="style/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="style/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="style/lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link href="style/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
{literal}
<script type="text/javascript">
function check(f){
if(Trim(f.news_title.value) == "" ){
alert('新闻标题不能为空!');
return false;
}
}
</script>
{/literal}
<title>修改新闻</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe616;</i> 新闻管理 <span class="c-gray en">&gt;</span> 新闻列表管理 <span class="c-gray en">&gt;</span> 修改新闻 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="#" onclick="location.href='index.php?module=newslist';" title="关闭" ><i class="Hui-iconfont">&#xe6a6;</i></a></nav>
<div class="pd-20">
<form name="form1" action="index.php?module=newslist&action=modify" class="form form-horizontal" method="post" onsubmit="return check(this);" enctype="multipart/form-data" >
<input type="hidden" name="id" value="{$id}" />
<input type="hidden" name="editable" value="true" />
<input type="hidden" name="uploadImg" value="{$uploadImg}" >
<div class="row cl">
<label class="form-label col-2"><span class="c-red"></span>新闻标题:</label>
<div class="formControls col-10">
<input type="text" class="input-text" name="news_title" value="{$news_title}" placeholder="" id="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-2"><span class="c-red"></span>新闻类别:</label>
<div class="formControls col-2"> <span class="select-box">
<select name="news_class" id="news_class" class="select">
<option selected="selected" value="0">请选择类别</option>
{foreach from=$ctypes item=item name=f1}
<option value="{$item->cat_id}"
{if $item->cat_id == $news_class} selected="selected"
{else}{/if}>{$item->cat_name}
</option>
{/foreach}
</select>
</span>
</div>
</div>
<div class="row cl">
<label class="form-label col-2"><span class="c-red"></span>作者:</label>
<div class="formControls col-2">
<input type="text" class="input-text" value="{$author}" placeholder="" id="" name="author">
</div>
</div>
<div class="row cl">
<label class="form-label col-2">排序号:</label>
<div class="formControls col-2">
<input type="text" class="input-text" value="{$sort}" placeholder="" id="" name="sort">
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">新闻图片:</label>
<div class="formControls col-xs-8 col-sm-4">
{if $imgurl != ''}
<img id="thumb_url0" src='{$uploadImg}{$imgurl}' style="height:100px;width:150">
{else}
<img id="thumb_url0" src='{$uploadImg}nopic.jpg' style="height:100px;width:150">
{/if}
<input type="hidden" id="picurl0" name="imgurl" datatype="*" nullmsg="请选择图片"/>
<input type="hidden" name="oldpic0" value={$imgurl}>
<button class="btn btn-success" id="image0" type="button" >选择图片</button>
</div>
<div class="col-4"> </div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">推广二维码图片:</label>
<div class="formControls col-xs-8 col-sm-4">
{if $t_link != ''}
<img id="thumb_url1" src='{$uploadImg}{$t_link}' style="height:100px;width:150">
{else}
<img id="thumb_url1" src='../LKT/images/nopic.jpg' style="height:100px;width:150">
{/if}
<input type="hidden" id="picurl1" name="t_link" datatype="*" nullmsg="请选择图片"/>
<input type="hidden" name="oldpic1" value={$t_link}>
<button class="btn btn-success" id="image1" type="button" >选择图片</button>
</div>
<div class="col-4"> </div>
</div>
<div class="row cl">
<label class="form-label col-2">新闻内容:</label>
<div class="formControls col-10">
<script id="editor" type="text/plain" style="width:100%;height:400px;" name="content">{$content}</script>
</div>
</div>
<div class="row cl">
<div class="col-10 col-offset-2">
<button class="btn btn-primary radius" type="submit" name="Submit"><i class="Hui-iconfont">&#xe632;</i> 提 交</button>
<button class="btn btn-secondary radius" type="reset" name="reset"><i class="Hui-iconfont">&#xe632;</i> 重 写</button>
</div>
</div>
</form>
</div>
<div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:999;width:100%;height:100%;display:none;"><div id="innerdiv" style="position:absolute;"><img id="bigimg" src="" /></div></div>
<script type="text/javascript" src="modpub/js/check.js" > </script>
<script type="text/javascript" src="style/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="style/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="style/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="style/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="style/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="style/lib/webuploader/0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="style/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="style/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="style/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="style/js/H-ui.js"></script>
<script type="text/javascript" src="style/js/H-ui.admin.js"></script>
<!-- 新增编辑器引入文件 -->
<link rel="stylesheet" href="style/kindeditor/themes/default/default.css" />
<script src="style/kindeditor/kindeditor-min.js"></script>
<script src="style/kindeditor/lang/zh_CN.js"></script>
{literal}
<script type="text/javascript">
$(function(){
$(".pimg").click(function(){
var _this = $(this);//将当前的pimg元素作为_this传入函数
imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
});
});
function imgShow(outerdiv, innerdiv, bigimg, _this){
var src = _this.attr("src");//获取当前点击的pimg元素中的src属性
$(bigimg).attr("src", src);//设置#bigimg元素的src属性
/*获取当前点击图片的真实大小,并显示弹出层及大图*/
$("<img/>").attr("src", src).load(function(){
var windowW = $(window).width();//获取当前窗口宽度
var windowH = $(window).height();//获取当前窗口高度
var realWidth = this.width;//获取图片真实宽度
var realHeight = this.height;//获取图片真实高度
var imgWidth, imgHeight;
var scale = 0.8;//缩放尺寸,当图片真实宽度和高度大于窗口宽度和高度时进行缩放
if(realHeight>windowH*scale) {//
imgHeight = windowH*scale;//如大于窗口高度,图片高度进行缩放
imgWidth = imgHeight/realHeight*realWidth;//等比例缩放宽度
if(imgWidth>windowW*scale) {//
imgWidth = windowW*scale;//再对宽度进行缩放
}
} else if(realWidth>windowW*scale) {//
imgWidth = windowW*scale;//如大于窗口宽度,图片宽度进行缩放
imgHeight = imgWidth/realWidth*realHeight;//等比例缩放高度
} else {//
imgWidth = realWidth;
imgHeight = realHeight;
}
$(bigimg).css("width",imgWidth);//以最终的宽度对图片缩放
var w = (windowW-imgWidth)/2;//计算图片与窗口左边距
var h = (windowH-imgHeight)/2;//计算图片与窗口上边距
$(innerdiv).css({"top":h, "left":w});//设置#innerdiv的top和left属性
$(outerdiv).fadeIn("fast");//淡入显示#outerdiv及.pimg
});
$(outerdiv).click(function(){//
$(this).fadeOut("fast");
});
}
$(function(){
$('.skin-minimal input').iCheck({
checkboxClass: 'icheckbox-blue',
radioClass: 'iradio-blue',
increaseArea: '20%'
});
$list = $("#fileList"),
$btn = $("#btn-star"), // 开始上传的id名称
state = "pending",
uploader;
var uploader = WebUploader.create({
auto: true,
swf: 'style/lib/webuploader/0.1.5/Uploader.swf',
// 文件接收服务端。
server: 'http://lib.h-ui.net/webuploader/0.1.5/server/fileupload.php',
// 选择文件的按钮。可选。
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
pick: '#filePicker',
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
resize: false,
// 只允许选择图片文件。
accept: {
title: 'Images',
extensions: 'gif,jpg,jpeg,bmp,png',
mimeTypes: 'image/*'
}
});
uploader.on( 'fileQueued', function( file ) {
var $li = $(
'<div id="' + file.id + '" class="item">' +
'<div class="pic-box"><img></div>'+
'<div class="info">' + file.name + '</div>' +
'<p class="state">等待上传...</p>'+
'</div>'
),
$img = $li.find('img');
$list.append( $li );
// 创建缩略图
// 如果为非图片文件,可以不用调用此方法。
// thumbnailWidth x thumbnailHeight 为 100 x 100
uploader.makeThumb( file, function( error, src ) {
if ( error ) {
$img.replaceWith('<span>不能预览</span>');
return;
}
$img.attr( 'src', src );
}, thumbnailWidth, thumbnailHeight );
});
// 文件上传过程中创建进度条实时显示。
uploader.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress-box .sr-only');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress-box"><span class="progress-bar radius"><span class="sr-only" style="width:0%"></span></span></div>').appendTo( $li ).find('.sr-only');
}
$li.find(".state").text("上传中");
$percent.css( 'width', percentage * 100 + '%' );
});
// 文件上传成功,给item添加成功class, 用样式标记上传成功。
uploader.on( 'uploadSuccess', function( file ) {
$( '#'+file.id ).addClass('upload-state-success').find(".state").text("已上传");
});
// 文件上传失败,显示上传出错。
uploader.on( 'uploadError', function( file ) {
$( '#'+file.id ).addClass('upload-state-error').find(".state").text("上传出错");
});
// 完成上传完了,成功或者失败,先删除进度条。
uploader.on( 'uploadComplete', function( file ) {
$( '#'+file.id ).find('.progress-box').fadeOut();
});
uploader.on('all', function (type) {
if (type === 'startUpload') {
state = 'uploading';
} else if (type === 'stopUpload') {
state = 'paused';
} else if (type === 'uploadFinished') {
state = 'done';
}
if (state === 'uploading') {
$btn.text('暂停上传');
} else {
$btn.text('开始上传');
}
});
$btn.on('click', function () {
if (state === 'uploading') {
uploader.stop();
} else {
uploader.upload();
}
});
var ue = UE.getEditor('editor');
});
function mobanxuanze(){
}
</script>
<script>
KindEditor.ready(function(K) {
var editor = K.editor({
allowFileManager : true,
uploadJson : "index.php?module=system&action=uploadImg", //上传功能
fileManagerJson : 'kindeditor/php/file_manager_json.php', //网络空间
});
//上传背景图片
K('#image0').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
//showRemote : false, //网络图片不开启
//showLocal : false, //不开启本地图片上传
imageUrl : K('#picurl0').val(),
clickFn : function(url, title, width, height, border, align) {
K('#picurl0').val(url);
$('#thumb_url0').attr("src",url);
editor.hideDialog();
}
});
});
});
//上传背景图片
K('#image1').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
//showRemote : false, //网络图片不开启
//showLocal : false, //不开启本地图片上传
imageUrl : K('#picurl1').val(),
clickFn : function(url, title, width, height, border, align) {
K('#picurl1').val(url);
$('#thumb_url1').attr("src",url);
editor.hideDialog();
}
});
});
});
});
</script>
{/literal}
</body>
</html>