<!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-user-resetPwd">
        <div class="form-group">
            <label class="col-sm-3 control-label">兑换码：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text"  name="exchangeCode" />
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />

<script>
    $("#form-user-resetPwd").validate({
        rules:{
            oldPassword:{
                required:true,
                remote: {
                    url: ctx + "/hygl/shygljfglorderinfo/checkProduct",
                    type: "get",
                    dataType: "json",
                    data: {
                        exchangeCode: function() {
                            return $("input[name='exchangeCode']").val();
                        }
                    }
                }
            },

        },
        focusCleanup: true
    });

    function submitHandler() {
        var chrtype = [[${#strings.defaultString(@config.getKey('sys.account.chrtype'), 0)}]];
        var password = $("#exchangeCode").val();
        if ($.validate.form() && checkpwd(chrtype, password)) {
            $.operate.save(ctx + "/hygl/shygljfglorderinfo/checkProduct", $('#form-user-resetPwd').serialize());
        }
    }
</script>
</body>

</html>