No Description
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.

edit_answer.htm 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>编辑回答-问答中心</title>
  5. <meta name="renderer" content="webkit" />
  6. <meta charset="utf-8" />
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0,minimal-ui" />
  9. <link href="{eyou:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
  10. {eyou:static file="skin/css/eyoucms.css" code="ask"/}
  11. {eyou:static file="skin/css/ask.css" code="ask"/}
  12. <script>
  13. var __root_dir__ = "__ROOT_DIR__";
  14. </script>
  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="skin/js/ask.js" code="ask"/}
  18. </head>
  19. <body>
  20. <!-- 头部 -->
  21. {eyou:include file="ask/pc/ask_header.htm" /}
  22. <!-- END -->
  23. <main class="mian-body container" style="">
  24. <div class="main_box main_box_a" style="">
  25. <div class="tiwen_box mar_t38" style="">
  26. <form id="AnswerFormData">
  27. <input type="hidden" name="m" value="plugins">
  28. <input type="hidden" name="c" value="Ask">
  29. <input type="hidden" name="a" value="ajax_edit_answer">
  30. <input type="hidden" name="ask_id" value="{$eyou.field.Info.ask_id}">
  31. <input type="hidden" name="answer_id" value="{$eyou.field.Info.answer_id}">
  32. <p class="tt-img">
  33. <img src="{eyou:static file="skin/images/twtop.png" code="ask"/}">
  34. </p>
  35. <div class="tiwen_main mar_t20" style="">
  36. <p class="ti">
  37. <big><strong>问题标题</strong></big>
  38. </p>
  39. <div class="mar_t10 ts">
  40. {$eyou.field.Info.ask_title}
  41. </div>
  42. <p class="hui_font mar_t10 ti">
  43. <big><strong>问题回答</strong></big>
  44. <font class="font12 jiu_font mar_l10">{$eyou.field.Info.nickname},您要修改的答复如下</font>
  45. </p>
  46. <div class="mar_t10 da" style="">
  47. <script type="text/javascript">
  48. window.UEDITOR_HOME_URL = "__ROOT_DIR__/public/plugins/Ueditor/";
  49. </script>
  50. {eyou:static file="/public/plugins/Ueditor/ueditor.config.js"/}
  51. {eyou:static file="/public/plugins/Ueditor/ueditor.all.min.js"/}
  52. {eyou:static file="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js"/}
  53. <!-- HTML文本 start -->
  54. <div class="">
  55. <div class="">
  56. <textarea class="span12 ckeditor" id="content" name="content">{$eyou.field.Info.content}</textarea>
  57. </div>
  58. </div>
  59. <script type="text/javascript">
  60. UE.getEditor('content',{
  61. serverUrl :"{:url('user/Uploadify/index',array('savepath'=>'weapp'))}",
  62. zIndex: 999,
  63. initialFrameWidth: "100%", //初化宽度
  64. initialFrameHeight: 300, //初化高度
  65. focus: false, //初始化时,是否让编辑器获得焦点true或false
  66. maximumWords: 99999,
  67. removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
  68. pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
  69. autoHeightEnabled: false,
  70. toolbars: [["forecolor", "backcolor", "removeformat", "|", "simpleupload", "unlink"]],
  71. // xss 过滤是否开启,inserthtml等操作
  72. xssFilterRules: true,
  73. //input xss过滤
  74. inputXssFilter: true,
  75. //output xss过滤
  76. outputXssFilter: true
  77. });
  78. //必须在提交前渲染编辑器;
  79. function content() {
  80. //判断编辑模式状态:0表示【源代码】HTML视图;1是【设计】视图,即可见即所得;-1表示不可用
  81. if(UE.getEditor("content").queryCommandState('source') != 0) {
  82. UE.getEditor("content").execCommand('source'); //切换到【设计】视图
  83. }
  84. }
  85. </script>
  86. </div>
  87. <input type="hidden" name="form_id" value="AnswerFormEditData" />
  88. <input type="hidden" name="__token__edit_answer" id="edit_answer_1652345941" class="token_answer_1652345941" value="" />
  89. <div class="width100 mar_t10 et da">
  90. <span class="el"></span>
  91. <span class="rc">
  92. <font id="errorTips"></font>
  93. <button type="button" class="sz_button float_r" data-url="{$eyou.field.EditAnswerUrl}" onclick="SubmitData(this);">提交</button>
  94. </span>
  95. </div>
  96. </div>
  97. </form>
  98. </div>
  99. </div>
  100. </main>
  101. <script type="text/javascript">
  102. get_token("__token__edit_answer");
  103. function SubmitData(obj) {
  104. if (!$('textarea[name="content"]').val()) {
  105. layer.msg('请填写问题描述!', {time: 1500, icon: 2});
  106. return false;
  107. }
  108. layer_loading('正在处理');
  109. $.ajax({
  110. url: $(obj).data('url'),
  111. data: $('#AnswerFormData').serialize(),
  112. type:'post',
  113. dataType:'json',
  114. success:function(res){
  115. layer.closeAll();
  116. if (1 == res.code) {
  117. if (res.data.review) {
  118. var times = 2500;
  119. }else{
  120. var times = 1000;
  121. }
  122. layer.msg(res.msg, {time: times},function(){
  123. window.location.href = res.url;
  124. });
  125. } else {
  126. get_token("__token__edit_answer");
  127. layer.msg(res.msg, {time: 1500, icon: 2});
  128. }
  129. },
  130. error : function() {
  131. layer.closeAll();
  132. get_token("__token__edit_answer");
  133. layer.alert('网络失败,请刷新页面后重试', {icon: 5, closeBtn: 0});
  134. }
  135. });
  136. }
  137. </script>
  138. </body>
  139. </html>