<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('兑换礼品')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-member-exchange" th:object="${sysMemberDTO}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">消耗积分：</label>
                <div class="col-sm-8">
                    <input name="integral" th:field="*{integral}" class="form-control" type="text" maxlength="10" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">礼品名称：</label>
                <div class="col-sm-8">
                    <input name="giftName" th:field="*{giftName}" class="form-control" type="text" required>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
    var prefix = ctx + "system/bill"
    $("#form-member-exchange").validate({
        focusCleanup: true,
        rules:{
            integral:{
                digits:true
            },
        },
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/exchange", $('#form-member-exchange').serialize());
        }
    }
</script>
</body>
</html>