Няма описание
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. {eyou:static file="users/skin/css/element/index.css" /}
  12. {eyou:static file="users/skin/css/e-user.css" /}
  13. {eyou:include file="users/skin/css/diy_css.htm"/}
  14. {eyou:static file="/public/plugins/layui/css/layui.css" /}
  15. {eyou:static file="/public/static/common/js/jquery.min.js"/}
  16. {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
  17. {eyou:static file="/public/static/common/js/tag_global.js"/}
  18. <script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>
  19. </head>
  20. <body>
  21. {eyou:include file="users/users_header.htm" /}
  22. <div class="breadcrumbs"> </div>
  23. <script type="text/javascript">
  24. var __lang__ = "<?php echo $admin_lang; ?>";
  25. window.UEDITOR_HOME_URL = "__ROOT_DIR__/public/plugins/Ueditor/";
  26. var type20210507 = '';//下载模型的上传类型
  27. var default_servername20210507 = '';//下载模型的default_servername
  28. var attr_field20210507 = '';//下载模型的attr_field
  29. var servername_use20210507 = '';//下载模型的servername_use
  30. </script>
  31. {eyou:static file="/public/plugins/Ueditor/ueditor.config.js"/}
  32. {eyou:static file="/public/plugins/Ueditor/ueditor.all.min.js"/}
  33. {eyou:static file="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js"/}
  34. {eyou:static file="/public/plugins/laydate/laydate.js"/}
  35. {eyou:static file="/public/plugins/layui/layui.js" /}
  36. <div class="ey-body-bg">
  37. <div class="ey-body pd0">
  38. <div class="ey-container w1226">
  39. {eyou:include file="users/users_left.htm" /}
  40. <div class="ey-con fr" >
  41. <div class="mi-uc-box uc-main-box mi-user-favorite">
  42. <div class="uc-content-box portal-content-box">
  43. <div class="uc-context">
  44. <div class="box-hd"><h1 class="title">我要投稿</h1></div>
  45. <div class="ey-con-forms custom-form mt30">
  46. <form id="post_form">
  47. <input type="hidden" name="channel" value="0">
  48. <div class="item-from-row">
  49. <div class="from-row-l"><span class="red">*</span> 文章标题:</div>
  50. <div class="from-row-r">
  51. <input type="text" name="title" value="" id="title" class="el-input__inner w500" maxlength="100">
  52. </div>
  53. </div>
  54. <div class="item-from-row">
  55. <div class="from-row-l"><span class="red">*</span> 所属栏目:</div>
  56. <div class="from-row-r">
  57. <div class="w300 select">
  58. {$arctype_html}
  59. </div>
  60. </div>
  61. </div>
  62. <div class="item-from-row">
  63. <div class="from-row-l">TAG标签:</div>
  64. <div class="from-row-r">
  65. <input type="text" value="" name="tags" id="tags" class="el-input__inner w500" placeholder="多个标签之间用逗号隔开">
  66. </div>
  67. </div>
  68. <div class="item-from-row">
  69. <div class="from-row-l">缩略图:</div>
  70. <div class="from-row-r">
  71. <a href="javascript:void(0);" onclick="$('#litpicOnclick').trigger('click');" class="img-upload" title="点击上传">
  72. <div class="y-line" id="litpicYline"></div>
  73. <div class="x-line" id="litpicXline"></div>
  74. <img src="" id="litpicImgSrc">
  75. </a>
  76. <input type="hidden" name="litpic_inpiut" id="litpicInpiut">
  77. <input type="file" name="litpic_inpiut_file" id="litpicOnclick" onchange="litpicOnclickFile(this);" style="display: none;">
  78. </div>
  79. <script type="text/javascript">
  80. function litpicOnclickFile(obj) {
  81. var file = $(obj)[0].files[0];
  82. if (!file) return false;
  83. var formData = new FormData();
  84. formData.append('_ajax', 1);
  85. formData.append('file', file);
  86. formData.append('compress', '1000-1000');
  87. $.ajax({
  88. type: 'post',
  89. url: eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
  90. data: formData,
  91. contentType: false,
  92. processData: false,
  93. dataType: 'json',
  94. success: function (res) {
  95. layer.closeAll();
  96. if (res.state == 'SUCCESS') {
  97. // $('#litpicSpan').show();
  98. $("#litpicInpiut").val(res.url);
  99. $('#litpicYline, #litpicXline').hide();
  100. $("#litpicImgSrc").attr('src', res.url);
  101. } else {
  102. showErrorAlert(res.state);
  103. }
  104. },
  105. error: function(e) {
  106. layer.closeAll();
  107. showErrorAlert(e.responseText);
  108. }
  109. })
  110. }
  111. </script>
  112. </div>
  113. <!--下载模型特定字段-->
  114. <div style="display: none;" id="downloadModel">
  115. {eyou:include file="users/article_download_add.htm" /}
  116. </div>
  117. <!--视频模型特定字段-->
  118. <div style="display: none;" id="mediaModel">
  119. {eyou:include file="users/article_media_add.htm" /}
  120. </div>
  121. <!-- 图集模型特定字段 -->
  122. <div style="display: none;" id="imagesModel">
  123. {eyou:include file="users/article_images_add.htm" /}
  124. </div>
  125. <span id="FieldAddonextitem"></span>
  126. <script type="text/javascript">
  127. $(function() {
  128. var typeid = {$typeid|default='0'};
  129. if (0 === parseInt(typeid)) typeid = $('#typeid').find('option:selected').val();
  130. getAddonextitem(0, typeid);
  131. $('#typeid').change(function() {
  132. getAddonextitem(1, $(this).val());
  133. });
  134. });
  135. function getAddonextitem(init, typeid) {
  136. var channel = $("#typeid option:selected").attr('data-channel');
  137. $("input[name='channel']").val(channel);
  138. // 模型字段隐藏、显示处理
  139. $("#mediaModel").hide();
  140. $("#imagesModel").hide();
  141. $("#downloadModel").hide();
  142. if (3 === parseInt(channel)) {
  143. // 图集模型特定字段
  144. $("#imagesModel").show();
  145. } else if (4 === parseInt(channel)) {
  146. // 下载模型特定字段
  147. $("#downloadModel").show();
  148. } else if (5 === parseInt(channel)) {
  149. // 视频特定模型字段
  150. $("#mediaModel").show();
  151. }
  152. layer_loading(1 == init ? '正在切换' : '正在加载');
  153. $.ajax({
  154. url: "{:url('user/UsersRelease/get_addonextitem')}",
  155. data: {typeid: typeid, channel: channel, _ajax: 1},
  156. type:'post',
  157. success:function(res) {
  158. layer.closeAll();
  159. if (res.code == 0) {
  160. showErrorAlert(res.msg);
  161. } else {
  162. $('#FieldAddonextitem').empty().html(res.data.html);
  163. if (1 == init) {
  164. $.each(res.data.htmltextField, function (index, value) {
  165. showEditor_1597892187('addonFieldExt_'+value);
  166. });
  167. }
  168. if (channel == 4) {
  169. var download = res.data.download;
  170. var users_level_html = '<option value="0" selected>不限会员</option>';
  171. $.each(download.users_level, function (index, value) {
  172. users_level_html += '<option value="'+value.level_id+'">'+value.level_name+'</option>\n';
  173. });
  174. $('#arc_level_id').html(users_level_html);
  175. if('local' != download.upload_flag){
  176. //第三方
  177. 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' +
  178. ' <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' +
  179. ' </button>';
  180. $('#download-layui-upload').prepend(upload_button_html);
  181. }else{
  182. $("#buttonList").show();
  183. }
  184. $('#download-layui-upload').attr('data-type',download.upload_flag);
  185. if (1 == download.servername_use){
  186. $(".th_server_name").show();
  187. }
  188. type20210507 = download.basic.file_type;
  189. default_servername20210507 = download.default_servername;
  190. attr_field20210507 = download.attr_field;
  191. servername_use20210507 = download.servername_use;
  192. }
  193. }
  194. },
  195. error: function(e){
  196. layer.closeAll();
  197. showErrorAlert(e.responseText);
  198. }
  199. });
  200. }
  201. </script>
  202. <div class="item-from-row">
  203. <div class="from-row-l">&nbsp;</div>
  204. <div class="from-row-r">
  205. <input type="button" data-url="{:url('UsersRelease/article_add', ['_ajax'=>1])}" onclick="addArticle(this);" class="el-button el-button--primary " value="确认提交"/>
  206. </div>
  207. </div>
  208. {$TokenValue}
  209. </form>
  210. </div>
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. <script type="text/javascript">
  219. // 去除 select中值相同的option(去重),配合{$arctype_html}使用
  220. $(function(){
  221. var channel = $("#typeid option:selected").attr('data-channel');
  222. if (channel == 3){
  223. $("#tupianji").show()
  224. }
  225. $("#typeid option").each(function() {
  226. var val = $(this).val();
  227. if ($("#typeid option[value='" + val + "']").length > 1){
  228. $("#typeid option[value='" + val + "']:eq(0)").remove();
  229. }
  230. });
  231. });
  232. function addArticle(obj) {
  233. if (!$('#title').val()) {
  234. showErrorMsg('请填写文章标题');
  235. $('#title').focus();
  236. return false;
  237. }
  238. if (0 === parseInt($('#typeid').val())) {
  239. showErrorMsg('请选择所属栏目');
  240. $('#typeid').focus();
  241. return false;
  242. }
  243. // 视频模型处理视频地址
  244. var channel = $("#typeid option:selected").attr('data-channel');
  245. $("input[name='channel']").val(channel);
  246. if (5 == channel) urlToStr();
  247. layer_loading('正在处理');
  248. $.ajax({
  249. url : $(obj).attr('data-url'),
  250. data: $('#post_form').serialize(),
  251. type: 'post',
  252. dataType: 'json',
  253. success: function(res) {
  254. layer.closeAll();
  255. if (1 == res.code) {
  256. if (res.data.email) eyUnifiedSendRemind(res.data.email);
  257. if (res.data.mobile) eyUnifiedSendRemind(res.data.mobile);
  258. showSuccessMsg(res.msg, function() {
  259. window.location.href = res.url;
  260. });
  261. } else {
  262. showSuccessMsg(res.msg);
  263. if (res.data) $('#'+res.data).focus();
  264. }
  265. },
  266. error : function(e) {
  267. layer.closeAll();
  268. showErrorAlert(e.responseText);
  269. }
  270. });
  271. }
  272. </script>
  273. {eyou:include file="users/users_footer.htm" /}