123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <!DOCTYPE html>
- <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
- <head>
- <th:block th:include="include :: header('编辑点点币pk')" />
- </head>
- <body class="white-bg">
- <div class="wrapper wrapper-content animated fadeInRight ibox-content">
- <form class="form-horizontal m" id="form-dict-edit" th:object="${pointPk}">
- <input name="carId" type="hidden" th:field="*{id}" />
- <div class="form-group" >
- <label class="col-sm-2 control-label">题目:</label>
- <div class="col-sm-10">
- <input id="title" name="title" class="form-control" type="text" th:field="*{title}" required/>
- </div>
- </div>
- <div class="form-group" >
- <label class="col-sm-2 control-label">红方图片:</label>
- <div class="col-sm-10">
- <img src="" id="addRedPic" style="width:250px;height:90px;" alt="" th:src="*{redPic}">
- <input type="file" id="addUploadFile" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
- <button class="btn btn-success" type="button" id="addUploadBtn">上传</button>
- <input type="hidden" id="addRedPicUrl" name="redPic" class="form-control validate[required]" th:field="*{redPic}" required/>
- </div>
- </div>
- <div class="form-group" >
- <label class="col-sm-2 control-label">蓝方图片:</label>
- <div class="col-sm-10">
- <img src="" id="addBluePic" style="width:250px;height:90px;" alt="" th:src="*{bluePic}">
- <input type="file" id="addUploadFile2" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
- <button class="btn btn-success" type="button" id="addUploadBtn2">上传</button>
- <input type="hidden" id="addBluePicUrl" name="bluePic" class="form-control validate[required]" th:field="*{bluePic}" required/>
- </div>
- </div>
- <div class="form-group" >
- <label class="col-sm-2 control-label">红方选项:</label>
- <div class="col-sm-10">
- <input type="text" id="addRedAnswer" name="redAnswer" class="form-control validate[required]" th:field="*{redAnswer}" required>
- </div>
- </div>
- <div class="form-group" >
- <label class="col-sm-2 control-label">蓝方选项:</label>
- <div class="col-sm-10">
- <input type="text" id="addBlueAnswer" name="blueAnswer" class="form-control validate[required]" th:field="*{blueAnswer}" required>
- </div>
- </div>
- <div class="form-group" >
- <label class="col-sm-2 control-label">活动状态:</label>
- <div class="col-sm-10">
- <select name="pkStatus1" id="pkStatus" class="form-control m-b" th:with="type=${@dict.getType('point_pk_activity_status')}" disabled >
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{pkStatus}" ></option>
- </select>
- <input name="carId" type="hidden" th:field="*{pkStatus}" />
- </div>
- </div>
- <div class="form-group select-time" >
- <label class="col-sm-2 control-label">开奖时间:</label>
- <div class="col-sm-10">
- <input id="time" name="lotteryTime" class="form-control time-input" type="text" th:field="*{lotteryTime}" 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 + "activity/point/pk";
- $("#form-dict-edit").validate({
- focusCleanup: true
- });
- /**
- * 红方图片上传
- */
- $('#addUploadBtn').on('click',function () {
- if($('#addUploadFile').get(0).files[0]==undefined){
- $.modal.alertError("请选择要上传的文件!");
- return;
- }
- var formData = new FormData();
- formData.append("file", $('#addUploadFile').get(0).files[0]);
- $.ajax({
- url: ctx + "file/upload",
- data: formData,
- type: "post",
- processData: false,
- contentType: false,
- success: function(result) {
- $('#addRedPic').attr('src',result.data);
- $("input[name='redPic']").val(result.data);
- }
- })
- });
- /**
- * 蓝方图片上传
- */
- $('#addUploadBtn2').on('click',function () {
- if($('#addUploadFile2').get(0).files[0]==undefined){
- $.modal.alertError("请选择要上传的文件!");
- return;
- }
- var formData = new FormData();
- formData.append("file", $('#addUploadFile2').get(0).files[0]);
- $.ajax({
- url: ctx + "file/upload",
- data: formData,
- type: "post",
- processData: false,
- contentType: false,
- success: function(result) {
- $('#addBluePic').attr('src',result.data);
- $("input[name='bluePic']").val(result.data);
- }
- })
- });
- function submitHandler() {
- if ($.validate.form()) {
- $.operate.save(prefix + "/edit", $('#form-dict-edit').serialize());
- }
- }
- </script>
- </body>
- </html>
|