123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <!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="giftName" id="giftName" 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="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-10">
- <select name="giftType" id="giftType" class="form-control m-b" th:with="type=${@dict.getType('gift_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-3">
- <div class="radio-box">
- <input type="radio" id="giftStatus1" name="giftStatus" value="1" checked>
- <label for="giftStatus1">有效</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="giftStatus2" name="giftStatus" value="2">
- <label for="giftStatus2">无效</label>
- </div>
- </div>
- <label class="col-sm-2 control-label">礼物特效:</label>
- <div class="col-sm-3">
- <div class="radio-box">
- <input type="radio" id="hasEffect" name="hasEffect" value="0" checked>
- <label for="hasEffect">否</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="hasEffect2" name="hasEffect" value="1">
- <label for="hasEffect2">是</label>
- </div>
- </div>
- </div>
- <div class="form-group">
- <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>
- <label class="col-sm-2 control-label">最新礼物:</label>
- <div class="col-sm-3">
- <div class="radio-box">
- <input type="radio" id="isLatest" name="isLatest" value="0" checked>
- <label for="isLatest">否</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="isLatest2" name="isLatest" value="1">
- <label for="isLatest2">是</label>
- </div>
- </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="isNobleGift" name="isNobleGift" value="0" checked>
- <label for="isNobleGift">否</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="isNobleGift2" name="isNobleGift" value="1">
- <label for="isNobleGift2">是</label>
- </div>
- </div>
- <label class="col-sm-2 control-label">限时礼物:</label>
- <div class="col-sm-3">
- <div class="radio-box">
- <input type="radio" id="isTimeLimit" name="isTimeLimit" value="0" checked>
- <label for="isTimeLimit">否</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="isTimeLimit2" name="isTimeLimit" value="1">
- <label for="isTimeLimit2">是</label>
- </div>
- </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="isCanGive" name="isCanGive" value="0" checked>
- <label for="isCanGive">否</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="isCanGive2" name="isCanGive" value="1">
- <label for="isCanGive2">是</label>
- </div>
- </div>
- <label class="col-sm-2 control-label">表白礼物:</label>
- <div class="col-sm-3">
- <div class="radio-box">
- <input type="radio" id="isExpressGift" name="isExpressGift" value="0" checked>
- <label for="isExpressGift">否</label>
- </div>
- <div class="radio-box">
- <input type="radio" id="isExpressGift2" name="isExpressGift" value="1">
- <label for="isExpressGift2">是</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">
- <input id="seqNo" name="seqNo" min="1" class="form-control" type="number" placeholder="请输入排序" required/>
- </div>
- </div>
- <div class="form-group select-time" >
- <label class="col-sm-2 control-label">开始时间:</label>
- <div class="col-sm-10">
- <input id="startTime" name="startTime" class="form-control time-input" type="text" placeholder="请输入开始时间"/>
- </div>
- </div>
- <div class="form-group select-time" >
- <label class="col-sm-2 control-label">结束时间:</label>
- <div class="col-sm-10">
- <input id="endTime" name="endTime" class="form-control time-input" type="text" placeholder="请输入结束时间"/>
- </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/gift";
- $("#form-notice-add").validate({
- onkeyup: false,
- rules:{
- giftName:{
- minlength: 1,
- remote: {
- url: prefix + "/checkGiftName",
- type: "post",
- dataType: "json",
- data: {
- giftName : function() {
- return $.common.trim($("#giftName").val());
- }
- },
- dataFilter: function(data, type) {
- return $.validate.unique(data);
- }
- }
- }
- },
- messages: {
- "giftName": {
- 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);
- }
- })
- });
- function submitHandler() {
- if ($.validate.form()) {
- $.operate.save(prefix + "/add", $('#form-notice-add').serialize());
- }
- }
- </script>
- </body>
- </html>
|