add need files
21
OpenAuth.Mvc/css/images.css
Normal file
@ -0,0 +1,21 @@
|
||||
.layui-flow-more{ clear: both; margin-top: 20px; }
|
||||
#Images li{ width:19%; margin:0.5% 0.5%; float: left; overflow:hidden;}
|
||||
#Images li img{ width:100%; }
|
||||
#Images li .operate{ display: block; height: 40px; width:100%; background:#f4f5f9; }
|
||||
#Images li .operate .check{ float:left; margin-left:11px; height:18px; padding:11px 0; }
|
||||
#Images li .operate .img_del{ float:right; margin:7px 11px 0 0; font-size: 22px; cursor:pointer; }
|
||||
#Images li .operate .img_del:hover{ color:#f00; }
|
||||
|
||||
/*适配*/
|
||||
@media screen and (max-width:1050px){
|
||||
/*用户信息*/
|
||||
#Images li{ width:24%;}
|
||||
}
|
||||
@media screen and (max-width: 750px){
|
||||
/*用户信息*/
|
||||
#Images li{ width:49%;}
|
||||
}
|
||||
@media screen and (max-width:432px){
|
||||
/*用户信息*/
|
||||
#Images li{ width:99%;}
|
||||
}
|
9
OpenAuth.Mvc/css/login.css
Normal file
@ -0,0 +1,9 @@
|
||||
body{overflow:hidden;}
|
||||
|
||||
.video-player{background-color: transparent;display: block;position: absolute;z-index: 1;top:0;}
|
||||
.video_mask{ width:100%; height:100%; position:absolute; left:0; top:0; z-index:90; background-color:rgba(0,0,0,0.5); }
|
||||
.login{ height:260px;width:260px;padding: 20px;background-color:rgba(0,0,0,0.5);border-radius: 4px;position:absolute;left: 50%;top: 50%; margin:-150px 0 0 -150px;z-index:99;}
|
||||
.login h1{ text-align:center; color:#fff; font-size:24px; margin-bottom:20px; }
|
||||
.form_code{ position:relative; }
|
||||
.form_code .code{ position:absolute; right:0; top:1px; cursor:pointer; }
|
||||
.login_btn{ width:100%; }
|
188
OpenAuth.Mvc/css/main.css
Normal file
@ -0,0 +1,188 @@
|
||||
/*公共样式*/
|
||||
.main_body{ min-width:320px; }
|
||||
.layui-elem-quote.title{ padding:10px 15px; margin-bottom:0; }
|
||||
.layui-tab-more{ position: relative; z-index: 99; background:#fff; }
|
||||
.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{ height:42px !important; }
|
||||
.layui-layer-tab .layui-layer-title span{ min-width:45px !important; }
|
||||
.marg0{ margin:0; }
|
||||
/*模拟加载层图标样式*/
|
||||
.layui-layer-dialog .layui-layer-content .layui-layer-ico16{ background-size:100% 100% !important; }
|
||||
|
||||
/*样式改变的过渡*/
|
||||
.showMenu .layui-body,.showMenu .layui-footer,.showMenu.layui-layout-admin .layui-side,.logo,.top_menu .layui-nav-item[pc],.component,.top_menu .layui-nav-item[mobile],.layui-nav,.layui-layout-admin .layui-main,.site-mobile .layui-side,.layui-layout-admin .layui-side,.site-mobile .site-tree-mobile,.layui-body,.layui-layout-admin .layui-footer,.layui-layout-admin .layui-side,.panel,.panel .panel_icon i{ transition: all 0.3s ease-in-out;-webkit-transition: all 0.3s ease-in-out;-o-transition: all 0.3s ease-in-out;-moz-transition: all 0.3s ease-in-out;-ms-transition: all 0.3s ease-in-out; }
|
||||
|
||||
|
||||
.showMenu.layui-layout-admin .layui-side{ left:-200px; }
|
||||
.showMenu .layui-body,.showMenu .layui-footer{ left:0; }
|
||||
.layui-layout-admin .layui-main{ margin:0; }
|
||||
.logo{ color: #fff; float: left; line-height:60px; font-size:20px; padding:0 25px; text-align: center; width:150px;}
|
||||
.hideMenu{ float:left; width:20px; height:20px; margin:15px 15px 0 0; font-size:17px; text-align:center; padding:5px 5px; color:#fff; background-color:#1AA094; }
|
||||
.hideMenu:hover{ color:#fff; }
|
||||
.weather{ color:#fff; float:left; margin:15px 0 0 50px;}
|
||||
.component{ float: left; width:200px; height:30px; margin-top: 15px; position: relative;}
|
||||
.component .layui-input{ height:30px; line-height: 30px; font-size:12px; border:none; transition: all 0.3s; }
|
||||
.component .layui-input:focus{ background:#fff; color:#000; }
|
||||
.component .layui-form-select dl{ top:33px; background:#fff; }
|
||||
.component .layui-form-select .layui-edge,.top_menu .layui-nav-item[mobile]{ display:none; }
|
||||
.component .layui-icon{ position: absolute; right:8px; top:8px; color:#000; }
|
||||
|
||||
/*顶部右侧导航*/
|
||||
.layui-nav .layui-nav-item>a{ color:#fff; }
|
||||
.top_menu{ position:absolute; right:0; background:none }
|
||||
.top_menu.layui-nav .layui-this:after{ width:0px; }
|
||||
.top_menu.layui-nav .layui-this,.closeBox.layui-nav .layui-this{ background-color:transparent; }
|
||||
.top_menu.layui-nav .layui-this a,.closeBox.layui-nav .layui-this a{ color:#c2c2c2; }
|
||||
.top_menu.layui-nav dd.layui-this a,.closeBox.layui-nav dd.layui-this a{ color:#333; }
|
||||
.top_menu.layui-nav .layui-nav-child a:hover,.closeBox.layui-nav .layui-nav-child a:hover{ color:#fff; background-color:#5FB878; }
|
||||
.top_menu .iconfont{ font-size: 14px !important; }
|
||||
.top_menu .layui-nav-bar{ top:60px !important; background-color:rgba(0,0,0,0.7) }
|
||||
|
||||
/*左侧用户头像*/
|
||||
.layui-nav{ background-color:inherit !important; }
|
||||
.layui-layout-admin .layui-side{ left:0; }
|
||||
.user-photo{width: 200px; height: 120px; padding-top: 15px; padding-bottom: 5px;}
|
||||
.user-photo a.img{ display: block; width: 76px; height: 76px; margin: 0 auto; margin-bottom: 15px;}
|
||||
.user-photo a.img img{ display: block; border: none; width: 100%; height: 100%; border-radius: 50%; -webkit-border-radius: 50%; -moz-border-radius: 50%; border: 4px solid #44576b;}
|
||||
.user-photo p{ display: block; width: 100%; height: 25px; color: #ffffff; text-align: center; font-size: 12px; white-space: nowrap;line-height: 25px; overflow: hidden;}
|
||||
/*左侧导航重定义*/
|
||||
.layui-nav-item a cite{ padding:0 5px; }
|
||||
.layui-side-scroll{ height:auto; }
|
||||
.layui-nav-tree .layui-nav-child a{ padding-left: 40px; }
|
||||
.layui-nav-tree .layui-nav-child a:hover{ background-color:#4E5465; }
|
||||
.layui-nav-tree .layui-nav-child dd.layui-this a:hover{ background-color:#009688; }
|
||||
|
||||
/*右侧body*/
|
||||
#top_tabs_box{ padding-right:138px; height:40px; border-bottom:1px solid #e2e2e2; }
|
||||
#top_tabs{ position: absolute; border-bottom:none;}
|
||||
/*多窗口页面操作下拉*/
|
||||
.closeBox{ position:absolute; right:0; background-color:#fff !important; color:#000; border-left:1px solid #e2e2e2; border-bottom:1px solid #e2e2e2; }
|
||||
.closeBox .layui-nav-item{ line-height:40px; }
|
||||
.closeBox .layui-nav-item a,.closeBox .layui-nav-item a:hover{ color:#000; }
|
||||
.closeBox .layui-nav-more{ top:17px; }
|
||||
.closeBox .layui-nav-mored{ top:11px; }
|
||||
.closeBox .layui-nav-child{ top:42px; left:-12px; }
|
||||
.closeBox .layui-nav-bar{ display:none; }
|
||||
.closeBox .icon-caozuo{ font-size: 20px; position:absolute; top:1px; left:-2px; }
|
||||
|
||||
.layui-body{overflow:hidden; border-top:5px solid #1AA094;border-left:2px solid #1AA094;}
|
||||
.layui-tab-content{ height:100%; padding:0; }
|
||||
.layui-tab-item{ position: absolute; top: 41px; bottom:0; left: 0; right: 0; padding: 0; margin: 0; -webkit-overflow-scrolling:touch; overflow:auto;}
|
||||
.layui-tab-title .layui-this{ background-color:#18A093;}
|
||||
.layui-tab-title .layui-this:after{ border:none; }
|
||||
.layui-tab-title li cite{ font-style: normal; padding-left:5px; }
|
||||
.layui-tab-card .layui-tab-title{background-color: #ffffff}
|
||||
.layui-tab-card .layui-tab-title .layui-this{background-color: #f2f2f2}
|
||||
.clildFrame.layui-tab-content{ padding-right: 0; }
|
||||
.clildFrame.layui-tab-content iframe{ width: 100%; height:100%; border:none; min-width: 320px; position:absolute; }
|
||||
/*main.html*/
|
||||
.row,.col,.panel_word,.panel_icon{ box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; -o-box-sizing:border-box;}
|
||||
.row{ margin-left:-10px; overflow:hidden;display: flex; flex-wrap: wrap;}
|
||||
.col{ padding-left:10px;}
|
||||
.panel{float: left; text-align: center; width:16.666%; min-width:210px; margin-bottom: 10px;}
|
||||
.panel_box a{display:block; background-color:#f2f2f2; border-radius:5px; overflow:hidden; }
|
||||
.panel_icon{ width:40%; display: inline-block; padding:22px 0; background-color:#54ade8;float:left;}
|
||||
.panel_icon i{ font-size:3em; color:#fff;}
|
||||
.panel a:hover .panel_icon i{ display:inline-block; transform:rotate(360deg); -webkit-transform:rotate(360deg); -moz-transform:rotate(360deg); -o-transform:rotate(360deg); -ms-transform:rotate(360deg);}
|
||||
.panel_word{ width:60%; display: inline-block; float:right; margin-top: 22px; }
|
||||
.panel_word span{ font-size:25px; display:block; height:30px; line-height:30px; }
|
||||
.allNews em{ font-style:normal; font-size:16px;display: block; }
|
||||
.panel_box a .allNews cite{ display:none; }
|
||||
.panel_box a cite{ font-size:16px; display: block; font-style:normal; }
|
||||
.sysNotice{ width:50%; float: left; }
|
||||
.sysNotice .layui-elem-quote{ line-height:26px; position: relative;}
|
||||
.sysNotice .layui-table{ margin-top:0; border-left:5px solid #e2e2e2; }
|
||||
.sysNotice .title .icon-new1{ position: absolute; top:8px; margin-left: 10px; color:#f00; font-size:25px; }
|
||||
.explain .layui-btn{ margin:5px 5px 5px 0; }
|
||||
|
||||
/*打开页面动画*/
|
||||
.layui-tab-item.layui-show{ animation:moveTop 1s; -webkit-animation:moveTop 1s; animation-fill-mode:both; -webkit-animation-fill-mode:both; }
|
||||
@keyframes moveTop{
|
||||
0% {opacity: 0;-webkit-transform: translateY(20px);-ms-transform: translateY(20px);transform: translateY(20px);}
|
||||
100% {opacity: 1;-webkit-transform: translateY(0);-ms-transform: translateY(0);transform: translateY(0);}
|
||||
}
|
||||
@-o-keyframes moveTop{
|
||||
0% {opacity: 0;-webkit-transform: translateY(20px);-ms-transform: translateY(20px);transform: translateY(20px);}
|
||||
100% {opacity: 1;-webkit-transform: translateY(0);-ms-transform: translateY(0);transform: translateY(0);}
|
||||
}
|
||||
@-moz-keyframes moveTop{
|
||||
0% {opacity: 0;-webkit-transform: translateY(20px);-ms-transform: translateY(20px);transform: translateY(20px);}
|
||||
100% {opacity: 1;-webkit-transform: translateY(0);-ms-transform: translateY(0);transform: translateY(0);}
|
||||
}
|
||||
@-webkit-keyframes moveTop{
|
||||
0% {opacity: 0;-webkit-transform: translateY(20px);-ms-transform: translateY(20px);transform: translateY(20px);}
|
||||
100% {opacity: 1;-webkit-transform: translateY(0);-ms-transform: translateY(0);transform: translateY(0);}
|
||||
}
|
||||
|
||||
/*锁屏*/
|
||||
.admin-header-lock{width: 320px; height: 170px; padding: 20px; position: relative; text-align: center;}
|
||||
.admin-header-lock-img{width: 60px; height: 60px; margin: 0 auto;}
|
||||
.admin-header-lock-img img{width: 60px; height: 60px; border-radius: 100%;}
|
||||
.admin-header-lock-name{color: #009688;margin: 8px 0 15px 0;}
|
||||
.input_btn{ overflow: hidden; margin-bottom: 10px; }
|
||||
.admin-header-lock-input{width: 170px; color: #fff;background-color: #009688; float: left; margin:0 10px 0 40px; border:none;}
|
||||
.admin-header-lock-input::-webkit-input-placeholder {color:#fff;}
|
||||
.admin-header-lock-input::-moz-placeholder {color:#fff;}
|
||||
.admin-header-lock-input::-ms-input-placeholder {color:#fff;}
|
||||
.admin-header-lock-input:-moz-placeholder {color:#fff;}
|
||||
#unlock{ float: left; }
|
||||
#lock-box p{ color:#e60000; }
|
||||
|
||||
/*换肤*/
|
||||
.skins_box{ padding:10px 34px 0; }
|
||||
.skinBtn{ text-align:right; }
|
||||
/*橙色*/
|
||||
.orange .layui-layout-admin .layui-header{ background-color:orange!important; }
|
||||
.orange .layui-bg-black{ background-color:#e47214!important; }
|
||||
/*蓝色*/
|
||||
.blue .layui-layout-admin .layui-header{ background-color:#3396d8!important; }
|
||||
.blue .layui-bg-black,.blue .hideMenu{ background-color:#146aa2!important; }
|
||||
/*藏青*/
|
||||
.cyan .layui-layout-admin .layui-header{ background-color:#2F4056!important; }
|
||||
.cyan .layui-bg-black, .cyan .hideMenu{ background-color:#2F4056!important; }
|
||||
|
||||
/*自定义*/
|
||||
.skinCustom{ visibility:hidden; }
|
||||
.skinCustom input{ width:48%; margin:5px 2% 5px 0; float:left; }
|
||||
|
||||
.orange .layui-nav-tree .layui-nav-child a,.blue .layui-nav-tree .layui-nav-child a{ color:#fff; }
|
||||
.orange .top_menu.layui-nav .layui-nav-more,.blue .top_menu.layui-nav .layui-nav-more{border-color:#fff transparent transparent !important;}
|
||||
.orange .top_menu.layui-nav-itemed .layui-nav-more,.orange .top_menu.layui-nav .layui-nav-mored,.blue .top_menu.layui-nav-itemed .layui-nav-more,.blue .top_menu.layui-nav .layui-nav-mored{border-color:transparent transparent #fff !important;}
|
||||
|
||||
/*底部*/
|
||||
.footer{ text-align: center; line-height:44px;border-left: 2px solid #1AA094;}
|
||||
|
||||
|
||||
/*响应式*/
|
||||
@media screen and (max-width:1282px){
|
||||
.panel{ width:33.3333%; }
|
||||
}
|
||||
@media screen and (max-width:1050px){
|
||||
.layui-nav.top_menu .layui-nav-item a{ padding:0 10px; }
|
||||
/*天气信息*/
|
||||
.weather[pc]{ display: none !important; }
|
||||
.sysNotice{ width:100%; }
|
||||
.component{ width:165px; }
|
||||
}
|
||||
@media screen and (max-width: 750px){
|
||||
.logo{ padding:0;}
|
||||
.top_menu .layui-nav-item[pc],.component,.site-mobile .site-tree-mobile{ display: none !important; }
|
||||
.top_menu .layui-nav-item.showNotice[pc]{ display:inline-block !important; }
|
||||
.top_menu .layui-nav-item[mobile]{ display:inline-block; }
|
||||
.layui-nav.top_menu,.layui-nav.top_menu .layui-nav-item a{ padding:0 10px; }
|
||||
.layui-layout-admin .layui-main{ margin-right: 0; }
|
||||
.hideMenu{ display:none; }
|
||||
/*左侧导航*/
|
||||
.layui-layout-admin .layui-side{ left:-260px; }
|
||||
.site-mobile .layui-side{ left: 0; z-index:9999; }
|
||||
.site-tree-mobile {display: block!important; position: fixed; z-index: 100000; bottom: 15px; left: 15px; width: 50px; height: 50px; line-height: 50px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;}
|
||||
.site-mobile .site-mobile-shade { content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.8); z-index: 999;}
|
||||
|
||||
/*layui-body*/
|
||||
.panel{ width:50%; }
|
||||
|
||||
.layui-body,.layui-layout-admin .layui-footer{ left:0; }
|
||||
}
|
||||
@media screen and (max-width:432px){
|
||||
.top_menu .layui-nav-item.showNotice[pc]{ display:none !important; }
|
||||
.panel{ width:100%; }
|
||||
}
|
14
OpenAuth.Mvc/css/message.css
Normal file
@ -0,0 +1,14 @@
|
||||
.selectMsg{ width:110px; margin-right: 15px; }
|
||||
|
||||
.msg_info,.msg_time,.msg_reply,.msg_opr{min-height:50px; text-align:center;}
|
||||
.msg_info{text-align:left; position: relative; }
|
||||
.msg_info>img{ position: absolute; left:10px; top:10px; cursor:pointer; }
|
||||
.msg_info .user_info{ padding-left:55px; line-height:25px; }
|
||||
.msg_info .user_info h2{ color:#222; cursor:pointer; }
|
||||
.msg_info .user_info h2:hover{ color:#1AA094;}
|
||||
.msg_info .user_info p{ color:#8d8d8d; }
|
||||
.msg_reply{ color:#e15f63; }
|
||||
|
||||
/*回复*/
|
||||
.replay_edit{ overflow: hidden; margin-bottom:20px; }
|
||||
.replay_edit a{margin-top: 10px; width:100px; float:right;}
|
6
OpenAuth.Mvc/css/news.css
Normal file
@ -0,0 +1,6 @@
|
||||
.news_search{ padding:10px 10px; }
|
||||
.layui-table,.layui-table th{ text-align:center; }
|
||||
.news_list .layui-form-switch{ margin-top:0; }
|
||||
|
||||
/*分页*/
|
||||
#page{ text-align:right; }
|
24
OpenAuth.Mvc/css/user.css
Normal file
@ -0,0 +1,24 @@
|
||||
form input.layui-input[disabled]{ background:#f2f2f2; color:#595963!important; }
|
||||
.user_left{ width:45%; float: left; margin:20px 0 0 5%; }
|
||||
.user_right{ width:25%; float: left; margin:20px 0 0 5%; text-align: center; }
|
||||
.user_right p{ margin:10px 0 25px; font-size: 12px; text-align: center; color: #FF5722;}
|
||||
.user_right img#userFace{ width:200px; height:200px; }
|
||||
.layui-table,.layui-table th{ text-align:center; }
|
||||
.userAddress.layui-form-item .layui-input-inline{ width:23%; }
|
||||
.userAddress.layui-form-item .layui-input-inline:last-child{ margin-right:0; }
|
||||
/*用户列表*/
|
||||
#page{ text-align:right; }
|
||||
|
||||
/*修改密码*/
|
||||
.changePwd{ width:30%; margin:3% 0 0 5%; }
|
||||
|
||||
|
||||
/*适配*/
|
||||
@media screen and (max-width:1050px){
|
||||
/*用户信息*/
|
||||
.user_left,.user_right,.changePwd{ width:100%; float:none; margin-left: 0; }
|
||||
.user_right{ margin-bottom: 20px; }
|
||||
}
|
||||
@media screen and (max-width:450px){
|
||||
.userAddress.layui-form-item .layui-input-inline{ width:auto; }
|
||||
}
|
BIN
OpenAuth.Mvc/images/alipay.jpg
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
OpenAuth.Mvc/images/code.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
OpenAuth.Mvc/images/face.jpg
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
OpenAuth.Mvc/images/userface1.jpg
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
OpenAuth.Mvc/images/userface2.jpg
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
OpenAuth.Mvc/images/userface3.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
OpenAuth.Mvc/images/userface4.jpg
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
OpenAuth.Mvc/images/userface5.jpg
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
OpenAuth.Mvc/images/wechat.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
266
OpenAuth.Mvc/js/bodyTab.js
Normal file
@ -0,0 +1,266 @@
|
||||
/*
|
||||
@Author: 请叫我马哥
|
||||
@Time: 2017-04
|
||||
@Tittle: tab
|
||||
@Description: 点击对应按钮添加新窗口
|
||||
*/
|
||||
var tabFilter,menu=[],liIndex,curNav,delMenu;
|
||||
layui.define(["element","jquery"],function(exports){
|
||||
var element = layui.element,
|
||||
$ = layui.jquery,
|
||||
layId,
|
||||
Tab = function(){
|
||||
this.tabConfig = {
|
||||
closed : true,
|
||||
openTabNum : undefined, //最大可打开窗口数量
|
||||
tabFilter : "bodyTab", //添加窗口的filter
|
||||
url : undefined //获取菜单json地址
|
||||
}
|
||||
};
|
||||
|
||||
//获取二级菜单数据
|
||||
Tab.prototype.render = function() {
|
||||
var url = this.tabConfig.url;
|
||||
$.get(url,function(data){
|
||||
//显示左侧菜单
|
||||
if($(".navBar").html() == ''){
|
||||
var _this = this;
|
||||
$(".navBar").html(navBar(data)).height($(window).height()-245);
|
||||
element.init(); //初始化页面元素
|
||||
$(window).resize(function(){
|
||||
$(".navBar").height($(window).height()-245);
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//参数设置
|
||||
Tab.prototype.set = function(option) {
|
||||
var _this = this;
|
||||
$.extend(true, _this.tabConfig, option);
|
||||
return _this;
|
||||
};
|
||||
|
||||
//通过title获取lay-id
|
||||
Tab.prototype.getLayId = function(title){
|
||||
$(".layui-tab-title.top_tab li").each(function(){
|
||||
if($(this).find("cite").text() == title){
|
||||
layId = $(this).attr("lay-id");
|
||||
}
|
||||
})
|
||||
return layId;
|
||||
}
|
||||
//通过title判断tab是否存在
|
||||
Tab.prototype.hasTab = function(title){
|
||||
var tabIndex = -1;
|
||||
$(".layui-tab-title.top_tab li").each(function(){
|
||||
if($(this).find("cite").text() == title){
|
||||
tabIndex = 1;
|
||||
}
|
||||
})
|
||||
return tabIndex;
|
||||
}
|
||||
|
||||
//右侧内容tab操作
|
||||
var tabIdIndex = 0;
|
||||
Tab.prototype.tabAdd = function(_this){
|
||||
if(window.sessionStorage.getItem("menu")){
|
||||
menu = JSON.parse(window.sessionStorage.getItem("menu"));
|
||||
}
|
||||
var that = this;
|
||||
var closed = that.tabConfig.closed,
|
||||
openTabNum = that.tabConfig.openTabNum;
|
||||
tabFilter = that.tabConfig.tabFilter;
|
||||
if(_this.attr("target") == "_blank"){
|
||||
window.location.href = _this.attr("data-url");
|
||||
}else{
|
||||
var title = '';
|
||||
if(_this.find("i.iconfont,i.layui-icon").attr("data-icon") != undefined){
|
||||
if(_this.find("i.iconfont").attr("data-icon") != undefined){
|
||||
title += '<i class="iconfont '+_this.find("i.iconfont").attr("data-icon")+'"></i>';
|
||||
}else{
|
||||
title += '<i class="layui-icon">'+_this.find("i.layui-icon").attr("data-icon")+'</i>';
|
||||
}
|
||||
}
|
||||
//已打开的窗口中不存在
|
||||
if(that.hasTab(_this.find("cite").text()) == -1 && _this.siblings("dl.layui-nav-child").length == 0 && _this.attr("data-url")){
|
||||
if($(".layui-tab-title.top_tab li").length == openTabNum){
|
||||
layer.msg('只能同时打开'+openTabNum+'个选项卡哦。不然系统会卡的!');
|
||||
return;
|
||||
}
|
||||
tabIdIndex++;
|
||||
title += '<cite>'+_this.find("cite").text()+'</cite>';
|
||||
title += '<i class="layui-icon layui-unselect layui-tab-close" data-id="'+tabIdIndex+'">ဆ</i>';
|
||||
element.tabAdd(tabFilter, {
|
||||
title : title,
|
||||
content :"<iframe src='"+_this.attr("data-url")+"' data-id='"+tabIdIndex+"'></frame>",
|
||||
id : new Date().getTime()
|
||||
})
|
||||
//当前窗口内容
|
||||
var curmenu = {
|
||||
"icon" : _this.find("i.iconfont").attr("data-icon")!=undefined ? _this.find("i.iconfont").attr("data-icon") : _this.find("i.layui-icon").attr("data-icon"),
|
||||
"title" : _this.find("cite").text(),
|
||||
"href" : _this.attr("data-url"),
|
||||
"layId" : new Date().getTime()
|
||||
}
|
||||
menu.push(curmenu);
|
||||
window.sessionStorage.setItem("menu",JSON.stringify(menu)); //打开的窗口
|
||||
window.sessionStorage.setItem("curmenu",JSON.stringify(curmenu)); //当前的窗口
|
||||
element.tabChange(tabFilter, that.getLayId(_this.find("cite").text()));
|
||||
that.tabMove(); //顶部窗口是否可滚动
|
||||
}else{
|
||||
//当前窗口内容
|
||||
var curmenu = {
|
||||
"icon" : _this.find("i.iconfont").attr("data-icon")!=undefined ? _this.find("i.iconfont").attr("data-icon") : _this.find("i.layui-icon").attr("data-icon"),
|
||||
"title" : _this.find("cite").text(),
|
||||
"href" : _this.attr("data-url")
|
||||
}
|
||||
window.sessionStorage.setItem("curmenu",JSON.stringify(curmenu)); //当前的窗口
|
||||
element.tabChange(tabFilter, that.getLayId(_this.find("cite").text()));
|
||||
that.tabMove(); //顶部窗口是否可滚动
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//顶部窗口移动
|
||||
Tab.prototype.tabMove = function(){
|
||||
$(window).on("resize",function(){
|
||||
var topTabsBox = $("#top_tabs_box"),
|
||||
topTabsBoxWidth = $("#top_tabs_box").width(),
|
||||
topTabs = $("#top_tabs"),
|
||||
topTabsWidth = $("#top_tabs").width(),
|
||||
tabLi = topTabs.find("li.layui-this"),
|
||||
top_tabs = document.getElementById("top_tabs");;
|
||||
|
||||
if(topTabsWidth > topTabsBoxWidth){
|
||||
if(tabLi.position().left > topTabsBoxWidth || tabLi.position().left+topTabsBoxWidth > topTabsWidth){
|
||||
topTabs.css("left",topTabsBoxWidth-topTabsWidth);
|
||||
}else{
|
||||
topTabs.css("left",-tabLi.position().left);
|
||||
}
|
||||
//拖动效果
|
||||
var flag = false;
|
||||
var cur = {
|
||||
x:0,
|
||||
y:0
|
||||
}
|
||||
var nx,dx,x ;
|
||||
function down(){
|
||||
flag = true;
|
||||
var touch ;
|
||||
if(event.touches){
|
||||
touch = event.touches[0];
|
||||
}else {
|
||||
touch = event;
|
||||
}
|
||||
cur.x = touch.clientX;
|
||||
dx = top_tabs.offsetLeft;
|
||||
}
|
||||
function move(){
|
||||
var self=this;
|
||||
window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
|
||||
if(flag){
|
||||
var touch ;
|
||||
if(event.touches){
|
||||
touch = event.touches[0];
|
||||
}else {
|
||||
touch = event;
|
||||
}
|
||||
nx = touch.clientX - cur.x;
|
||||
x = dx+nx;
|
||||
if(x > 0){
|
||||
x = 0;
|
||||
}else{
|
||||
if(x < topTabsBoxWidth-topTabsWidth){
|
||||
x = topTabsBoxWidth-topTabsWidth;
|
||||
}else{
|
||||
x = dx+nx;
|
||||
}
|
||||
}
|
||||
top_tabs.style.left = x +"px";
|
||||
//阻止页面的滑动默认事件
|
||||
document.addEventListener("touchmove",function(){
|
||||
event.preventDefault();
|
||||
},false);
|
||||
}
|
||||
}
|
||||
//鼠标释放时候的函数
|
||||
function end(){
|
||||
flag = false;
|
||||
}
|
||||
//pc端拖动效果
|
||||
topTabs.on("mousedown",down);
|
||||
topTabs.on("mousemove",move);
|
||||
$(document).on("mouseup",end);
|
||||
//移动端拖动效果
|
||||
topTabs.on("touchstart",down);
|
||||
topTabs.on("touchmove",move);
|
||||
topTabs.on("touchend",end);
|
||||
}else{
|
||||
//移除pc端拖动效果
|
||||
topTabs.off("mousedown",down);
|
||||
topTabs.off("mousemove",move);
|
||||
topTabs.off("mouseup",end);
|
||||
//移除移动端拖动效果
|
||||
topTabs.off("touchstart",down);
|
||||
topTabs.off("touchmove",move);
|
||||
topTabs.off("touchend",end);
|
||||
topTabs.removeAttr("style");
|
||||
return false;
|
||||
}
|
||||
}).resize();
|
||||
}
|
||||
|
||||
$("body").on("click",".top_tab li",function(){
|
||||
//切换后获取当前窗口的内容
|
||||
var curmenu = '';
|
||||
var menu = JSON.parse(window.sessionStorage.getItem("menu"));
|
||||
curmenu = menu[$(this).index()-1];
|
||||
if($(this).index() == 0){
|
||||
window.sessionStorage.setItem("curmenu",'');
|
||||
}else{
|
||||
window.sessionStorage.setItem("curmenu",JSON.stringify(curmenu));
|
||||
if(window.sessionStorage.getItem("curmenu") == "undefined"){
|
||||
//如果删除的不是当前选中的tab,则将curmenu设置成当前选中的tab
|
||||
if(curNav != JSON.stringify(delMenu)){
|
||||
window.sessionStorage.setItem("curmenu",curNav);
|
||||
}else{
|
||||
window.sessionStorage.setItem("curmenu",JSON.stringify(menu[liIndex-1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
element.tabChange(tabFilter,$(this).attr("lay-id")).init();
|
||||
// new Tab().tabMove();
|
||||
})
|
||||
|
||||
//删除tab
|
||||
$("body").on("click",".top_tab li i.layui-tab-close",function(){
|
||||
//删除tab后重置session中的menu和curmenu
|
||||
liIndex = $(this).parent("li").index();
|
||||
var menu = JSON.parse(window.sessionStorage.getItem("menu"));
|
||||
//获取被删除元素
|
||||
delMenu = menu[liIndex-1];
|
||||
var curmenu = window.sessionStorage.getItem("curmenu")=="undefined" ? undefined : window.sessionStorage.getItem("curmenu")=="" ? '' : JSON.parse(window.sessionStorage.getItem("curmenu"));
|
||||
if(JSON.stringify(curmenu) != JSON.stringify(menu[liIndex-1])){ //如果删除的不是当前选中的tab
|
||||
// window.sessionStorage.setItem("curmenu",JSON.stringify(curmenu));
|
||||
curNav = JSON.stringify(curmenu);
|
||||
}else{
|
||||
if($(this).parent("li").length > liIndex){
|
||||
window.sessionStorage.setItem("curmenu",curmenu);
|
||||
curNav = curmenu;
|
||||
}else{
|
||||
window.sessionStorage.setItem("curmenu",JSON.stringify(menu[liIndex-1]));
|
||||
curNav = JSON.stringify(menu[liIndex-1]);
|
||||
}
|
||||
}
|
||||
menu.splice((liIndex-1), 1);
|
||||
window.sessionStorage.setItem("menu",JSON.stringify(menu));
|
||||
element.tabDelete("bodyTab",$(this).parent("li").attr("lay-id")).init();
|
||||
new Tab().tabMove();
|
||||
})
|
||||
|
||||
var bodyTab = new Tab();
|
||||
exports("bodyTab",function(option){
|
||||
return bodyTab.set(option);
|
||||
});
|
||||
})
|
368
OpenAuth.Mvc/js/index.js
Normal file
@ -0,0 +1,368 @@
|
||||
var $,tab,skyconsWeather;
|
||||
layui.config({
|
||||
base : "/js/"
|
||||
}).use(['bodyTab','form','element','layer','jquery'],function(){
|
||||
var form = layui.form,
|
||||
layer = layui.layer,
|
||||
element = layui.element;
|
||||
$ = layui.jquery;
|
||||
tab = layui.bodyTab({
|
||||
openTabNum : "50", //最大可打开窗口数量
|
||||
url: "/Home/GetNavBar" //获取菜单json地址
|
||||
});
|
||||
|
||||
//更换皮肤
|
||||
function skins(){
|
||||
var skin = window.sessionStorage.getItem("skin");
|
||||
if(skin){ //如果更换过皮肤
|
||||
if(window.sessionStorage.getItem("skinValue") != "自定义"){
|
||||
$("body").addClass(window.sessionStorage.getItem("skin"));
|
||||
}else{
|
||||
$(".layui-layout-admin .layui-header").css("background-color",skin.split(',')[0]);
|
||||
$(".layui-bg-black").css("background-color",skin.split(',')[1]);
|
||||
$(".hideMenu").css("background-color",skin.split(',')[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
skins();
|
||||
$(".changeSkin").click(function(){
|
||||
layer.open({
|
||||
title : "更换皮肤",
|
||||
area : ["310px","280px"],
|
||||
type : "1",
|
||||
content : '<div class="skins_box">'+
|
||||
'<form class="layui-form">'+
|
||||
'<div class="layui-form-item">'+
|
||||
'<input type="radio" name="skin" value="默认" title="默认" lay-filter="default" checked="">'+
|
||||
'<input type="radio" name="skin" value="藏青" title="藏青" lay-filter="cyan">'+
|
||||
'<input type="radio" name="skin" value="蓝色" title="蓝色" lay-filter="blue">'+
|
||||
'<input type="radio" name="skin" value="自定义" title="自定义" lay-filter="custom">'+
|
||||
'<div class="skinCustom">'+
|
||||
'<input type="text" class="layui-input topColor" name="topSkin" placeholder="顶部颜色" />'+
|
||||
'<input type="text" class="layui-input leftColor" name="leftSkin" placeholder="左侧颜色" />'+
|
||||
'<input type="text" class="layui-input menuColor" name="btnSkin" placeholder="顶部菜单按钮" />'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="layui-form-item skinBtn">'+
|
||||
'<a href="javascript:;" class="layui-btn layui-btn-small layui-btn-normal" lay-submit="" lay-filter="changeSkin">确定更换</a>'+
|
||||
'<a href="javascript:;" class="layui-btn layui-btn-small layui-btn-primary" lay-submit="" lay-filter="noChangeSkin">我再想想</a>'+
|
||||
'</div>'+
|
||||
'</form>'+
|
||||
'</div>',
|
||||
success : function(index, layero){
|
||||
var skin = window.sessionStorage.getItem("skin");
|
||||
if(window.sessionStorage.getItem("skinValue")){
|
||||
$(".skins_box input[value="+window.sessionStorage.getItem("skinValue")+"]").attr("checked","checked");
|
||||
};
|
||||
if($(".skins_box input[value=自定义]").attr("checked")){
|
||||
$(".skinCustom").css("visibility","inherit");
|
||||
$(".topColor").val(skin.split(',')[0]);
|
||||
$(".leftColor").val(skin.split(',')[1]);
|
||||
$(".menuColor").val(skin.split(',')[2]);
|
||||
};
|
||||
form.render();
|
||||
$(".skins_box").removeClass("layui-hide");
|
||||
$(".skins_box .layui-form-radio").on("click",function(){
|
||||
var skinColor;
|
||||
if($(this).find("span").text() == "藏青"){
|
||||
skinColor = "cyan";
|
||||
}else if($(this).find("span").text() == "蓝色"){
|
||||
skinColor = "blue";
|
||||
}else if($(this).find("span").text() == "默认"){
|
||||
skinColor = "";
|
||||
}
|
||||
if($(this).find("span").text() != "自定义"){
|
||||
$(".topColor,.leftColor,.menuColor").val('');
|
||||
$("body").removeAttr("class").addClass("main_body "+skinColor+"");
|
||||
$(".skinCustom").removeAttr("style");
|
||||
$(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style");
|
||||
}else{
|
||||
$(".skinCustom").css("visibility","inherit");
|
||||
}
|
||||
})
|
||||
var skinStr,skinColor;
|
||||
$(".topColor").blur(function(){
|
||||
$(".layui-layout-admin .layui-header").css("background-color",$(this).val());
|
||||
})
|
||||
$(".leftColor").blur(function(){
|
||||
$(".layui-bg-black").css("background-color",$(this).val());
|
||||
})
|
||||
$(".menuColor").blur(function(){
|
||||
$(".hideMenu").css("background-color",$(this).val());
|
||||
})
|
||||
|
||||
form.on("submit(changeSkin)",function(data){
|
||||
if(data.field.skin != "自定义"){
|
||||
if(data.field.skin == "藏青"){
|
||||
skinColor = "cyan";
|
||||
}else if(data.field.skin == "蓝色"){
|
||||
skinColor = "blue";
|
||||
}else if(data.field.skin == "默认"){
|
||||
skinColor = "";
|
||||
}
|
||||
window.sessionStorage.setItem("skin",skinColor);
|
||||
}else{
|
||||
skinStr = $(".topColor").val()+','+$(".leftColor").val()+','+$(".menuColor").val();
|
||||
window.sessionStorage.setItem("skin",skinStr);
|
||||
$("body").removeAttr("class").addClass("main_body");
|
||||
}
|
||||
window.sessionStorage.setItem("skinValue",data.field.skin);
|
||||
layer.closeAll("page");
|
||||
});
|
||||
form.on("submit(noChangeSkin)",function(){
|
||||
$("body").removeAttr("class").addClass("main_body "+window.sessionStorage.getItem("skin")+"");
|
||||
$(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style");
|
||||
skins();
|
||||
layer.closeAll("page");
|
||||
});
|
||||
},
|
||||
cancel : function(){
|
||||
$("body").removeAttr("class").addClass("main_body "+window.sessionStorage.getItem("skin")+"");
|
||||
$(".layui-bg-black,.hideMenu,.layui-layout-admin .layui-header").removeAttr("style");
|
||||
skins();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//退出
|
||||
$(".signOut").click(function(){
|
||||
window.sessionStorage.removeItem("menu");
|
||||
menu = [];
|
||||
window.sessionStorage.removeItem("curmenu");
|
||||
})
|
||||
|
||||
//隐藏左侧导航
|
||||
$(".hideMenu").click(function(){
|
||||
$(".layui-layout-admin").toggleClass("showMenu");
|
||||
//渲染顶部窗口
|
||||
tab.tabMove();
|
||||
})
|
||||
|
||||
//渲染左侧菜单
|
||||
tab.render();
|
||||
|
||||
//锁屏
|
||||
function lockPage(){
|
||||
layer.open({
|
||||
title : false,
|
||||
type : 1,
|
||||
content : ' <div class="admin-header-lock" id="lock-box">'+
|
||||
'<div class="admin-header-lock-img"><img src="/images/face.jpg"/></div>'+
|
||||
'<div class="admin-header-lock-name" id="lockUserName">admin</div>'+
|
||||
'<div class="input_btn">'+
|
||||
'<input type="password" class="admin-header-lock-input layui-input" autocomplete="off" placeholder="请输入密码解锁.." name="lockPwd" id="lockPwd" />'+
|
||||
'<button class="layui-btn" id="unlock">解锁</button>'+
|
||||
'</div>'+
|
||||
'<p>请输入“123456”,否则不会解锁成功哦!!!</p>'+
|
||||
'</div>',
|
||||
closeBtn : 0,
|
||||
shade : 0.9
|
||||
})
|
||||
$(".admin-header-lock-input").focus();
|
||||
}
|
||||
$(".lockcms").on("click",function(){
|
||||
window.sessionStorage.setItem("lockcms",true);
|
||||
lockPage();
|
||||
})
|
||||
// 判断是否显示锁屏
|
||||
if(window.sessionStorage.getItem("lockcms") == "true"){
|
||||
lockPage();
|
||||
}
|
||||
// 解锁
|
||||
$("body").on("click","#unlock",function(){
|
||||
if($(this).siblings(".admin-header-lock-input").val() == ''){
|
||||
layer.msg("请输入解锁密码!");
|
||||
$(this).siblings(".admin-header-lock-input").focus();
|
||||
}else{
|
||||
if($(this).siblings(".admin-header-lock-input").val() == "123456"){
|
||||
window.sessionStorage.setItem("lockcms",false);
|
||||
$(this).siblings(".admin-header-lock-input").val('');
|
||||
layer.closeAll("page");
|
||||
}else{
|
||||
layer.msg("密码错误,请重新输入!");
|
||||
$(this).siblings(".admin-header-lock-input").val('').focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
$(document).on('keydown', function() {
|
||||
if(event.keyCode == 13) {
|
||||
$("#unlock").click();
|
||||
}
|
||||
});
|
||||
|
||||
//手机设备的简单适配
|
||||
var treeMobile = $('.site-tree-mobile'),
|
||||
shadeMobile = $('.site-mobile-shade')
|
||||
|
||||
treeMobile.on('click', function(){
|
||||
$('body').addClass('site-mobile');
|
||||
});
|
||||
|
||||
shadeMobile.on('click', function(){
|
||||
$('body').removeClass('site-mobile');
|
||||
});
|
||||
|
||||
// 添加新窗口
|
||||
$("body").on("click",".layui-nav .layui-nav-item a",function(){
|
||||
//如果不存在子级
|
||||
if($(this).siblings().length == 0){
|
||||
addTab($(this));
|
||||
$('body').removeClass('site-mobile'); //移动端点击菜单关闭菜单层
|
||||
}
|
||||
$(this).parent("li").siblings().removeClass("layui-nav-itemed");
|
||||
})
|
||||
|
||||
//公告层
|
||||
function showNotice(){
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "系统公告",
|
||||
closeBtn: false,
|
||||
area: '310px',
|
||||
shade: 0.8,
|
||||
id: 'LAY_layuipro',
|
||||
btn: ['火速围观'],
|
||||
moveType: 1,
|
||||
content: '<div style="padding:15px 20px; text-align:justify; line-height: 22px; text-indent:2em;border-bottom:1px solid #e2e2e2;"><p>最近偶然发现贤心大神的layui框架,瞬间被他的完美样式所吸引,虽然功能不算强大,但毕竟是一个刚刚出现的框架,后面会慢慢完善的。很早之前就想做一套后台模版,但是感觉bootstrop代码的冗余太大,不是非常喜欢,自己写又太累,所以一直闲置了下来。直到遇到了layui我才又燃起了制作一套后台模版的斗志。由于本人只是纯前端,所以页面只是单纯的实现了效果,没有做服务器端的一些处理,可能后期技术跟上了会更新的,如果有什么问题欢迎大家指导。谢谢大家。</p><p>在此特别感谢Beginner和Paco,他们写的框架给了我很好的启发和借鉴。希望有时间可以多多请教。</p></div>',
|
||||
success: function(layero){
|
||||
var btn = layero.find('.layui-layer-btn');
|
||||
btn.css('text-align', 'center');
|
||||
btn.on("click",function(){
|
||||
window.sessionStorage.setItem("showNotice","true");
|
||||
})
|
||||
if($(window).width() > 432){ //如果页面宽度不足以显示顶部“系统公告”按钮,则不提示
|
||||
btn.on("click",function(){
|
||||
layer.tips('系统公告躲在了这里', '#showNotice', {
|
||||
tips: 3
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//判断是否处于锁屏状态(如果关闭以后则未关闭浏览器之前不再显示)
|
||||
if(window.sessionStorage.getItem("lockcms") != "true" && window.sessionStorage.getItem("showNotice") != "true"){
|
||||
showNotice();
|
||||
}
|
||||
$(".showNotice").on("click",function(){
|
||||
showNotice();
|
||||
})
|
||||
|
||||
//刷新后还原打开的窗口
|
||||
if(window.sessionStorage.getItem("menu") != null){
|
||||
menu = JSON.parse(window.sessionStorage.getItem("menu"));
|
||||
curmenu = window.sessionStorage.getItem("curmenu");
|
||||
var openTitle = '';
|
||||
for(var i=0;i<menu.length;i++){
|
||||
openTitle = '';
|
||||
if(menu[i].icon){
|
||||
if(menu[i].icon.split("-")[0] == 'icon'){
|
||||
openTitle += '<i class="iconfont '+menu[i].icon+'"></i>';
|
||||
}else{
|
||||
openTitle += '<i class="layui-icon">'+menu[i].icon+'</i>';
|
||||
}
|
||||
}
|
||||
openTitle += '<cite>'+menu[i].title+'</cite>';
|
||||
openTitle += '<i class="layui-icon layui-unselect layui-tab-close" data-id="'+menu[i].layId+'">ဆ</i>';
|
||||
element.tabAdd("bodyTab",{
|
||||
title : openTitle,
|
||||
content :"<iframe src='"+menu[i].href+"' data-id='"+menu[i].layId+"'></frame>",
|
||||
id : menu[i].layId
|
||||
})
|
||||
//定位到刷新前的窗口
|
||||
if(curmenu != "undefined"){
|
||||
if(curmenu == '' || curmenu == "null"){ //定位到后台首页
|
||||
element.tabChange("bodyTab",'');
|
||||
}else if(JSON.parse(curmenu).title == menu[i].title){ //定位到刷新前的页面
|
||||
element.tabChange("bodyTab",menu[i].layId);
|
||||
}
|
||||
}else{
|
||||
element.tabChange("bodyTab",menu[menu.length-1].layId);
|
||||
}
|
||||
}
|
||||
//渲染顶部窗口
|
||||
tab.tabMove();
|
||||
}
|
||||
|
||||
//刷新当前
|
||||
$(".refresh").on("click",function(){ //此处添加禁止连续点击刷新一是为了降低服务器压力,另外一个就是为了防止超快点击造成chrome本身的一些js文件的报错(不过貌似这个问题还是存在,不过概率小了很多)
|
||||
if($(this).hasClass("refreshThis")){
|
||||
$(this).removeClass("refreshThis");
|
||||
$(".clildFrame .layui-tab-item.layui-show").find("iframe")[0].contentWindow.location.reload(true);
|
||||
}else{
|
||||
layer.msg("您点击的速度超过了服务器的响应速度,还是等两秒再刷新吧!");
|
||||
setTimeout(function(){
|
||||
$(".refresh").addClass("refreshThis");
|
||||
},2000)
|
||||
}
|
||||
})
|
||||
|
||||
//关闭其他
|
||||
$(".closePageOther").on("click",function(){
|
||||
if($("#top_tabs li").length>2 && $("#top_tabs li.layui-this cite").text()!="后台首页"){
|
||||
var menu = JSON.parse(window.sessionStorage.getItem("menu"));
|
||||
$("#top_tabs li").each(function(){
|
||||
if($(this).attr("lay-id") != '' && !$(this).hasClass("layui-this")){
|
||||
element.tabDelete("bodyTab",$(this).attr("lay-id")).init();
|
||||
//此处将当前窗口重新获取放入session,避免一个个删除来回循环造成的不必要工作量
|
||||
for(var i=0;i<menu.length;i++){
|
||||
if($("#top_tabs li.layui-this cite").text() == menu[i].title){
|
||||
menu.splice(0,menu.length,menu[i]);
|
||||
window.sessionStorage.setItem("menu",JSON.stringify(menu));
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}else if($("#top_tabs li.layui-this cite").text()=="后台首页" && $("#top_tabs li").length>1){
|
||||
$("#top_tabs li").each(function(){
|
||||
if($(this).attr("lay-id") != '' && !$(this).hasClass("layui-this")){
|
||||
element.tabDelete("bodyTab",$(this).attr("lay-id")).init();
|
||||
window.sessionStorage.removeItem("menu");
|
||||
menu = [];
|
||||
window.sessionStorage.removeItem("curmenu");
|
||||
}
|
||||
})
|
||||
}else{
|
||||
layer.msg("没有可以关闭的窗口了@_@");
|
||||
}
|
||||
//渲染顶部窗口
|
||||
tab.tabMove();
|
||||
})
|
||||
//关闭全部
|
||||
$(".closePageAll").on("click",function(){
|
||||
if($("#top_tabs li").length > 1){
|
||||
$("#top_tabs li").each(function(){
|
||||
if($(this).attr("lay-id") != ''){
|
||||
element.tabDelete("bodyTab",$(this).attr("lay-id")).init();
|
||||
window.sessionStorage.removeItem("menu");
|
||||
menu = [];
|
||||
window.sessionStorage.removeItem("curmenu");
|
||||
}
|
||||
})
|
||||
}else{
|
||||
layer.msg("没有可以关闭的窗口了@_@");
|
||||
}
|
||||
//渲染顶部窗口
|
||||
tab.tabMove();
|
||||
})
|
||||
})
|
||||
|
||||
//打开新窗口
|
||||
function addTab(_this){
|
||||
tab.tabAdd(_this);
|
||||
}
|
||||
|
||||
//捐赠弹窗
|
||||
function donation(){
|
||||
layer.tab({
|
||||
area : ['260px', '367px'],
|
||||
tab : [{
|
||||
title : "微信",
|
||||
content : "<div style='padding:30px;overflow:hidden;background:#d2d0d0;'><img src='/images/wechat.jpg'></div>"
|
||||
},{
|
||||
title : "支付宝",
|
||||
content : "<div style='padding:30px;overflow:hidden;background:#d2d0d0;'><img src='/images/alipay.jpg'></div>"
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
63
OpenAuth.Mvc/js/leftNav.js
Normal file
@ -0,0 +1,63 @@
|
||||
function navBar(strData){
|
||||
var data;
|
||||
if(typeof(strData) == "string"){
|
||||
var data = JSON.parse(strData); //部分用户解析出来的是字符串,转换一下
|
||||
}else{
|
||||
data = strData;
|
||||
}
|
||||
var ulHtml = '<ul class="layui-nav layui-nav-tree">';
|
||||
for(var i=0;i<data.length;i++){
|
||||
if(data[i].spread){
|
||||
ulHtml += '<li class="layui-nav-item layui-nav-itemed">';
|
||||
}else{
|
||||
ulHtml += '<li class="layui-nav-item">';
|
||||
}
|
||||
if(data[i].Children != undefined && data[i].Children.length > 0){
|
||||
ulHtml += '<a href="javascript:;">';
|
||||
if(data[i].Item.IconName != undefined && data[i].Item.IconName != ''){
|
||||
if(data[i].Item.IconName.indexOf("icon-") != -1){
|
||||
ulHtml += '<i class="iconfont '+data[i].Item.IconName+'" data-icon="'+data[i].Item.IconName+'"></i>';
|
||||
}else{
|
||||
ulHtml += '<i class="layui-icon" data-icon="'+data[i].Item.IconName+'">'+data[i].Item.IconName+'</i>';
|
||||
}
|
||||
}
|
||||
ulHtml += '<cite>'+data[i].Item.Name+'</cite>';
|
||||
ulHtml += '<span class="layui-nav-more"></span>';
|
||||
ulHtml += '</a>';
|
||||
ulHtml += '<dl class="layui-nav-child">';
|
||||
for(var j=0;j<data[i].Children.length;j++){
|
||||
if(data[i].Children[j].target == "_blank"){
|
||||
ulHtml += '<dd><a href="javascript:;" data-url="'+data[i].Children[j].Item.Url+'" target="'+data[i].Children[j].target+'">';
|
||||
}else{
|
||||
ulHtml += '<dd><a href="javascript:;" data-url="'+data[i].Children[j].Item.Url+'">';
|
||||
}
|
||||
if(data[i].Children[j].Item.IconName != undefined && data[i].Children[j].Item.IconName != ''){
|
||||
if(data[i].Children[j].Item.IconName.indexOf("icon-") != -1){
|
||||
ulHtml += '<i class="iconfont '+data[i].Children[j].Item.IconName+'" data-icon="'+data[i].Children[j].Item.IconName+'"></i>';
|
||||
}else{
|
||||
ulHtml += '<i class="layui-icon" data-icon="'+data[i].Children[j].Item.IconName+'">'+data[i].Children[j].Item.IconName+'</i>';
|
||||
}
|
||||
}
|
||||
ulHtml += '<cite>'+data[i].Children[j].Item.Name+'</cite></a></dd>';
|
||||
}
|
||||
ulHtml += "</dl>";
|
||||
}else{
|
||||
if(data[i].target == "_blank"){
|
||||
ulHtml += '<a href="javascript:;" data-url="'+data[i].Item.Url+'" target="'+data[i].target+'">';
|
||||
}else{
|
||||
ulHtml += '<a href="javascript:;" data-url="'+data[i].Item.Url+'">';
|
||||
}
|
||||
if(data[i].Item.IconName != undefined && data[i].Item.IconName != ''){
|
||||
if(data[i].Item.IconName.indexOf("icon-") != -1){
|
||||
ulHtml += '<i class="iconfont '+data[i].Item.IconName+'" data-icon="'+data[i].Item.IconName+'"></i>';
|
||||
}else{
|
||||
ulHtml += '<i class="layui-icon" data-icon="'+data[i].Item.IconName+'">'+data[i].Item.IconName+'</i>';
|
||||
}
|
||||
}
|
||||
ulHtml += '<cite>'+data[i].Item.Name+'</cite></a>';
|
||||
}
|
||||
ulHtml += '</li>';
|
||||
}
|
||||
ulHtml += '</ul>';
|
||||
return ulHtml;
|
||||
}
|
21
OpenAuth.Mvc/js/login.js
Normal file
@ -0,0 +1,21 @@
|
||||
layui.config({
|
||||
base : "/js/"
|
||||
}).use(['form','layer'],function(){
|
||||
var form = layui.form,
|
||||
layer = parent.layer === undefined ? layui.layer : parent.layer,
|
||||
$ = layui.jquery;
|
||||
//video背景
|
||||
$(window).resize(function(){
|
||||
if($(".video-player").width() > $(window).width()){
|
||||
$(".video-player").css({"height":$(window).height(),"width":"auto","left":-($(".video-player").width()-$(window).width())/2});
|
||||
}else{
|
||||
$(".video-player").css({"width":$(window).width(),"height":"auto","left":-($(".video-player").width()-$(window).width())/2});
|
||||
}
|
||||
}).resize();
|
||||
|
||||
//登录按钮事件
|
||||
form.on("submit(login)",function(data){
|
||||
window.location.href = "/Login/LoginByDev";
|
||||
return false;
|
||||
})
|
||||
})
|
89
OpenAuth.Mvc/js/main.js
Normal file
@ -0,0 +1,89 @@
|
||||
layui.config({
|
||||
base : "/js/"
|
||||
}).use(['form','element','layer','jquery'],function(){
|
||||
var form = layui.form,
|
||||
layer = parent.layer === undefined ? layui.layer : parent.layer,
|
||||
element = layui.element,
|
||||
$ = layui.jquery;
|
||||
|
||||
$(".panel a").on("click",function(){
|
||||
window.parent.addTab($(this));
|
||||
})
|
||||
|
||||
//动态获取文章总数和待审核文章数量,最新文章
|
||||
$.get("/json/newsList.json",
|
||||
function(data){
|
||||
var waitNews = [];
|
||||
$(".allNews span").text(data.length); //文章总数
|
||||
for(var i=0;i<data.length;i++){
|
||||
var newsStr = data[i];
|
||||
if(newsStr["newsStatus"] == "待审核"){
|
||||
waitNews.push(newsStr);
|
||||
}
|
||||
}
|
||||
$(".waitNews span").text(waitNews.length); //待审核文章
|
||||
}
|
||||
)
|
||||
|
||||
//图片总数
|
||||
$.get("/json/images.json",
|
||||
function(data){
|
||||
$(".imgAll span").text(data.length);
|
||||
}
|
||||
)
|
||||
|
||||
//用户数
|
||||
$.get("/json/usersList.json",
|
||||
function(data){
|
||||
$(".userAll span").text(data.length);
|
||||
}
|
||||
)
|
||||
|
||||
//新消息
|
||||
$.get("/json/message.json",
|
||||
function(data){
|
||||
$(".newMessage span").text(data.length);
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
//数字格式化
|
||||
$(".panel span").each(function(){
|
||||
$(this).html($(this).text()>9999 ? ($(this).text()/10000).toFixed(2) + "<em>万</em>" : $(this).text());
|
||||
})
|
||||
|
||||
//系统基本参数
|
||||
if(window.sessionStorage.getItem("systemParameter")){
|
||||
var systemParameter = JSON.parse(window.sessionStorage.getItem("systemParameter"));
|
||||
fillParameter(systemParameter);
|
||||
}else{
|
||||
$.ajax({
|
||||
url : "/json/systemParameter.json",
|
||||
type : "get",
|
||||
dataType : "json",
|
||||
success : function(data){
|
||||
fillParameter(data);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//填充数据方法
|
||||
function fillParameter(data){
|
||||
//判断字段数据是否存在
|
||||
function nullData(data){
|
||||
if(data == '' || data == "undefined"){
|
||||
return "未定义";
|
||||
}else{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
$(".version").text(nullData(data.version)); //当前版本
|
||||
$(".author").text(nullData(data.author)); //开发作者
|
||||
$(".homePage").text(nullData(data.homePage)); //网站首页
|
||||
$(".server").text(nullData(data.server)); //服务器环境
|
||||
$(".dataBase").text(nullData(data.dataBase)); //数据库版本
|
||||
$(".maxUpload").text(nullData(data.maxUpload)); //最大上传限制
|
||||
$(".userRights").text(nullData(data.userRights));//当前用户权限
|
||||
}
|
||||
|
||||
})
|
2
OpenAuth.Mvc/layui/css/layui.css
Normal file
2
OpenAuth.Mvc/layui/css/layui.mobile.css
Normal file
2
OpenAuth.Mvc/layui/css/modules/code.css
Normal file
@ -0,0 +1,2 @@
|
||||
/** layui-v2.0.2 MIT License By http://www.layui.com */
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
BIN
OpenAuth.Mvc/layui/css/modules/laydate/icon.png
Normal file
After Width: | Height: | Size: 314 B |
2
OpenAuth.Mvc/layui/css/modules/laydate/laydate.css
Normal file
BIN
OpenAuth.Mvc/layui/css/modules/layer/default/icon-ext.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
OpenAuth.Mvc/layui/css/modules/layer/default/icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
2
OpenAuth.Mvc/layui/css/modules/layer/default/layer.css
Normal file
BIN
OpenAuth.Mvc/layui/css/modules/layer/default/loading-0.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
OpenAuth.Mvc/layui/css/modules/layer/default/loading-1.gif
Normal file
After Width: | Height: | Size: 701 B |
BIN
OpenAuth.Mvc/layui/css/modules/layer/default/loading-2.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
OpenAuth.Mvc/layui/font/iconfont.eot
Normal file
402
OpenAuth.Mvc/layui/font/iconfont.svg
Normal file
After Width: | Height: | Size: 200 KiB |
BIN
OpenAuth.Mvc/layui/font/iconfont.ttf
Normal file
BIN
OpenAuth.Mvc/layui/font/iconfont.woff
Normal file
BIN
OpenAuth.Mvc/layui/images/face/0.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/1.gif
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
OpenAuth.Mvc/layui/images/face/10.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
OpenAuth.Mvc/layui/images/face/11.gif
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
OpenAuth.Mvc/layui/images/face/12.gif
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/13.gif
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/14.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/15.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
OpenAuth.Mvc/layui/images/face/16.gif
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/17.gif
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/18.gif
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
OpenAuth.Mvc/layui/images/face/19.gif
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
OpenAuth.Mvc/layui/images/face/2.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
OpenAuth.Mvc/layui/images/face/20.gif
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
OpenAuth.Mvc/layui/images/face/21.gif
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
OpenAuth.Mvc/layui/images/face/22.gif
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/23.gif
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
OpenAuth.Mvc/layui/images/face/24.gif
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
OpenAuth.Mvc/layui/images/face/25.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
OpenAuth.Mvc/layui/images/face/26.gif
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
OpenAuth.Mvc/layui/images/face/27.gif
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/28.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
OpenAuth.Mvc/layui/images/face/29.gif
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
OpenAuth.Mvc/layui/images/face/3.gif
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
OpenAuth.Mvc/layui/images/face/30.gif
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
OpenAuth.Mvc/layui/images/face/31.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
OpenAuth.Mvc/layui/images/face/32.gif
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
OpenAuth.Mvc/layui/images/face/33.gif
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
OpenAuth.Mvc/layui/images/face/34.gif
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/35.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
OpenAuth.Mvc/layui/images/face/36.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/37.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
OpenAuth.Mvc/layui/images/face/38.gif
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
OpenAuth.Mvc/layui/images/face/39.gif
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/4.gif
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/40.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
OpenAuth.Mvc/layui/images/face/41.gif
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/42.gif
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
OpenAuth.Mvc/layui/images/face/43.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/44.gif
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
OpenAuth.Mvc/layui/images/face/45.gif
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/46.gif
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
OpenAuth.Mvc/layui/images/face/47.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/48.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/49.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/5.gif
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
OpenAuth.Mvc/layui/images/face/50.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
OpenAuth.Mvc/layui/images/face/51.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
OpenAuth.Mvc/layui/images/face/52.gif
Normal file
After Width: | Height: | Size: 777 B |
BIN
OpenAuth.Mvc/layui/images/face/53.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
OpenAuth.Mvc/layui/images/face/54.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
OpenAuth.Mvc/layui/images/face/55.gif
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
OpenAuth.Mvc/layui/images/face/56.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
OpenAuth.Mvc/layui/images/face/57.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
OpenAuth.Mvc/layui/images/face/58.gif
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
OpenAuth.Mvc/layui/images/face/59.gif
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
OpenAuth.Mvc/layui/images/face/6.gif
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
OpenAuth.Mvc/layui/images/face/60.gif
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
OpenAuth.Mvc/layui/images/face/61.gif
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
OpenAuth.Mvc/layui/images/face/62.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
OpenAuth.Mvc/layui/images/face/63.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
OpenAuth.Mvc/layui/images/face/64.gif
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
OpenAuth.Mvc/layui/images/face/65.gif
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
OpenAuth.Mvc/layui/images/face/66.gif
Normal file
After Width: | Height: | Size: 3.0 KiB |