123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <!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-dict-edit" th:object="${weekStarItemReward}">
- <input name="id" type="hidden" th:field="*{id}" />
- <div class="form-group">
- <label class="col-sm-2 control-label">周星类型:</label>
- <div class="col-sm-10">
- <select name="weekType" id="weekType" disabled="disabled" class="form-control m-b" th:with="type=${@dict.getType('week_star_gift_type')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{weekStarType}"></option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label for="giftId" class="col-sm-2 control-label">周星礼物:</label>
- <div class="col-sm-10" style="margin-bottom: 20px;">
- <select name="giftId" id="giftId" disabled="disabled">
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">奖项类型:</label>
- <div class="col-sm-10">
- <select name="type" id="type" class="form-control m-b" th:with="type=${@dict.getType('zxb_item_type')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label for="giftId" class="col-sm-2 control-label">奖项:</label>
- <div class="col-sm-10" style="margin-bottom: 20px;">
- <select name="itemId" id="itemId">
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">赠送天数:</label>
- <div class="col-sm-10">
- <input id="days" name="days" class="form-control" type="number" min="1" th:field="*{days}" placeholder="请输入赠送天数" required/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">内容:</label>
- <div class="col-sm-10">
- <input id="content" name="content" class="form-control" type="text" th:field="*{content}" placeholder="请输入内容" required/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">排序:</label>
- <div class="col-sm-10">
- <input id="seq" name="seq" class="form-control" type="number" min="1" th:field="*{seq}" placeholder="请输入排序" required/>
- </div>
- </div>
- </form>
- </div>
- <th:block th:include="include :: footer" />
- <script type="text/javascript">
- var prefix = ctx + "activity/zxb/award";
- $("#form-dict-edit").validate({
- focusCleanup: true
- });
- var weekType = $("#weekType").val();
- getWeekStartGiftByType(weekType);
- var type = $("#type").val();
- getWeekStartItem(type);
- $("#weekType").change(function(){
- var weekType = $("#weekType").val();
- getWeekStartGiftByType(weekType)
- });
- $("#type").change(function(){
- var type = $("#type").val();
- getWeekStartItem(type)
- });
- function getWeekStartItem(type){
- $.ajax({
- type: 'GET',
- async : false,
- url: prefix + '/getWeekStartItem?type=' + type,
- dataType:'json',
- success:function (data) {
- if (data.code == 0) {
- var _html = "";
- for(var i = 0; i < data.data.length; i ++) {
- _html += "<option value=" + data.data[i].itemId + ">" + data.data[i].itemName + "</option>";
- }
- $("#itemId").html(_html);
- }
- }
- })
- }
- function getWeekStartGiftByType(weekType){
- $.ajax({
- type: 'GET',
- async : false,
- url: ctx + 'activity/zxb/getWeekStartGiftByType?type=' + weekType,
- dataType:'json',
- success:function (data) {
- if (data.code == 0) {
- var _html = "";
- for(var i = 0; i < data.data.length; i ++) {
- _html += "<option value=" + data.data[i].giftId + ">" + data.data[i].giftName + "</option>";
- }
- $("#giftId").html(_html);
- }
- }
- })
- }
-
- function submitHandler() {
- if ($.validate.form()) {
- $.operate.save(prefix + "/edit", $('#form-dict-edit').serialize());
- }
- }
- </script>
- </body>
- </html>
|