123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <!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">
- <label class="col-sm-2 control-label">头饰类型:</label>
- <div class="col-sm-10">
- <select name="allowPurse" id="allowPurse" class="form-control m-b" th:with="type=${@dict.getType('headwear_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">
- <select name="buyType" id="buyType" class="form-control m-b" th:with="type=${@dict.getType('buy_type')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
- </select>
- </div>
- </div>
- <div class="form-group" id="chargeErBanNo">
- <label class="col-sm-2 control-label">头饰名称:</label>
- <div class="col-sm-10">
- <input name="headwearName" id="headwearName" 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="leftLevel" min="0" name="leftLevel" class="form-control" type="number" placeholder="请输入等级要求" required/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">头饰金币:</label>
- <div class="col-sm-10">
- <input id="goldPrice" min="0" name="goldPrice" class="form-control" type="number" 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="headwearStatus" name="headwearStatus" value="1" checked>
- <label for="headwearStatus">有效</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="headwearStatus2" name="headwearStatus" value="2">
- <label for="headwearStatus2">无效</label>
- </div>
- </div>
- <label class="col-sm-2 control-label">vgg特效:</label>
- <div class="col-sm-3">
- <div class="radio-box">
- <input type="radio" id="hasVggPic" name="hasVggPic" value="0" checked>
- <label for="hasVggPic">否</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="hasVggPic2" name="hasVggPic" value="1">
- <label for="hasVggPic2">是</label>
- </div>
- </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="picUrl" name="picUrl" class="form-control validate[required]"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">vgg图片:</label>
- <div class="col-sm-10">
- <img src="" id="imgUrl" style="width:250px;height:90px;" alt="">
- <input type="file" id="uploadFile" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
- <button class="btn btn-success" type="button" id="uploadBtn">上传</button>
- <input type="hidden" id="vggUrl" name="vggUrl" class="form-control validate[required]"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">角标图片:</label>
- <div class="col-sm-10">
- <img src="" id="markImage" style="width:250px;height:90px;" alt="">
- <input type="file" id="markPicFile" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
- <button class="btn btn-success" type="button" id="markPicBtn">上传</button>
- <input type="hidden" id="markPic" name="markPic" class="form-control validate[required]"/>
- </div>
- </div>
- <div class="form-group" >
- <label class="col-sm-2 control-label">排序:</label>
- <div class="col-sm-10">
- <input id="seqNo" name="seqNo" min="1" class="form-control" type="number" placeholder="请输入排序" required/>
- </div>
- </div>
- <div class="form-group" >
- <label class="col-sm-2 control-label">有效期(天):</label>
- <div class="col-sm-10">
- <input id="effectiveTime" min="1" name="effectiveTime" class="form-control" type="number" 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 + "mall/headwear";
- $("#form-notice-add").validate({
- onkeyup: false,
- rules:{
- headwearName:{
- minlength: 1,
- remote: {
- url: prefix + "/checkHeadWearName",
- type: "post",
- dataType: "json",
- data: {
- headWearName : function() {
- return $.common.trim($("#headwearName").val());
- }
- },
- dataFilter: function(data, type) {
- return $.validate.unique(data);
- }
- }
- }
- },
- messages: {
- "carName": {
- remote: "该头饰名称已经存在!"
- }
- },
- 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='picUrl']").val(result.data);
- }
- })
- });
- /**
- * vgg图片上传
- */
- $('#uploadBtn').on('click',function () {
- if($('#uploadFile').get(0).files[0]==undefined){
- $.modal.alertError("请选择要上传的文件!");
- return;
- }
- var formData = new FormData();
- formData.append("file", $('#uploadFile').get(0).files[0]);
- $.ajax({
- url: ctx + "file/upload",
- data: formData,
- type: "post",
- processData: false,
- contentType: false,
- success: function(result) {
- $('#imgUrl').attr('src',result.data);
- $("input[name='vggUrl']").val(result.data);
- }
- })
- });
- /**
- * 角标图片上传
- */
- $('#markPicBtn').on('click',function () {
- if($('#markPicFile').get(0).files[0]==undefined){
- $.modal.alertError("请选择要上传的文件!");
- return;
- }
- var formData = new FormData();
- formData.append("file", $('#markPicFile').get(0).files[0]);
- $.ajax({
- url: ctx + "file/upload",
- data: formData,
- type: "post",
- processData: false,
- contentType: false,
- success: function(result) {
- $('#markImage').attr('src',result.data);
- $("input[name='markPic']").val(result.data);
- }
- })
- });
- function submitHandler() {
- if ($.validate.form()) {
- $.operate.save(prefix + "/add", $('#form-notice-add').serialize());
- }
- }
- </script>
- </body>
- </html>
|