Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

article_edit.htm 40KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>编辑投稿-{eyou:global name='web_name' /}</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
  9. <link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
  10. {eyou:static file="users/skin/css/eyoucms.css"/}
  11. <!-- 新样式 2020-11-25 -->
  12. {eyou:static file="users/skin/css/element/index.css" /}
  13. {eyou:static file="users/skin/css/e-user.css" /}
  14. {eyou:include file="users/skin/css/diy_css.htm"/}
  15. {eyou:static file="/public/plugins/layui/css/layui.css" /}
  16. {eyou:static file="/public/static/common/js/jquery.min.js"/}
  17. {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
  18. {eyou:static file="/public/static/common/js/tag_global.js"/}
  19. <script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>
  20. </head>
  21. <body class="centre shop">
  22. <!-- 头部 -->
  23. {eyou:include file="users/users_header.htm" /}
  24. <!-- 头部结束 -->
  25. <div class="breadcrumbs"></div>
  26. <script type="text/javascript">
  27. var __lang__ = "<?php echo $admin_lang; ?>";
  28. window.UEDITOR_HOME_URL = "__ROOT_DIR__/public/plugins/Ueditor/";
  29. var type20210507 = '';//下载模型的上传类型
  30. var default_servername20210507 = '';//下载模型的default_servername
  31. var attr_field20210507 = '';//下载模型的attr_field
  32. var servername_use20210507 = '';//下载模型的servername_use
  33. </script>
  34. {eyou:static file="/public/plugins/Ueditor/ueditor.config.js"/}
  35. {eyou:static file="/public/plugins/Ueditor/ueditor.all.min.js"/}
  36. {eyou:static file="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js"/}
  37. {eyou:static file="/public/plugins/laydate/laydate.js"/}
  38. {eyou:static file="/public/plugins/layui/layui.js" /}
  39. <div class="ey-body-bg">
  40. <div class="ey-body pd0">
  41. <div class="ey-container w1226">
  42. <!-- 侧边 -->
  43. {eyou:include file="users/users_left.htm" /}
  44. <!-- 侧边结束 -->
  45. <!-- 中部 -->
  46. <div class="ey-con fr" >
  47. <div class="mi-uc-box uc-main-box mi-user-favorite">
  48. <div class="uc-content-box portal-content-box">
  49. <div class="uc-context">
  50. <div class="box-hd">
  51. <h1 class="title">编辑投稿</h1>
  52. </div>
  53. <!-- 顶部导航栏结束 -->
  54. <!-- 内容栏 -->
  55. <div class="ey-con-forms custom-form mt30">
  56. <form class="form-horizontal" id="post_form">
  57. <input type="hidden" name="aid" value="{$ArchivesData.aid}">
  58. <input type="hidden" name="channel" value="{$channel_id}">
  59. <input type="hidden" name="old_typeid" value="{$ArchivesData.typeid}">
  60. <div class="item-from-row">
  61. <div class="from-row-l">
  62. <label for="title"><span class="red">*</span> 文章标题:</label>
  63. </div>
  64. <div class="from-row-r">
  65. <input type="text" name="title" id="title" class="el-input__inner w500" maxlength="100" value="{$ArchivesData.title}">
  66. </div>
  67. </div>
  68. <div class="item-from-row">
  69. <div class="from-row-l">
  70. <label for="title"><span class="red">*</span> 所属栏目:</label>
  71. </div>
  72. <div class="from-row-r">
  73. <div class="w300 select">
  74. {$arctype_html}
  75. </div>
  76. </div>
  77. </div>
  78. <div class="item-from-row">
  79. <div class="from-row-l">
  80. <label for="title">TAG标签:</label>
  81. </div>
  82. <div class="from-row-r">
  83. <input type="text" value="{$ArchivesData.tags}" name="tags" id="tags" class="el-input__inner w500" placeholder="多个标签之间用逗号隔开">
  84. </div>
  85. </div>
  86. <!-- 单张图 start -->
  87. <div class="item-from-row">
  88. <div class="from-row-l">
  89. <label for="title">缩略图:</label>
  90. </div>
  91. <div class="from-row-r">
  92. <a href="javascript:void(0);" onclick="$('#litpicOnclick').trigger('click');" class="img-upload" title="点击上传">
  93. <div class="y-line" id="litpicYline" {notempty name='$ArchivesData.litpic'} style="display: none;" {/notempty}></div>
  94. <div class="x-line" id="litpicXline" {notempty name='$ArchivesData.litpic'} style="display: none;" {/notempty}></div>
  95. <img src="{$ArchivesData.litpic}" id="litpicImgSrc" class="none" {notempty name='$ArchivesData.litpic'} style="display: block;" {/notempty}>
  96. </a>
  97. <input type="hidden" name="litpic_inpiut" id="litpicInpiut" value="{$ArchivesData.litpic}">
  98. <input type="file" name="litpic_inpiut_file" id="litpicOnclick" onchange="litpicOnclickFile(this);" style="display: none;">
  99. </div>
  100. </div>
  101. <script type="text/javascript">
  102. function litpicOnclickFile(obj) {
  103. var file = $(obj)[0].files[0];
  104. if (!file) return false;
  105. var formData = new FormData();
  106. formData.append('_ajax', 1);
  107. formData.append('file', file);
  108. formData.append('compress', '1000-1000');
  109. $.ajax({
  110. type: 'post',
  111. url: eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
  112. data: formData,
  113. contentType: false,
  114. processData: false,
  115. dataType: 'json',
  116. success: function (res) {
  117. layer.closeAll();
  118. if (res.state == 'SUCCESS') {
  119. $("#litpicInpiut").val(res.url);
  120. $('#litpicYline, #litpicXline').hide();
  121. $("#litpicImgSrc").attr('src', res.url);
  122. } else {
  123. showErrorAlert(res.state);
  124. }
  125. },
  126. error: function(e) {
  127. layer.closeAll();
  128. showErrorAlert(e.responseText);
  129. }
  130. })
  131. }
  132. </script>
  133. <!-- 单张图 end -->
  134. <div id="xiazai">
  135. {eyou:include file="users/article_download_edit.htm" /}
  136. </div>
  137. <!--视频模型-->
  138. <div id="shipin">
  139. {eyou:include file="users/article_media_edit.htm" /}
  140. </div>
  141. <div class="item-from-row" style="display: none;" id="tupianji">
  142. <div class="from-row-l">
  143. <label>图片集:</label>
  144. </div>
  145. <div class="from-row-r">
  146. <div class="images_upload_main" id="tab_imgupload">
  147. <!-- <a href="javascript:void(0);" onClick="GetUploadify(30,'','allimg','imgupload_call_back');" class="el-button el-button--primary is-plain el-button--small" title="拖动修改排序">
  148. <i class="el-icon-picture"></i>上传图片
  149. </a> -->
  150. <div class="sort-list images_upload_list" >
  151. {volist name="imgupload_list" id="vo" key="k"}
  152. <div class="images_upload">
  153. <div class="images_upload_item">
  154. <input type="hidden" name="imgupload[]" value="{$vo['image_url']}">
  155. <a href="{$vo['image_url']}" onclick="" title="拖动修改排序">
  156. <img src="{$vo['image_url']}" width="120" height="120">
  157. </a>
  158. <a href="javascript:void(0)" onclick="ClearPicArr2(this,'{$vo['image_url']}')" class="delete" title="删除"></a>
  159. </div>
  160. <textarea rows="5" cols="60" name="imgintro[]" style="height:28px; width: 120px;" placeholder="图片注释" title="标签调用:{literal}{$field.intro}{/literal}">{$vo.intro}</textarea>
  161. </div>
  162. {/volist}
  163. <div class="images_upload">
  164. </div>
  165. </div>
  166. <a href="javascript:void(0);" onClick="GetUploadify(30,'','allimg','imgupload_call_back');" class="img-upload" title="点击上传">
  167. <div class="y-line"></div>
  168. <div class="x-line"></div>
  169. </a>
  170. </div>
  171. <!-- 上传图片显示的样板 start -->
  172. <div class="images_upload_tpl none">
  173. <div class="images_upload">
  174. <div class="images_upload_item">
  175. <input type="hidden" name="imgupload[]" value="" />
  176. <a href="javascript:void(0);" onClick="" title="拖动修改排序">
  177. <img src="__STATIC__/admin/images/add-button.jpg" width="120" height="120" />
  178. </a>
  179. <a href="javascript:void(0)" class="delete" title="删除">&nbsp;&nbsp;</a>
  180. </div>
  181. <textarea rows="5" cols="60" name="imgintro[]" style="height:28px; width: 120px;" placeholder="图片注释" ></textarea>
  182. </div>
  183. </div>
  184. <!-- 上传图片显示的样板 end -->
  185. </div>
  186. </div>
  187. <script type="text/javascript">
  188. $(function(){
  189. if ($("#tab_imgupload input[type=hidden]").length > 0) {
  190. $('#tab_imgupload .images_upload_list').show();
  191. } else {
  192. $('#tab_imgupload .images_upload_list').hide();
  193. }
  194. });
  195. // 单图上传 2021.01.05
  196. function upload_single_pic_1609837252(e,input_id){
  197. var file = $(e)[0].files[0];
  198. if (!file) {
  199. return false;
  200. }
  201. var formData = new FormData();
  202. formData.append('file',file);
  203. formData.append('compress', '1000-1000');
  204. formData.append('_ajax',1);
  205. layer_loading('正在处理');
  206. $.ajax({
  207. type: 'post',
  208. url: eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
  209. data: formData,
  210. contentType: false,
  211. processData: false,
  212. dataType: 'json',
  213. success: function (res) {
  214. if (res.state == 'SUCCESS') {
  215. $("#single_pic_input_"+input_id).val(res.url)
  216. $(".img1_"+input_id).attr('src',res.url);
  217. layer.closeAll();
  218. } else {
  219. layer.closeAll();
  220. showErrorAlert(res.state);
  221. }
  222. },
  223. error : function(e) {
  224. layer.closeAll();
  225. showErrorAlert(e.responseText);
  226. }
  227. })
  228. }
  229. function img_call_back(fileurl_tmp)
  230. {
  231. $("#litpic_local").val(fileurl_tmp);
  232. $("#img_a").attr('href', fileurl_tmp);
  233. $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  234. $("input[name=is_litpic]").attr('checked', true); // 自动勾选属性[图片]
  235. }
  236. // 上传图集相册回调函数
  237. function imgupload_call_back(paths){
  238. var last_div = $(".images_upload_tpl").html();
  239. // var last_div = $(".images_upload:last").prop("outerHTML");
  240. for (var i=0;i<paths.length ;i++ )
  241. {
  242. $(".images_upload:eq(0)").before(last_div); // 插入一个 新图片
  243. $(".images_upload:eq(0)").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
  244. $(".images_upload:eq(0)").find('img').attr('src',paths[i]);// 修改他的图片路径
  245. $(".images_upload:eq(0)").find('a:eq(1)').attr('onclick',"ClearPicArr2(this,'"+paths[i]+"')").text('');
  246. $(".images_upload:eq(0)").find('input').val(paths[i]); // 设置隐藏域 要提交的值
  247. }
  248. if ($("#tab_imgupload input[type=hidden]").length > 0) {
  249. $('#tab_imgupload .images_upload_list').show();
  250. }
  251. }
  252. /*
  253. * 上传之后删除组图input
  254. * @access public
  255. * @val string 删除的图片input
  256. */
  257. function ClearPicArr2(obj,path)
  258. {
  259. // 删除数据库记录
  260. $.ajax({
  261. type:'POST',
  262. url:"{:url('user/UsersRelease/del_channelimgs', ['_ajax'=>1])}",
  263. data:{filename:path},
  264. success:function(){
  265. $(obj).parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
  266. if ($("#tab_imgupload input[type=hidden]").length == 0) {
  267. $('#tab_imgupload .images_upload_list').hide();
  268. }
  269. $.ajax({
  270. type:'POST',
  271. url:"{:url('Uploadify/delupload', ['_ajax'=>1])}",
  272. data:{action:"del", filename:path},
  273. success:function(){}
  274. });
  275. }
  276. });
  277. }
  278. /** 以下 图集相册的拖动排序相关 js*/
  279. $( ".sort-list" ).sortable({
  280. start: function( event, ui) {
  281. }
  282. ,stop: function( event, ui ) {
  283. }
  284. });
  285. //因为他们要拖动,所以尽量设置他们的文字不能选择。
  286. $( ".sort-list" ).disableSelection();
  287. </script>
  288. <span id="FieldAddonextitem"></span>
  289. <script type="text/javascript">
  290. $(function() {
  291. var typeidNew = {$ArchivesData.typeid|default='0'};
  292. var aidNew = {$ArchivesData.aid|default='0'};
  293. GetAddonextitem(0, typeidNew, aidNew, false);
  294. $('#typeid').change(function() {
  295. GetAddonextitem(1, $(this).val(), aidNew, true);
  296. });
  297. });
  298. function GetAddonextitem(init, typeidNew, aidNew, is_destroy) {
  299. var channel = $("#typeid option:selected").attr('data-channel');
  300. $("input[name='channel']").val(channel);
  301. if (3 == channel){
  302. $("#tupianji").show();
  303. $("#xiazai").hide();
  304. $("#shipin").hide();
  305. }else if (4 == channel){
  306. $("#tupianji").hide();
  307. $("#xiazai").show();
  308. $("#shipin").hide();
  309. }else if (5 == channel){
  310. $("#tupianji").hide();
  311. $("#xiazai").hide();
  312. $("#shipin").show();
  313. }else{
  314. $("#tupianji").hide();
  315. $("#xiazai").hide();
  316. $("#shipin").hide();
  317. }
  318. var loadingTxt = '正在加载';
  319. if (1 == init) {
  320. loadingTxt = '正在切换';
  321. }
  322. layer_loading(loadingTxt);
  323. $.ajax({
  324. url: "{:url('user/UsersRelease/get_addonextitem')}",
  325. data: {typeid: typeidNew, aid: aidNew, _ajax:1},
  326. type:'post',
  327. success:function(res) {
  328. layer.closeAll();
  329. if (res.code == 0) {
  330. showErrorAlert(res.msg);
  331. } else {
  332. $('#FieldAddonextitem').empty().html(res.data.html);
  333. if (1 == init) {
  334. $.each(res.data.htmltextField, function (index, value) {
  335. showEditor_1597892187('addonFieldExt_'+value);
  336. });
  337. }
  338. if (4 == channel) {
  339. var download = res.data.download;
  340. var users_level_html = '<option value="0" selected>不限会员</option>';
  341. $.each(download.users_level, function (index, value) {
  342. if ('{$ArchivesData.arc_level_id}' == value.level_id) {
  343. users_level_html += '<option value="'+value.level_id+'" selected>'+value.level_name+'</option>\n';
  344. }else{
  345. users_level_html += '<option value="'+value.level_id+'">'+value.level_name+'</option>\n';
  346. }
  347. });
  348. $('#arc_level_id').html(users_level_html);
  349. if('local' != download.upload_flag){
  350. //第三方
  351. 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' +
  352. ' <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' +
  353. ' </button>';
  354. $('#download-layui-upload').prepend(upload_button_html);
  355. }else{
  356. $("#buttonList").show();
  357. }
  358. $('#download-layui-upload').attr('data-type',download.upload_flag);
  359. if (1 == download.servername_use){
  360. $(".th_server_name").show();
  361. }
  362. type20210507 = download.basic.file_type;
  363. default_servername20210507 = download.default_servername;
  364. attr_field20210507 = download.attr_field;
  365. servername_use20210507 = download.servername_use;
  366. var downfile_list = '{$downfile_list|default=""}';
  367. downfile_list = JSON.parse(downfile_list);
  368. $("#remote-file-checkbox").prop("checked",true);
  369. var template_div_remote20210507_html = '';
  370. var demoList_html = '';
  371. var i = 1;
  372. var n = 1;
  373. $.each(downfile_list, function (index, v) {
  374. if (1 == v.is_remote) {
  375. 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' ;
  376. $.each(attr_field20210507, function (index, value) {
  377. var field_use_style = '';
  378. if(1 != value.field_use){
  379. field_use_style = ' style="display: none;" ';
  380. }
  381. if('server_name' == value.field_name){
  382. template_div_remote20210507_html += '<span class="ey_'+value.field_name+'" '+field_use_style+'>\n' +
  383. '<span class="title_'+value.field_name+'">'+value.field_title+'</span>:' +
  384. '<input type="text" name="'+value.field_name+'[]" id="'+value.field_name+'_remote_'+i+'" onclick="searchServername(this);" autocomplete="off" value="'+v[value.field_name]+'" >\n' +
  385. '<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' +
  386. '</span>\n' ;
  387. }else{
  388. template_div_remote20210507_html += '<span class="ey_'+value.field_name+'" '+field_use_style+'>\n' +
  389. '<span class="title_'+value.field_name+'">'+value.field_title+'</span>:' +
  390. '<input type="text" name="'+value.field_name+'[]" id="'+value.field_name+'_remote_'+i+'" value="'+v[value.field_name]+'"></span>\n' ;
  391. }
  392. });
  393. template_div_remote20210507_html += '</div>';
  394. i++;
  395. }else{
  396. var servername_html = '';
  397. if (servername_use20210507 != 1) {
  398. servername_html = " style=\"display: none;\" ";
  399. }
  400. demoList_html += '<tr><td><a href="'+v.file_url+'" >'+v.file_name+'</a></td>\n' +
  401. ' <td class="th_server_name" '+servername_html+'>\n' +
  402. ' <input type="text" name="fileupload[server_name][]" value="'+v.server_name+'" id="servername_local_'+n+'" onclick="searchServername(this);" autocomplete="off">\n' +
  403. ' <div class="help-hot-list" style="display: none;" id="search_keywords_list_servername_local_'+n+'"></div>\n' +
  404. ' </td>\n' +
  405. ' <td>'+v.file_size+'</td>\n' +
  406. ' <td><span style="color: #5FB878;">上传成功</span></td>\n' +
  407. ' <td>\n' +
  408. ' <a class="fc-colours cursor-pointer" onclick="DeleteFile(this)">移除</a>\n' +
  409. ' <input type="hidden" name="fileupload[file_url][]" value="'+v.file_url+'">\n' +
  410. ' <input type="hidden" name="fileupload[file_mime][]" value="'+v.file_mime+'">\n' +
  411. ' <input type="hidden" name="fileupload[file_name][]" value="'+v.file_name+'">\n' +
  412. ' <input type="hidden" name="fileupload[file_ext][]" value="'+v.file_ext+'">\n' +
  413. ' <input type="hidden" name="fileupload[file_size][]" value="'+v.file_size+'">\n' +
  414. ' <input type="hidden" name="fileupload[uhash][]" value="'+v.uhash+'">\n' +
  415. ' <input type="hidden" name="fileupload[md5file][]" value="'+v.md5file+'">\n' +
  416. ' </td></tr>'
  417. n++;
  418. }
  419. });
  420. if ("{$is_remote_file}" == 1){
  421. $("#Template20210507").html(template_div_remote20210507_html);
  422. $('#ClickRemoteFile').show();
  423. }
  424. $("#demoList").html(demoList_html);
  425. }
  426. }
  427. },
  428. error: function(e){
  429. layer.closeAll();
  430. showErrorAlert(e.responseText);
  431. }
  432. });
  433. }
  434. </script>
  435. <div class="item-from-row" style="border-bottom:none;">
  436. <div class="from-row-l">&nbsp;</div>
  437. <div class="from-row-r">
  438. <input type="hidden" name="old_arcrank" value="{$ArchivesData.arcrank}">
  439. <input type="button" data-url="{:url('UsersRelease/article_edit')}" onclick="EditArticle(this);" class="el-button el-button--primary " value="确认提交"/>
  440. </div>
  441. </div>
  442. <!-- 表单验证 -->
  443. {$TokenValue}
  444. </form>
  445. </div>
  446. <!-- 内容栏结束 -->
  447. </div>
  448. </div>
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. </div>
  454. <script type="text/javascript">
  455. // 去除 select中值相同的option(去重),配合{$arctype_html}使用
  456. $(function(){
  457. var channel = $("#typeid option:selected").attr('data-channel');
  458. if (channel == 3){
  459. $("#tupianji").show()
  460. }
  461. $("#typeid option").each(function() {
  462. var val = $(this).val();
  463. if ($("#typeid option[value='" + val + "']").length > 1){
  464. $("#typeid option[value='" + val + "']:eq(0)").remove();
  465. }
  466. });
  467. });
  468. function MobileAddArticle(url = null){
  469. $.getScript('__ROOT_DIR__/public/plugins/layer_mobile/layer.js?v={$version}', function(){
  470. // 提示信息,2秒自动关闭
  471. function MsgOpen(msgs){
  472. layer.open({
  473. content: msgs,
  474. skin: 'msg',
  475. time: 2,
  476. });
  477. }
  478. // 提示动画
  479. function LoaDing(){
  480. var loading = layer.open({
  481. type:2,
  482. content: '正在处理',
  483. });
  484. return loading;
  485. }
  486. OnMobileAddArticle();
  487. function OnMobileAddArticle(){
  488. if (!$('#title').val()) {
  489. MsgOpen('请填写文章标题!');
  490. $('#title').focus();
  491. return false;
  492. }
  493. if (0 == $('#typeid').val()) {
  494. MsgOpen('请选择所属栏目!');
  495. $('#typeid').focus();
  496. return false;
  497. }
  498. LoaDing();
  499. $.ajax({
  500. url: url,
  501. data: $('#post_form').serialize(),
  502. type:'post',
  503. dataType:'json',
  504. success:function(res){
  505. layer.closeAll();
  506. if (1 == res.code) {
  507. MsgOpen(res.msg);
  508. window.location.href = res.url;
  509. } else {
  510. MsgOpen(res.msg);
  511. if (res.data) $('#'+res.data).focus();
  512. }
  513. }
  514. });
  515. }
  516. })
  517. }
  518. function EditArticle(obj){
  519. var url = $(obj).attr('data-url');
  520. if (!$('#title').val()) {
  521. layer.msg('请填写文章标题!', {time: 1500, icon: 5});
  522. $('#title').focus();
  523. return false;
  524. }
  525. if (0 == $('#typeid').val()) {
  526. layer.msg('请选择所属栏目!', {time: 1500, icon: 5});
  527. $('#typeid').focus();
  528. return false;
  529. }
  530. var channel = $("#typeid option:selected").attr('data-channel');
  531. $("input[name='channel']").val(channel);
  532. if (5 == channel){
  533. urlToStr();
  534. }
  535. layer_loading('正在处理');
  536. $.ajax({
  537. url: url,
  538. data: $('#post_form').serialize(),
  539. type:'post',
  540. dataType:'json',
  541. success:function(res){
  542. layer.closeAll();
  543. if (1 == res.code) {
  544. layer.msg(res.msg, {time: 1000},function(){
  545. window.location.href = res.url;
  546. });
  547. } else {
  548. layer.msg(res.msg, {time: 1500, icon: 5});
  549. if (res.data) $('#'+res.data).focus();
  550. }
  551. },
  552. error : function(e) {
  553. layer.closeAll();
  554. showErrorAlert(e.responseText);
  555. }
  556. });
  557. }
  558. function litpic_call_back(fileurl_tmp)
  559. {
  560. $("#litpic_inpiut").val(fileurl_tmp);
  561. $("#litpic_img").attr('src', fileurl_tmp);
  562. }
  563. </script>
  564. {eyou:include file="users/users_footer.htm" /}
  565. <!-- 底部结束 -->