123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>编辑投稿-{eyou:global name='web_name' /}</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
- <link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
- {eyou:static file="users/skin/css/eyoucms.css"/}
- <!-- 新样式 2020-11-25 -->
- {eyou:static file="users/skin/css/element/index.css" /}
- {eyou:static file="users/skin/css/e-user.css" /}
- {eyou:include file="users/skin/css/diy_css.htm"/}
- {eyou:static file="/public/plugins/layui/css/layui.css" /}
-
- {eyou:static file="/public/static/common/js/jquery.min.js"/}
- {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
- {eyou:static file="/public/static/common/js/tag_global.js"/}
- <script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>
- </head>
- <body class="centre shop">
- <!-- 头部 -->
- {eyou:include file="users/users_header.htm" /}
- <!-- 头部结束 -->
- <div class="breadcrumbs"></div>
- <script type="text/javascript">
- var __lang__ = "<?php echo $admin_lang; ?>";
- window.UEDITOR_HOME_URL = "__ROOT_DIR__/public/plugins/Ueditor/";
- var type20210507 = '';//下载模型的上传类型
- var default_servername20210507 = '';//下载模型的default_servername
- var attr_field20210507 = '';//下载模型的attr_field
- var servername_use20210507 = '';//下载模型的servername_use
- </script>
- {eyou:static file="/public/plugins/Ueditor/ueditor.config.js"/}
- {eyou:static file="/public/plugins/Ueditor/ueditor.all.min.js"/}
- {eyou:static file="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js"/}
-
- {eyou:static file="/public/plugins/laydate/laydate.js"/}
-
- {eyou:static file="/public/plugins/layui/layui.js" /}
-
- <div class="ey-body-bg">
- <div class="ey-body pd0">
- <div class="ey-container w1226">
- <!-- 侧边 -->
- {eyou:include file="users/users_left.htm" /}
- <!-- 侧边结束 -->
- <!-- 中部 -->
- <div class="ey-con fr" >
- <div class="mi-uc-box uc-main-box mi-user-favorite">
- <div class="uc-content-box portal-content-box">
- <div class="uc-context">
- <div class="box-hd">
- <h1 class="title">编辑投稿</h1>
- </div>
- <!-- 顶部导航栏结束 -->
-
- <!-- 内容栏 -->
- <div class="ey-con-forms custom-form mt30">
- <form class="form-horizontal" id="post_form">
- <input type="hidden" name="aid" value="{$ArchivesData.aid}">
- <input type="hidden" name="channel" value="{$channel_id}">
- <input type="hidden" name="old_typeid" value="{$ArchivesData.typeid}">
- <div class="item-from-row">
- <div class="from-row-l">
- <label for="title"><span class="red">*</span> 文章标题:</label>
- </div>
- <div class="from-row-r">
- <input type="text" name="title" id="title" class="el-input__inner w500" maxlength="100" value="{$ArchivesData.title}">
- </div>
- </div>
- <div class="item-from-row">
- <div class="from-row-l">
- <label for="title"><span class="red">*</span> 所属栏目:</label>
- </div>
- <div class="from-row-r">
- <div class="w300 select">
- {$arctype_html}
- </div>
- </div>
- </div>
- <div class="item-from-row">
- <div class="from-row-l">
- <label for="title">TAG标签:</label>
- </div>
- <div class="from-row-r">
- <input type="text" value="{$ArchivesData.tags}" name="tags" id="tags" class="el-input__inner w500" placeholder="多个标签之间用逗号隔开">
- </div>
- </div>
- <!-- 单张图 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- <label for="title">缩略图:</label>
- </div>
- <div class="from-row-r">
-
- <a href="javascript:void(0);" onclick="$('#litpicOnclick').trigger('click');" class="img-upload" title="点击上传">
- <div class="y-line" id="litpicYline" {notempty name='$ArchivesData.litpic'} style="display: none;" {/notempty}></div>
- <div class="x-line" id="litpicXline" {notempty name='$ArchivesData.litpic'} style="display: none;" {/notempty}></div>
- <img src="{$ArchivesData.litpic}" id="litpicImgSrc" class="none" {notempty name='$ArchivesData.litpic'} style="display: block;" {/notempty}>
- </a>
- <input type="hidden" name="litpic_inpiut" id="litpicInpiut" value="{$ArchivesData.litpic}">
- <input type="file" name="litpic_inpiut_file" id="litpicOnclick" onchange="litpicOnclickFile(this);" style="display: none;">
- </div>
- </div>
- <script type="text/javascript">
- function litpicOnclickFile(obj) {
- var file = $(obj)[0].files[0];
- if (!file) return false;
- var formData = new FormData();
- formData.append('_ajax', 1);
- formData.append('file', file);
- formData.append('compress', '1000-1000');
- $.ajax({
- type: 'post',
- url: eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
- data: formData,
- contentType: false,
- processData: false,
- dataType: 'json',
- success: function (res) {
- layer.closeAll();
- if (res.state == 'SUCCESS') {
- $("#litpicInpiut").val(res.url);
- $('#litpicYline, #litpicXline').hide();
- $("#litpicImgSrc").attr('src', res.url);
- } else {
- showErrorAlert(res.state);
- }
- },
- error: function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- })
- }
- </script>
- <!-- 单张图 end -->
- <div id="xiazai">
- {eyou:include file="users/article_download_edit.htm" /}
- </div>
- <!--视频模型-->
- <div id="shipin">
- {eyou:include file="users/article_media_edit.htm" /}
- </div>
- <div class="item-from-row" style="display: none;" id="tupianji">
- <div class="from-row-l">
- <label>图片集:</label>
- </div>
- <div class="from-row-r">
- <div class="images_upload_main" id="tab_imgupload">
- <!-- <a href="javascript:void(0);" onClick="GetUploadify(30,'','allimg','imgupload_call_back');" class="el-button el-button--primary is-plain el-button--small" title="拖动修改排序">
- <i class="el-icon-picture"></i>上传图片
- </a> -->
- <div class="sort-list images_upload_list" >
- {volist name="imgupload_list" id="vo" key="k"}
- <div class="images_upload">
- <div class="images_upload_item">
- <input type="hidden" name="imgupload[]" value="{$vo['image_url']}">
- <a href="{$vo['image_url']}" onclick="" title="拖动修改排序">
- <img src="{$vo['image_url']}" width="120" height="120">
- </a>
- <a href="javascript:void(0)" onclick="ClearPicArr2(this,'{$vo['image_url']}')" class="delete" title="删除"></a>
- </div>
- <textarea rows="5" cols="60" name="imgintro[]" style="height:28px; width: 120px;" placeholder="图片注释" title="标签调用:{literal}{$field.intro}{/literal}">{$vo.intro}</textarea>
- </div>
- {/volist}
- <div class="images_upload">
- </div>
- </div>
- <a href="javascript:void(0);" onClick="GetUploadify(30,'','allimg','imgupload_call_back');" class="img-upload" title="点击上传">
- <div class="y-line"></div>
- <div class="x-line"></div>
- </a>
- </div>
- <!-- 上传图片显示的样板 start -->
- <div class="images_upload_tpl none">
- <div class="images_upload">
- <div class="images_upload_item">
- <input type="hidden" name="imgupload[]" value="" />
- <a href="javascript:void(0);" onClick="" title="拖动修改排序">
- <img src="__STATIC__/admin/images/add-button.jpg" width="120" height="120" />
- </a>
- <a href="javascript:void(0)" class="delete" title="删除"> </a>
- </div>
- <textarea rows="5" cols="60" name="imgintro[]" style="height:28px; width: 120px;" placeholder="图片注释" ></textarea>
-
- </div>
- </div>
- <!-- 上传图片显示的样板 end -->
- </div>
- </div>
- <script type="text/javascript">
-
- $(function(){
- if ($("#tab_imgupload input[type=hidden]").length > 0) {
- $('#tab_imgupload .images_upload_list').show();
- } else {
- $('#tab_imgupload .images_upload_list').hide();
- }
- });
-
- // 单图上传 2021.01.05
- function upload_single_pic_1609837252(e,input_id){
- var file = $(e)[0].files[0];
- if (!file) {
- return false;
- }
- var formData = new FormData();
- formData.append('file',file);
- formData.append('compress', '1000-1000');
- formData.append('_ajax',1);
- layer_loading('正在处理');
- $.ajax({
- type: 'post',
- url: eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
- data: formData,
- contentType: false,
- processData: false,
- dataType: 'json',
- success: function (res) {
- if (res.state == 'SUCCESS') {
- $("#single_pic_input_"+input_id).val(res.url)
- $(".img1_"+input_id).attr('src',res.url);
- layer.closeAll();
- } else {
- layer.closeAll();
- showErrorAlert(res.state);
- }
- },
- error : function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- })
- }
-
- function img_call_back(fileurl_tmp)
- {
- $("#litpic_local").val(fileurl_tmp);
- $("#img_a").attr('href', fileurl_tmp);
- $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
- $("input[name=is_litpic]").attr('checked', true); // 自动勾选属性[图片]
- }
-
- // 上传图集相册回调函数
- function imgupload_call_back(paths){
-
- var last_div = $(".images_upload_tpl").html();
- // var last_div = $(".images_upload:last").prop("outerHTML");
- for (var i=0;i<paths.length ;i++ )
- {
- $(".images_upload:eq(0)").before(last_div); // 插入一个 新图片
- $(".images_upload:eq(0)").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
- $(".images_upload:eq(0)").find('img').attr('src',paths[i]);// 修改他的图片路径
- $(".images_upload:eq(0)").find('a:eq(1)').attr('onclick',"ClearPicArr2(this,'"+paths[i]+"')").text('');
- $(".images_upload:eq(0)").find('input').val(paths[i]); // 设置隐藏域 要提交的值
- }
-
- if ($("#tab_imgupload input[type=hidden]").length > 0) {
- $('#tab_imgupload .images_upload_list').show();
- }
- }
- /*
- * 上传之后删除组图input
- * @access public
- * @val string 删除的图片input
- */
- function ClearPicArr2(obj,path)
- {
- // 删除数据库记录
- $.ajax({
- type:'POST',
- url:"{:url('user/UsersRelease/del_channelimgs', ['_ajax'=>1])}",
- data:{filename:path},
- success:function(){
- $(obj).parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
- if ($("#tab_imgupload input[type=hidden]").length == 0) {
- $('#tab_imgupload .images_upload_list').hide();
- }
- $.ajax({
- type:'POST',
- url:"{:url('Uploadify/delupload', ['_ajax'=>1])}",
- data:{action:"del", filename:path},
- success:function(){}
- });
- }
- });
- }
-
- /** 以下 图集相册的拖动排序相关 js*/
-
- $( ".sort-list" ).sortable({
- start: function( event, ui) {
-
- }
- ,stop: function( event, ui ) {
- }
- });
- //因为他们要拖动,所以尽量设置他们的文字不能选择。
- $( ".sort-list" ).disableSelection();
- </script>
- <span id="FieldAddonextitem"></span>
- <script type="text/javascript">
- $(function() {
- var typeidNew = {$ArchivesData.typeid|default='0'};
- var aidNew = {$ArchivesData.aid|default='0'};
- GetAddonextitem(0, typeidNew, aidNew, false);
-
- $('#typeid').change(function() {
- GetAddonextitem(1, $(this).val(), aidNew, true);
- });
- });
-
- function GetAddonextitem(init, typeidNew, aidNew, is_destroy) {
- var channel = $("#typeid option:selected").attr('data-channel');
- $("input[name='channel']").val(channel);
- if (3 == channel){
- $("#tupianji").show();
- $("#xiazai").hide();
- $("#shipin").hide();
- }else if (4 == channel){
- $("#tupianji").hide();
- $("#xiazai").show();
- $("#shipin").hide();
- }else if (5 == channel){
- $("#tupianji").hide();
- $("#xiazai").hide();
- $("#shipin").show();
- }else{
- $("#tupianji").hide();
- $("#xiazai").hide();
- $("#shipin").hide();
- }
- var loadingTxt = '正在加载';
- if (1 == init) {
- loadingTxt = '正在切换';
- }
- layer_loading(loadingTxt);
-
- $.ajax({
- url: "{:url('user/UsersRelease/get_addonextitem')}",
- data: {typeid: typeidNew, aid: aidNew, _ajax:1},
- type:'post',
- success:function(res) {
- layer.closeAll();
- if (res.code == 0) {
- showErrorAlert(res.msg);
- } else {
- $('#FieldAddonextitem').empty().html(res.data.html);
- if (1 == init) {
- $.each(res.data.htmltextField, function (index, value) {
- showEditor_1597892187('addonFieldExt_'+value);
- });
- }
- if (4 == channel) {
- var download = res.data.download;
- var users_level_html = '<option value="0" selected>不限会员</option>';
- $.each(download.users_level, function (index, value) {
- if ('{$ArchivesData.arc_level_id}' == value.level_id) {
- users_level_html += '<option value="'+value.level_id+'" selected>'+value.level_name+'</option>\n';
- }else{
- users_level_html += '<option value="'+value.level_id+'">'+value.level_name+'</option>\n';
- }
- });
- $('#arc_level_id').html(users_level_html);
-
- if('local' != download.upload_flag){
- //第三方
- var upload_button_html = '<button type="button" class="el-button el-button--primary is-plain el-button--small" style="position: relative;z-index: 1;">\n选择多文件\n' +
- ' <input type="file" name="file" id="'+download.upload_flag+'File" multiple="multiple" onchange="'+download.upload_flag+'_download__upload(this);" style="position: absolute;top: 0;right: 0;opacity: 0;width: 110px;height: 30px;"/>\n' +
- ' </button>';
- $('#download-layui-upload').prepend(upload_button_html);
- }else{
- $("#buttonList").show();
- }
- $('#download-layui-upload').attr('data-type',download.upload_flag);
- if (1 == download.servername_use){
- $(".th_server_name").show();
- }
- type20210507 = download.basic.file_type;
- default_servername20210507 = download.default_servername;
- attr_field20210507 = download.attr_field;
- servername_use20210507 = download.servername_use;
-
- var downfile_list = '{$downfile_list|default=""}';
- downfile_list = JSON.parse(downfile_list);
-
- $("#remote-file-checkbox").prop("checked",true);
- var template_div_remote20210507_html = '';
- var demoList_html = '';
- var i = 1;
- var n = 1;
- $.each(downfile_list, function (index, v) {
- if (1 == v.is_remote) {
- template_div_remote20210507_html += '<div class="template_div20210507"><div class="addrs">远程地址'+i+':<input type="text" name="remote_file[]" value="'+v.file_url+'" placeholder="http://"></div>\n' ;
- $.each(attr_field20210507, function (index, value) {
- var field_use_style = '';
- if(1 != value.field_use){
- field_use_style = ' style="display: none;" ';
- }
- if('server_name' == value.field_name){
- template_div_remote20210507_html += '<span class="ey_'+value.field_name+'" '+field_use_style+'>\n' +
- '<span class="title_'+value.field_name+'">'+value.field_title+'</span>:' +
- '<input type="text" name="'+value.field_name+'[]" id="'+value.field_name+'_remote_'+i+'" onclick="searchServername(this);" autocomplete="off" value="'+v[value.field_name]+'" >\n' +
- '<div class="help-hot-list remote-hot-list" style="display: none;" data-test_val="5434" id="search_keywords_list_'+value.field_name+'_remote_'+i+'"></div>\n' +
- '</span>\n' ;
- }else{
- template_div_remote20210507_html += '<span class="ey_'+value.field_name+'" '+field_use_style+'>\n' +
- '<span class="title_'+value.field_name+'">'+value.field_title+'</span>:' +
- '<input type="text" name="'+value.field_name+'[]" id="'+value.field_name+'_remote_'+i+'" value="'+v[value.field_name]+'"></span>\n' ;
- }
- });
- template_div_remote20210507_html += '</div>';
- i++;
- }else{
- var servername_html = '';
- if (servername_use20210507 != 1) {
- servername_html = " style=\"display: none;\" ";
- }
- demoList_html += '<tr><td><a href="'+v.file_url+'" >'+v.file_name+'</a></td>\n' +
- ' <td class="th_server_name" '+servername_html+'>\n' +
- ' <input type="text" name="fileupload[server_name][]" value="'+v.server_name+'" id="servername_local_'+n+'" onclick="searchServername(this);" autocomplete="off">\n' +
- ' <div class="help-hot-list" style="display: none;" id="search_keywords_list_servername_local_'+n+'"></div>\n' +
- ' </td>\n' +
- ' <td>'+v.file_size+'</td>\n' +
- ' <td><span style="color: #5FB878;">上传成功</span></td>\n' +
- ' <td>\n' +
- ' <a class="fc-colours cursor-pointer" onclick="DeleteFile(this)">移除</a>\n' +
- ' <input type="hidden" name="fileupload[file_url][]" value="'+v.file_url+'">\n' +
- ' <input type="hidden" name="fileupload[file_mime][]" value="'+v.file_mime+'">\n' +
- ' <input type="hidden" name="fileupload[file_name][]" value="'+v.file_name+'">\n' +
- ' <input type="hidden" name="fileupload[file_ext][]" value="'+v.file_ext+'">\n' +
- ' <input type="hidden" name="fileupload[file_size][]" value="'+v.file_size+'">\n' +
- ' <input type="hidden" name="fileupload[uhash][]" value="'+v.uhash+'">\n' +
- ' <input type="hidden" name="fileupload[md5file][]" value="'+v.md5file+'">\n' +
- ' </td></tr>'
- n++;
- }
- });
- if ("{$is_remote_file}" == 1){
- $("#Template20210507").html(template_div_remote20210507_html);
- $('#ClickRemoteFile').show();
- }
- $("#demoList").html(demoList_html);
-
- }
- }
- },
- error: function(e){
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- }
- </script>
-
- <div class="item-from-row" style="border-bottom:none;">
- <div class="from-row-l"> </div>
- <div class="from-row-r">
- <input type="hidden" name="old_arcrank" value="{$ArchivesData.arcrank}">
- <input type="button" data-url="{:url('UsersRelease/article_edit')}" onclick="EditArticle(this);" class="el-button el-button--primary " value="确认提交"/>
- </div>
- </div>
- <!-- 表单验证 -->
- {$TokenValue}
- </form>
- </div>
- <!-- 内容栏结束 -->
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- // 去除 select中值相同的option(去重),配合{$arctype_html}使用
- $(function(){
- var channel = $("#typeid option:selected").attr('data-channel');
- if (channel == 3){
- $("#tupianji").show()
- }
- $("#typeid option").each(function() {
- var val = $(this).val();
- if ($("#typeid option[value='" + val + "']").length > 1){
- $("#typeid option[value='" + val + "']:eq(0)").remove();
- }
- });
- });
-
- function MobileAddArticle(url = null){
- $.getScript('__ROOT_DIR__/public/plugins/layer_mobile/layer.js?v={$version}', function(){
- // 提示信息,2秒自动关闭
- function MsgOpen(msgs){
- layer.open({
- content: msgs,
- skin: 'msg',
- time: 2,
- });
- }
- // 提示动画
- function LoaDing(){
- var loading = layer.open({
- type:2,
- content: '正在处理',
- });
- return loading;
- }
-
- OnMobileAddArticle();
- function OnMobileAddArticle(){
- if (!$('#title').val()) {
- MsgOpen('请填写文章标题!');
- $('#title').focus();
- return false;
- }
-
- if (0 == $('#typeid').val()) {
- MsgOpen('请选择所属栏目!');
- $('#typeid').focus();
- return false;
- }
- LoaDing();
- $.ajax({
- url: url,
- data: $('#post_form').serialize(),
- type:'post',
- dataType:'json',
- success:function(res){
- layer.closeAll();
- if (1 == res.code) {
- MsgOpen(res.msg);
- window.location.href = res.url;
- } else {
- MsgOpen(res.msg);
- if (res.data) $('#'+res.data).focus();
- }
- }
- });
- }
- })
- }
-
- function EditArticle(obj){
- var url = $(obj).attr('data-url');
-
- if (!$('#title').val()) {
- layer.msg('请填写文章标题!', {time: 1500, icon: 5});
- $('#title').focus();
- return false;
- }
- if (0 == $('#typeid').val()) {
- layer.msg('请选择所属栏目!', {time: 1500, icon: 5});
- $('#typeid').focus();
- return false;
- }
-
- var channel = $("#typeid option:selected").attr('data-channel');
- $("input[name='channel']").val(channel);
- if (5 == channel){
- urlToStr();
- }
-
- layer_loading('正在处理');
- $.ajax({
- url: url,
- data: $('#post_form').serialize(),
- type:'post',
- dataType:'json',
- success:function(res){
- layer.closeAll();
- if (1 == res.code) {
- layer.msg(res.msg, {time: 1000},function(){
- window.location.href = res.url;
- });
- } else {
- layer.msg(res.msg, {time: 1500, icon: 5});
- if (res.data) $('#'+res.data).focus();
- }
- },
- error : function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
-
- }
-
- function litpic_call_back(fileurl_tmp)
- {
- $("#litpic_inpiut").val(fileurl_tmp);
- $("#litpic_img").attr('src', fileurl_tmp);
- }
-
- </script>
- {eyou:include file="users/users_footer.htm" /}
-
- <!-- 底部结束 -->
|