@using GBLab.Common.Expand
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    @*Meta*@
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    @*上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！*@
    @*Seo*@
    <title>@(ViewBag.Title)</title>
    <meta name="keywords" content="@(ViewBag.Keywords)" />
    <meta name="description" content="@(ViewBag.Description)" />
    @(RenderSection("Head", required: false))
    @*Ico*@
    <link rel="icon" href="@(Url.Domain_Static("/favicon.ico"))" />
    @*Css*@
    @(Html.Raw(ViewData["Meta"].DefaultIsNullOrEmpty("")))
    @*Css*@@*Bootstrap*@
    <link rel="stylesheet" href="/Resource/Skin/School_Pre/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/Resource/Skin/School_Pre/css/page.css?v=@(ViewBag.Version)" />
    @(RenderSection("HeadStyle", required: false))
    @*Js*@
    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
    @(RenderSection("HeadScript", required: false))
</head>
<body>
    @{Html.RenderPartial("~/Views/School_Pre/Shared/_Part/_HeaderMenu.cshtml");}
    <div class="main">
        @(RenderBody())
        @(RenderSection("Footer", required: false))
        @{Html.RenderPartial("~/Views/School_Pre/Shared/_Part/_FriendLink.cshtml");}
    </div>
    @{Html.RenderPartial("~/Views/School_Pre/Shared/_Part/_Bottom.cshtml");}
    @*Js*@@*jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边)*@
    <script src="/Resource/App_Themes/jquery/jquery-2.1.4.min.js?v=@(ViewBag.Version)"></script>
    @*加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。*@
    <script src="/Resource/Skin/School_Pre/js/bootstrap.min.js"></script>

    <script src="/Resource/Extend/libs/sea/sea.js?v=@(ViewBag.Version)"></script>
    <script src="/Resource/Extend/libs/sea/seajs-css.js?v=@(ViewBag.Version)"></script>
    <script src="/Resource/Extend/helper/sea/seaConfig.js?v=@(ViewBag.Version)"></script>
    <script>
        seajs.use(
            [
                @* 全局配置 *@
                , "/Resource/Extend/helper/global/global_config.js?v=@(ViewBag.Version)"
            ]
            , function (main) {
            }
        );
    </script>
    <script>
        String.prototype.format = function (args) {
            var result = this;
            if (arguments.length > 0) {
                if (arguments.length == 1 && typeof (args) == "object") {
                    for (var key in args) {
                        if (args[key] != undefined) {
                            var reg = new RegExp("({" + key + "})", "g");
                            result = result.replace(reg, args[key]);
                        }
                    }
                }
                else {
                    for (var i = 0; i < arguments.length; i++) {
                        if (arguments[i] != undefined) {
                            //var reg = new RegExp("({[" + i + "]})", "g");//这个在索引大于9时会有问题，谢谢何以笙箫的指出

                            var reg = new RegExp("({)" + i + "(})", "g");
                            result = result.replace(reg, arguments[i]);
                        }
                    }
                }
            }
            return result;
        }
    </script>
    <script>
        // 弹出呈现相册
        function showImage(source) {
            var sourceItem = source.split("|")
            var templateItem = '{"alt":"{0}","pid":{1},"src":"{2}","thumb":"{2}"}';
            var template = '{"title":"相册预览","id":123,"start":0,"data":[{0}]}';
            var result = "";
            for (var i = 0; i < sourceItem.length; i++) {
                if (sourceItem[i] == '') {
                    continue;
                }
                if (i == 0) {
                    result += templateItem.format(sourceItem[i], i, sourceItem[i]);
                } else {
                    result += ',' + templateItem.format(sourceItem[i], i, sourceItem[i]);
                }
            }
            result = template.format(result);
            layer.photos({
                photos: $.parseJSON(result),
                anim: 5,
                tab: function (pic, layero) {
                    console.log(pic) //当前图片的一些信息
                }
            });
        }
    </script>
    @(RenderSection("JavaScript", required: false))
</body>
</html>