123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360 |
- <!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/basic.css"/}
- {eyou:static file="users/skin/css/eyoucms.css"/}
- <!-- 新样式 2020-12-8 -->
- {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"/}
- {eyou:static file="/public/static/common/js/mobile_global.js"/}
- </head>
-
- <body>
- <script type="text/javascript">
- var eyou_basefile = "{$Request.baseFile}";
- window.UEDITOR_HOME_URL = "__ROOT_DIR__/public/plugins/Ueditor/";
- var type20210507 = '';//下载模型的上传类型
- var attr_field20210507 = '';//下载模型的attr_field
- var servername_use20210507 = '';//下载模型的servername_use
- var default_servername20210507 = '';//下载模型的default_servername
- </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-header-status">
- <div class="header-status-l">
- <a href="javascript:history.go(-1);"><i class="el-icon-arrow-left"></i></a>
- </div>
- <div class="header-status-m">{$MenuTitle}</div>
- <div class="header-status-r">
- <a href="{eyou:url link='user/Users/index' /}"><i class="el-icon-user"></i></a>
- </div>
- </div>
- <div class="h50"></div>
-
- <div class="ey-container">
- <form id="post_form">
- <input type="hidden" name="channel" value="{$channel_id}">
- <input type="hidden" name="aid" value="{$ArchivesData.aid}">
- <input type="hidden" name="old_arcrank" value="{$ArchivesData.arcrank}">
- <input type="hidden" name="old_typeid" value="{$ArchivesData.typeid}">
- <div class="ey-con ey-row bgfff pt0">
- <!-- 公共字段 -->
- <div class="item-from-flex">
- <div class="item-flex-l">
- <div class="item-tit">文章标题 <span class="red">*</span></div>
- <div class="item-con">
- <input type="text" name="title" id="title" class="input-text" value="{$ArchivesData.title}" maxlength="100" placeholder="请输入文章标题">
- </div>
- </div>
- </div>
-
- <div class="item-from-flex">
- <div class="item-flex-l">
- <div class="item-tit">所属栏目 <span class="red">*</span></div>
- <div class="item-con">
- <div class="select">
- {$arctype_html}
- </div>
- </div>
- </div>
- <div class="item-flex-r"> <i class="el-icon-arrow-right"></i> </div>
- </div>
-
- <div class="item-from-flex">
- <div class="item-flex-l">
- <div class="item-tit">TAG标签</div>
- <div class="item-con">
- <input type="text" name="tags" id="tags" class="input-text" value="{$ArchivesData.tags}" placeholder="多个标签之间用逗号隔开">
- </div>
- </div>
- </div>
-
- <div class="item-from-flex" id="openLitpic">
- <div class="item-flex-l">
- <div class="item-tit">缩略图</div>
- <div class="item-con">
- <div class="item-flex-img">
- <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: inline;" {/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>
- </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');
- showLayerLoad();
- $.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>
- </div>
-
- <!--下载模型特定字段-->
- <div style="display: none;" id="downloadModel">
- {eyou:include file="users/article_download_edit.htm" /}
- </div>
-
- <!--视频模型特定字段-->
- <div style="display: none;" id="mediaModel">
- {eyou:include file="users/article_media_edit.htm" /}
- </div>
-
- <!-- 图集模型特定字段 -->
- <div style="display: none;" id="imagesModel">
- {eyou:include file="users/article_images_edit.htm" /}
- </div>
-
- <!-- 模型自定义字段 -->
- <span id="FieldAddonextitem"></span>
- <script type="text/javascript">
- $(function() {
- // 默认执行选中栏目
- var aid = {$ArchivesData.aid|default='0'};
- var typeid = {$ArchivesData.typeid|default='0'};
- if (0 === parseInt(typeid)) typeid = $('#typeid').find('option:selected').val();
- getAddonextitem(0, typeid, aid);
-
- // 切换执行选中栏目
- $('#typeid').change(function() {
- getAddonextitem(1, $(this).val(), aid);
- });
- });
-
- function getAddonextitem(init, typeid, aid, is_destroy) {
- // 设置选中栏目的模型ID
- var channel = $("#typeid option:selected").attr('data-channel');
- $("input[name='channel']").val(channel);
-
- // 模型字段隐藏、显示处理
- $("#mediaModel").hide();
- $("#imagesModel").hide();
- $("#downloadModel").hide();
- if (3 === parseInt(channel)) {
- // 图集模型特定字段
- $("#imagesModel").show();
- } else if (4 === parseInt(channel)) {
- // 下载模型特定字段
- $("#downloadModel").show();
- } else if (5 === parseInt(channel)) {
- // 视频特定模型字段
- $("#mediaModel").show();
- }
-
- // 操作提示
- showLayerLoad();
- $.ajax({
- url: "{:url('user/UsersRelease/get_addonextitem')}",
- data: {aid: aid, typeid: typeid, channel: channel, _ajax: 1},
- type: 'post',
- success: function(res) {
- layer.closeAll();
- if (0 === parseInt(res.code)) {
- showLayerAlert(res.msg);
- } else {
- // 缩略图隐藏、显示处理
- $('#openLitpic').hide();
- if (res.data.is_litpic_users_release) $('#openLitpic').show();
-
- // 模型自定义字段加载
- $('#FieldAddonextitem').empty().html(res.data.html);
-
- // 渲染编辑器
- if (1 === parseInt(init)) {
- $.each(res.data.htmltextField, function (index, value) {
- showEditor_1597892187('addonFieldExt_'+value);
- });
- }
-
- if (4 === parseInt(channel)) {
- var download = res.data.download;
- var arc_level_id = {$ArchivesData.arc_level_id|default='0'};
- var users_level_html = '<option value="0" selected>不限会员</option>';
- $.each(download.users_level, function (index, value) {
- var selected = parseInt(arc_level_id) === parseInt(value.level_id) ? 'selected' : '';
- users_level_html += '<option value="'+value.level_id+'" '+selected+'>'+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="layui-btn layui-btn-normal" style="position: relative;z-index: 1;">\n'+download.upload_flag_name+'选择多文件\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').html(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;
-
- $("#remote-file-checkbox").prop("checked", true);
- var downfile_list = '{$downfile_list}';
- downfile_list = JSON.parse(downfile_list);
- 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 style=" display: block; margin-bottom: 5px; ">远程地址'+i+':<input type="text" name="remote_file[]" value="'+v.file_url+'" placeholder="http://" style="width: 250px;"></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+'" style="width: 80px;" 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+'" style="width: 80px;" 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+'" target="_blank">'+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 class="th_server_state"><span style="color: #5FB878;">上传成功</span></td>\n' +
- ' <td>\n' +
- ' <span class="layui-btn layui-btn-xs layui-btn-danger" style="line-height:unset;height: unset;" onclick="DeleteFile(this)">移除</span>\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++;
- }
- });
- $("#Template20210507").html(template_div_remote20210507_html);
- $("#demoList").html(demoList_html);
- $('#ClickRemoteFile').show();
- }
- }
- },
- error: function(e){
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- }
- </script>
- <div class="h50"></div>
- <!-- 表单验证 -->
- {$TokenValue}
- <div class="public-btn">
- <a href="JavaScript:void(0);" data-url="{:url('UsersRelease/article_edit', ['_ajax'=>1])}" onclick="editArticle(this);">立即发布</a>
- </div>
- </form>
- </div>
-
- <script type="text/javascript">
- // 去除 select中值相同的option(去重),配合{$arctype_html}使用
- $(function() {
- $("#typeid option").each(function() {
- var val = $(this).val();
- if ($("#typeid option[value='" + val + "']").length > 1) $("#typeid option[value='" + val + "']:eq(0)").remove();
- });
- });
-
- function editArticle(obj) {
- if (!$('#title').val()) {
- showLayerMsg('请填写文章标题');
- $('#title').focus();
- return false;
- }
- if (0 === parseInt($('#typeid').val())) {
- showLayerMsg('请选择所属栏目');
- $('#typeid').focus();
- return false;
- }
- // 视频模型处理视频地址
- var channel = $("#typeid option:selected").attr('data-channel');
- $("input[name='channel']").val(channel);
- if (5 === parseInt(channel)) urlToStr();
-
- showLayerLoad();
- $.ajax({
- url : $(obj).attr('data-url'),
- data: $('#post_form').serialize(),
- type: 'post',
- dataType: 'json',
- success: function(res) {
- layer.closeAll();
- if (1 == res.code) {
- showLayerMsg(res.msg, 2, function() {
- window.location.href = res.url;
- });
- } else {
- showLayerMsg(res.msg);
- if (res.data) $('#'+res.data).focus();
- }
- },
- error: function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- }
- </script>
- </body>
- </html>
|