
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>语言</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="~/layuiadmin/layui/css/layui.css" rel="stylesheet" media="all" />
    <script src="~/layuiadmin/layui/layui.js"></script>
    <link href="~/layuiadmin/style/admin.css" rel="stylesheet" media="all" />
    <script src="~/Content/Common.js"></script>
    <script src="~/Content/jquery-1.8.3.js"></script>
    <style type="text/css">
        ._TianChong {
            clear: both;
            height: 5px;
        }
    </style>
    <script type="text/javascript">
        var language = 'CHS';
        window.onload = function () {
            var height = document.documentElement.clientHeight - 32;
            document.getElementById("divMain").style.height = height + "px";
            if (window.top.location.href.split('/').indexOf('IndexEN') != -1) {
                language = 'EN';
            }

            $("#lblLanguage").text(getLanguage('语言', language));
            $("#btn_Save").val(getLanguage('保存', language));
        };
        layui.use(['layer', 'form'], function () {
            var form = layui.form;
            $.ajax({
                url: "/Home/GetLanguage",
                type: "post",
                dataType: "text",
                ContentType: "applocation/json;charset=utf-8",
                success: function (res) {
                    $("select[name='sel_Language']").find("option[value='" + res + "']").attr("selected", true);
                    form.render();
                }
            });
            form.render();
            var layer = layui.layer;
            $("#btn_Save").click(function () {
                var res = $("#sel_Language").find("option:selected").val();
                $.post("/Home/SetLanguage", { Language: res }, function (result) {
                    alert(getLanguage("保存成功", language));
                    window.location.href = '/Login/Index';
                });
            });
        });
    </script>
</head>
<body>
    <div class="layui-fluid">
        <div id="divMain" class="layui-card">
            <div class="layui-fluid">
                <div class="layui-row layui-col-space15">
                    <div class="layui-form-item layui-form-text layui-form">
                        <div class="layui-input-block">
                            <div class="_TianChong"></div>
                            <div class="_TianChong"></div>
                            <div class="_TianChong"></div>
                            <div class="_TianChong"></div>
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width: 120px;" id="lblLanguage"></label>
                                <div class="layui-input-inline" style="width: auto;">
                                    <select id="sel_Language" name="sel_Language" lay-filter="sel_Language">
                                        <option value="CHS" selected="">中文-CH</option>
                                        <option value="EN">英文-EN</option>
                                    </select>
                                </div>
                            </div>
                            <div class="_TianChong" style="height:10px;"></div>
                            <div>
                                <label class="layui-form-label" style="width: 120px;"></label>
                                <div class="layui-input-inline" style="width: auto;">
                                    <input id="btn_Save" type="button" class="layui-btn layuiadmin-btn-comm" style="width:180px;" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
