@using MySystem.Models;
@{SysAdmin editData = ViewBag.data as SysAdmin;}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <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 rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <script src="/admin/js/jquery-1.10.1.min.js"></script>
</head>
<body style="background-color:#fff;">

    <div class="layui-form" style="padding: 20px 0 0 0;">
        <form class="layui-form" id="confirmFrm">
            <div class="layui-card">
          <div class="layui-card-body">
        <div class="layui-tab" lay-filter="mytabbar">
                <div class="layui-tab-content mt20">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form-item">
                            <label class="layui-form-label">姓名</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="RealName" name="RealName" value="@editData.RealName" maxlength="50" lay-verify="required|" autocomplete="off" placeholder="请输入姓名">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item ml10">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" onclick="save()">立即提交</button>
                </div>
            </div>
        </form>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script>
        function save() {
            var index = layer.load(1, {
                shade: [0.5, '#000']
            });
            var userdata = $("#confirmFrm").serialize();
            $.ajax({
                type: "POST",
                url: "/Admin/Home/AdminInfoPost?r=" + Math.random(1),
                data: userdata,
                dataType: "text",
                success: function (data) {
                    layer.close(index);
                    if (data == "success") {
                        layer.msg("修改成功");
                    } else {
                        layer.msg(data);
                    }
                }
            });
        }
        
        
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'upload', 'layedit'], function () {
            var $ = layui.$;
            var element = layui.element;

            //Hash地址的定位
            var layid = location.hash.replace(/^#test=/, '');
            element.tabChange('test', layid);
            element.on('tab(test)', function (elem) {
                location.hash = 'test=' + $(this).attr('lay-id');
            });
        })
    </script>
</body>
</html>