detail.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>活动管理新增</title>
  7. <style>
  8. .push-names span {
  9. display: inline-block;
  10. background: #f5f5f5;
  11. padding: 5px 10px;
  12. border-radius: 3px;
  13. margin: 0 5px 5px 0;
  14. }
  15. </style>
  16. </head>
  17. <body layout:fragment="content">
  18. <article class="page-container">
  19. <form class="form form-horizontal" id="form-review-add">
  20. <div class="row cl">
  21. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>关联活动:</label>
  22. <div class="formControls col-xs-8 col-sm-7">
  23. <input type="hidden" class="input-text" th:name="id" th:value="${review.id}"/>
  24. <input type="hidden" class="input-text" th:name="activity_id" th:value="${review.activity_id}"/>
  25. <input type="text" class="input-text" readonly placeholder="点击查找关联活动" th:id="activity_title"
  26. th:name="activity_title" th:value="${review.activity_title}"/>
  27. </div>
  28. </div>
  29. <div class="row cl">
  30. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>标题:</label>
  31. <div class="formControls col-xs-8 col-sm-7">
  32. <input type="text" class="input-text" readonly placeholder="请输入标题" th:id="title"
  33. th:name="title" th:value="${review.title}"/>
  34. </div>
  35. </div>
  36. <div class="row cl">
  37. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>是否置顶:</label>
  38. <div class="formControls col-xs-8 col-sm-9">
  39. <label style="margin-right: 10px;"><input name="is_top" readonly type="radio" value="0"> 不置顶</label>
  40. <label><input name="is_top" readonly type="radio" value="1"> 置顶</label>
  41. </div>
  42. </div>
  43. <div class="row cl">
  44. <label class="form-label col-xs-4 col-sm-2">图片:</label>
  45. <div class="formControls col-xs-8 col-sm-9">
  46. <div class="uploader-thum-container">
  47. <div id="fileList" class="uploader-list"></div>
  48. <input type="hidden" value="" th:id="img" th:name="img" />
  49. <div id="fileListPre">
  50. <img height=100 width=200 th:src="${fileUrl} +${review.fileDown.file_url}"/>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="row cl">
  56. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>内容:</label>
  57. <div class="formControls col-xs-8 col-sm-9">
  58. <textarea id="content" name="content" th:value="${review.content}" readonly></textarea>
  59. </div>
  60. </div>
  61. <input type="hidden" id="isPush">
  62. <div class="row cl">
  63. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
  64. <a onclick="removeIframe();" class="btn btn-default radius" type="button">返回</a>
  65. </div>
  66. </div>
  67. </form>
  68. </article>
  69. <script type="text/javascript" th:src="@{/h-ui/lib/webuploader/0.1.5/webuploader.min.js}"></script>
  70. <script th:inline="javascript">
  71. //富文本kindeditor初始化
  72. var editor;
  73. KindEditor.ready(function (K) {
  74. editor = K.create('#content', {
  75. uploadJson: pagePath + '/upload/kindEditorUpload',
  76. allowFileManager: false,
  77. allowUpload: true,
  78. width: "750px",
  79. height: "350px",
  80. items: array,
  81. syncType: "auto",
  82. afterBlur: function () {
  83. this.sync();
  84. }
  85. });
  86. });
  87. // 初始化图片上传
  88. var options = {
  89. auto: false,
  90. uploadBtnId: '#filePicker',
  91. picturePreId: 'fileListPre',
  92. //serverUrl: '/government/slides/uploadImg',
  93. hiddenPictureUrl: 'fileDown.file_id',
  94. hiddenPictureName: 'imgName',
  95. accept: {
  96. title: 'Images',
  97. extensions: 'gif,jpg,jpeg,bmp,png',
  98. mimeTypes: 'image/gif,image/jpg,image/jpeg,image/bmp,image/png'
  99. },
  100. width: 81,
  101. height: 81,
  102. fileSizeLimit: 100 * 1024 * 1024,
  103. fileSingleSizeLimit: 100 * 1024 * 1024
  104. // fileNumLimit: 1
  105. };
  106. var webUploadPicture = new $WebUploadPicture(options);
  107. webUploadPicture.init();
  108. $("#is_quota").change(function () {
  109. if ($('#is_quota option:selected').val() == "1") {
  110. $("#quota").show()
  111. } else {
  112. $("#quota").hide()
  113. }
  114. });
  115. $(function () {
  116. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  117. var isOpera = userAgent.indexOf("Opera") > -1;
  118. //判断是否IE浏览器
  119. if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
  120. $("#activity_starttime").remove();
  121. $("#activity_endtime").remove();
  122. $("#activity_deadline").remove();
  123. } else {
  124. $("#activity_starttimeIE").remove();
  125. $("#activity_endtimeIE").remove();
  126. $("#activity_deadlineIE").remove();
  127. }
  128. var conent = [[${review.content}]];
  129. $("#content").val(conent);
  130. var is_top = [[${review.is_top}]];
  131. console.log(is_top);
  132. if (is_top){
  133. $("input:radio[name='is_top'][value= '1']").prop("checked", true);
  134. }
  135. else {
  136. $("input:radio[name='is_top'][value= '0']").prop("checked", true);
  137. }
  138. });
  139. function findActivity() {
  140. console.log("123456789");
  141. var url = pagePath+ "/activity/review/activityList";
  142. layer_show("选择关联活动",url,800, 500);
  143. }
  144. function saveAsDraft() {
  145. submit(0);
  146. }
  147. function publish() {
  148. submit(1);
  149. }
  150. function submit(status) {
  151. $("#form-review-add").ajaxSubmit({
  152. type: 'post',
  153. url: pagePath + "/activity/review/update",
  154. dataType: "json",
  155. data: {
  156. status: status
  157. },
  158. success: function (data) {
  159. if (data.success) {
  160. succeedMessage(data.message);
  161. setTimeClose();
  162. } else {
  163. errorMessage(data.message);
  164. }
  165. },
  166. error: function () {
  167. errorMessage('系统错误!');
  168. }
  169. });
  170. }
  171. /**
  172. * 取消
  173. */
  174. function removeIframe() {
  175. var index = parent.layer.getFrameIndex(window.name);
  176. parent.layer.close(index);
  177. }
  178. </script>
  179. </body>
  180. </html>