| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>活动管理新增</title>
- <style>
- .push-names span {
- display: inline-block;
- background: #f5f5f5;
- padding: 5px 10px;
- border-radius: 3px;
- margin: 0 5px 5px 0;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <article class="page-container">
- <form class="form form-horizontal" id="form-review-add">
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>关联活动:</label>
- <div class="formControls col-xs-8 col-sm-7">
- <input type="hidden" class="input-text" th:name="id" th:value="${review.id}"/>
- <input type="hidden" class="input-text" th:name="activity_id" th:value="${review.activity_id}"/>
- <input type="text" class="input-text" readonly placeholder="点击查找关联活动" th:id="activity_title"
- th:name="activity_title" th:value="${review.activity_title}"/>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>标题:</label>
- <div class="formControls col-xs-8 col-sm-7">
- <input type="text" class="input-text" readonly placeholder="请输入标题" th:id="title"
- th:name="title" th:value="${review.title}"/>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>是否置顶:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <label style="margin-right: 10px;"><input name="is_top" readonly type="radio" value="0"> 不置顶</label>
- <label><input name="is_top" readonly type="radio" value="1"> 置顶</label>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">图片:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <div class="uploader-thum-container">
- <div id="fileList" class="uploader-list"></div>
- <input type="hidden" value="" th:id="img" th:name="img" />
- <div id="fileListPre">
- <img height=100 width=200 th:src="${fileUrl} +${review.fileDown.file_url}"/>
- </div>
- </div>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>内容:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <textarea id="content" name="content" th:value="${review.content}" readonly></textarea>
- </div>
- </div>
- <input type="hidden" id="isPush">
- <div class="row cl">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
- <a onclick="removeIframe();" class="btn btn-default radius" type="button">返回</a>
- </div>
- </div>
- </form>
- </article>
- <script type="text/javascript" th:src="@{/h-ui/lib/webuploader/0.1.5/webuploader.min.js}"></script>
- <script th:inline="javascript">
- //富文本kindeditor初始化
- var editor;
- KindEditor.ready(function (K) {
- editor = K.create('#content', {
- uploadJson: pagePath + '/upload/kindEditorUpload',
- allowFileManager: false,
- allowUpload: true,
- width: "750px",
- height: "350px",
- items: array,
- syncType: "auto",
- afterBlur: function () {
- this.sync();
- }
- });
- });
- // 初始化图片上传
- var options = {
- auto: false,
- uploadBtnId: '#filePicker',
- picturePreId: 'fileListPre',
- //serverUrl: '/government/slides/uploadImg',
- hiddenPictureUrl: 'fileDown.file_id',
- hiddenPictureName: 'imgName',
- accept: {
- title: 'Images',
- extensions: 'gif,jpg,jpeg,bmp,png',
- mimeTypes: 'image/gif,image/jpg,image/jpeg,image/bmp,image/png'
- },
- width: 81,
- height: 81,
- fileSizeLimit: 100 * 1024 * 1024,
- fileSingleSizeLimit: 100 * 1024 * 1024
- // fileNumLimit: 1
- };
- var webUploadPicture = new $WebUploadPicture(options);
- webUploadPicture.init();
- $("#is_quota").change(function () {
- if ($('#is_quota option:selected').val() == "1") {
- $("#quota").show()
- } else {
- $("#quota").hide()
- }
- });
- $(function () {
- var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
- var isOpera = userAgent.indexOf("Opera") > -1;
- //判断是否IE浏览器
- if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
- $("#activity_starttime").remove();
- $("#activity_endtime").remove();
- $("#activity_deadline").remove();
- } else {
- $("#activity_starttimeIE").remove();
- $("#activity_endtimeIE").remove();
- $("#activity_deadlineIE").remove();
- }
- var conent = [[${review.content}]];
- $("#content").val(conent);
- var is_top = [[${review.is_top}]];
- console.log(is_top);
- if (is_top){
- $("input:radio[name='is_top'][value= '1']").prop("checked", true);
- }
- else {
- $("input:radio[name='is_top'][value= '0']").prop("checked", true);
- }
- });
-
- function findActivity() {
- console.log("123456789");
- var url = pagePath+ "/activity/review/activityList";
- layer_show("选择关联活动",url,800, 500);
- }
- function saveAsDraft() {
- submit(0);
- }
- function publish() {
- submit(1);
- }
- function submit(status) {
- $("#form-review-add").ajaxSubmit({
- type: 'post',
- url: pagePath + "/activity/review/update",
- dataType: "json",
- data: {
- status: status
- },
- success: function (data) {
- if (data.success) {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- /**
- * 取消
- */
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- </script>
- </body>
- </html>
|