Explorar el Código

页面加载功能调整

hejq hace 7 años
padre
commit
335c623f05

+ 27 - 0
src/main/webapp/WEB-INF/views/normal/enterprise.html

@@ -20,6 +20,33 @@
 	<title>企业列表</title>
 </head>
 <body>
+<style>
+	#loadingDiv {
+		position: absolute;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		top: 0;
+		/*background: #000000;*/
+		opacity: 0.3;
+		filter: alpha(opacity=80);
+		z-index: 10000;
+        display: none;
+	}
+	#loadingImg {
+		position: absolute;
+		cursor: wait;
+		left: 50%;
+		top: 50%;
+		width: 100%;
+        height: 100%;
+	}
+</style>
+<div id="loadingDiv">
+	<div id="loadingImg">
+		<img src="../static/images/waiting.gif"/>
+	</div>
+</div>
 <!-- nav start -->
 <nav id="nav" class="navbar navbar-inverse navbar-fixed-top">
 	<div class="container">

BIN
src/main/webapp/resources/images/loading.gif


BIN
src/main/webapp/resources/images/waiting.gif


+ 22 - 20
src/main/webapp/resources/js/account/enterprise.js

@@ -14,12 +14,14 @@ var enterpriseList = [];
  * 获取企业列表
  */
 function getEnterpriseList(count, page, keyword) {
+    $('#loadingDiv').show();
     enterpriseList = [];
     $.get('enterprise/list', {
         count: count,
         page: page,
         keyword: keyword
     }, function (data) {
+        $('#loadingDiv').hide();
         enterpriseList = data.content;
         var pageNumber = data.number;
         var pageSzie = data.size;
@@ -39,26 +41,6 @@ function getEnterpriseList(count, page, keyword) {
                     });
                 })(i)
             }
-            $('#m-page').pagination({
-                pageCount: totalPage,
-                totalData: total,
-                current: pageNumber,
-                showData: pageSzie,
-                coping: true,
-                homePage: '首页',
-                endPage: '末页',
-                prevContent: '<<',
-                nextContent: '>>',
-                jump: true,
-                jumpBtn: '跳转',
-                callback: function (api) {
-                    $('.now').text(api.getCurrent());
-                    $("#enterprise-body").load(location.href + " #enterprise-body");
-                    getEnterpriseList(count, api.getCurrent(), $('#keyword').val());
-                },
-            }, function (api) {
-                $('.now').text(api.getCurrent());
-            });
 
             // 点击搜索
             $('#p_search').unbind('click').click(function () {// 每次先解除上次绑定的事件,防止重复发送请求
@@ -75,6 +57,26 @@ function getEnterpriseList(count, page, keyword) {
                 }
             };
         }
+        $('#m-page').pagination({
+            pageCount: totalPage,
+            totalData: total,
+            current: pageNumber,
+            showData: pageSzie,
+            coping: true,
+            homePage: '首页',
+            endPage: '末页',
+            prevContent: '<<',
+            nextContent: '>>',
+            jump: true,
+            jumpBtn: '跳转',
+            callback: function (api) {
+                $('.now').text(api.getCurrent());
+                $("#enterprise-body").load(location.href + " #enterprise-body");
+                getEnterpriseList(count, api.getCurrent(), $('#keyword').val());
+            }
+        }, function (api) {
+            $('.now').text(api.getCurrent());
+        });
     })
 }
 

+ 4 - 0
src/main/webapp/resources/js/common/common.js

@@ -14,6 +14,10 @@ function getAccountInfo() {
 			$('.x-login').show();
 
             $('.x-login').find('.title').text(data.content.name);
+
+            $('.x-login').click(function () {
+				window.location.href = "/resetPassword";
+            });
 		}
 	});
 }