var loaddfimg; (function ($, zou) { "use strict"; var page = { init: function () { /*判断当前浏览器是否是IE浏览器*/ if ($('body').hasClass('IE') || $('body').hasClass('InternetExplorer')) { $('#lr_loadbg').append(''); Pace.stop(); $.imServer.init(); } else { Pace.on('done', function () { $('#lr_loadbg').fadeOut(); Pace.options.target = '#zoupacenone'; $.imServer.init(); }); } // 通知栏插件初始化设置 toastr.options = { "closeButton": true, "debug": false, "newestOnTop": true, "progressBar": false, "positionClass": "toast-top-center", "preventDuplicates": false, "onclick": null, "showDuration": "300", "hideDuration": "1000", "timeOut": "3000", "extendedTimeOut": "1000", "showEasing": "swing", "hideEasing": "linear", "showMethod": "fadeIn", "hideMethod": "fadeOut" }; // 打开首页模板 zou.frameTab.open({ F_ModuleId: '0', F_Icon: 'fa fa-desktop', F_FullName: '首页模板', F_UrlAddress: '/Home/AdminDesktopTemp' }, true); zou.clientdata.init(function () { page.userInit(); // 初始页面特例 bootstrap($, zou); //$.imServer.init(); if ($('body').hasClass('IE') || $('body').hasClass('InternetExplorer')) { $('#lr_loadbg').fadeOut(); } }); // 加载数据进度 page.loadbarInit(); // 全屏按钮 page.fullScreenInit(); // 主题选择初始化 page.uitheme(); }, // 登录头像和个人设置 userInit: function () { var loginInfo = zou.clientdata.get(['userinfo']); var headimg; if (loginInfo.gender != 0) { headimg = top.$.rootUrl + '/Content/images/head/on-boy.jpg'; } else { headimg = top.$.rootUrl + '/Content/images/head/on-girl.jpg'; } loaddfimg = function () { document.getElementById('userhead').src = headimg; } var _html = '
'; _html += '用户头像'; _html += '' + loginInfo.realName + ''; _html += ''; _html += '
'; $('body').append(_html); $('#lr_loginout_btn').on('click', page.loginout); $('#lr_userinfo_btn').on('click', page.openUserCenter); $('#lr_clearredis_btn').on('click', page.clearredis); }, loginout: function () { // 安全退出 zou.layerConfirm("注:您确定要安全退出本次登录吗?", function (r) { if (r) { zou.httpAsyncPost($.rootUrl + '/Login/OutLogin', {}, function (data) { window.location.href = $.rootUrl + "/Login/Index"; }); } }); }, clearredis: function () { zou.layerConfirm("注:您确定要清空全部后台缓存数据吗?", function (r) { if (r) { zou.httpAsyncPost($.rootUrl + '/Home/ClearRedis', {}, function (data) { window.location.href = $.rootUrl + "/Login/Index"; }); } }); }, openUserCenter: function () { // 打开个人中心 zou.frameTab.open({ F_ModuleId: '1', F_Icon: 'fa fa-user', F_FullName: '个人中心', F_UrlAddress: '/UserCenter/Index' }); }, // 全屏按钮 fullScreenInit: function () { var _html = '
'; $('body').append(_html); $('#lr_fullscreen_btn').on('click', function () { if (!$(this).attr('fullscreen')) { $(this).attr('fullscreen', 'true'); page.requestFullScreen(); } else { $(this).removeAttr('fullscreen'); page.exitFullscreen(); } }); }, requestFullScreen: function () { var de = document.documentElement; if (de.requestFullscreen) { de.requestFullscreen(); } else if (de.mozRequestFullScreen) { de.mozRequestFullScreen(); } else if (de.webkitRequestFullScreen) { de.webkitRequestFullScreen(); } }, exitFullscreen: function () { var de = document; if (de.exitFullscreen) { de.exitFullscreen(); } else if (de.mozCancelFullScreen) { de.mozCancelFullScreen(); } else if (de.webkitCancelFullScreen) { de.webkitCancelFullScreen(); } }, // 加载数据进度 loadbarInit: function () { var _html = '
'; _html += '
'; _html += '
'; _html += '
'; $('body').append(_html); }, // 皮肤主题设置 uitheme: function () { var uitheme = top.$.cookie('Learn_ADMS_V6.1_UItheme') || '1'; var $setting = $('
'); var $btn = $(''); var _html = '
界面风格
'; _html += '
'; _html += '
'; _html += '
'; _html += '
'; _html += '
'; _html += '
'; $setting.append($btn); $setting.append(_html); $('body').append($setting); $btn.on('click', function () { var $parent = $(this).parent(); if ($parent.hasClass('opened')) { $parent.removeClass('opened'); } else { $parent.addClass('opened'); } }); $setting.find('input').click(function () { var value = $(this).val(); top.$.cookie('Learn_ADMS_V6.1_UItheme', value, { path: "/" }); window.location.href = $.rootUrl + '/Home/Index'; }); }, }; $(function () { page.init(); }); })(window.jQuery, top.zou);