123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <!DOCTYPE html>
- <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
- <head>
- <th:block th:include="include :: header('新增活动')" />
- </head>
- <body class="white-bg">
- <div class="wrapper wrapper-content animated fadeInRight ibox-content">
- <form class="form-horizontal m" id="form-notice-add">
- <div class="form-group" id="chargeErBanNo">
- <label class="col-sm-2 control-label">活动名称:</label>
- <div class="col-sm-10">
- <input name="actName" id="actName" class="form-control" type="text" placeholder="请输入活动名称" required/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">状态:</label>
- <div class="col-sm-3">
- <div class="radio-box">
- <input type="radio" id="actStatus" name="actStatus" value="1" checked>
- <label for="actStatus">有效</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="actStatus2" name="actStatus" value="2">
- <label for="actStatus2">无效</label>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">是否弹窗:</label>
- <div class="col-sm-10">
- <select name="alertWin" id="alertWin" class="form-control m-b" th:with="type=${@dict.getType('alert_win')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">图片:</label>
- <div class="col-sm-10">
- <img src="" id="picImage" style="width:250px;height:90px;" alt="">
- <input type="file" id="picUploadFile" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
- <button class="btn btn-success" type="button" id="picUploadBtn">上传</button>
- <input type="hidden" id="alertWinPic" name="alertWinPic" class="form-control validate[required]"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">弹窗位置:</label>
- <div class="col-sm-10">
- <select name="alertWinLoc" id="alertWinLoc" class="form-control m-b" th:with="type=${@dict.getType('alert_win_loc')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
- </select>
- </div>
- </div>
- <div class="form-group" id="chargeSkipType">
- <label class="col-sm-2 control-label">跳转类型:</label>
- <div class="col-sm-10">
- <select name="skipType" id="skipType" class="form-control m-b" th:with="type=${@dict.getType('skip_type')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">跳转地址:</label>
- <div class="col-sm-10">
- <input id="skipUrl" name="skipUrl" class="form-control" type="text" placeholder="请输入跳转地址" required/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">版本号:</label>
- <div class="col-sm-10">
- <input id="actAlertVersion" name="actAlertVersion" class="form-control" type="text" placeholder="请输入版本号" required/>
- </div>
- </div>
- </form>
- </div>
- <th:block th:include="include :: footer" />
- <th:block th:include="include :: summernote-js" />
- <script type="text/javascript">
- var prefix = ctx + "operation/activity";
- $("#form-notice-add").validate({
- onkeyup: false,
- focusCleanup: true
- });
- /**
- * 图片上传
- */
- $('#picUploadBtn').on('click',function () {
- if($('#picUploadFile').get(0).files[0]==undefined){
- $.modal.alertError("请选择要上传的文件!");
- return;
- }
- var formData = new FormData();
- formData.append("file", $('#picUploadFile').get(0).files[0]);
- $.ajax({
- url: ctx + "file/upload",
- data: formData,
- type: "post",
- processData: false,
- contentType: false,
- success: function(result) {
- $('#picImage').attr('src',result.data);
- $("input[name='alertWinPic']").val(result.data);
- }
- })
- });
- function submitHandler() {
- if ($.validate.form()) {
- $.operate.save(prefix + "/add", $('#form-notice-add').serialize());
- }
- }
- </script>
- </body>
- </html>
|