Bläddra i källkod

处理系统白屏, 多闪bug

zhengkaixin 4 år sedan
förälder
incheckning
278ef56ea5

+ 13 - 4
index/business/index.html

@@ -36,13 +36,14 @@
 			<div class="index-load" id="index-load" style="display:block;position: absolute;bottom: 10px;right: 10px;"></div>
 		</div>
 		<script>
-			var indexSetInval;
+
+            var indexSetInval;
 			var indexStartNum = 1;
-			indexSetInval = setInterval(function() {
+ 			indexSetInval = setInterval(function() {
 				indexStartNum++;
 				var str = '加载中' + ((indexStartNum % 2 == 0) ? '…' : '……');
 				document.getElementById('index-load').innerHTML = str;
-			}, 1000)
+ 			}, 1000)
 		</script>
 
 		<div id="app"></div>
@@ -53,7 +54,15 @@
 				var end_time = (new Date()).getTime();
 				var loading_time = end_time - start_time;
 				console.log(((loading_time) / 1000).toString() + '秒');
-				removeLoading();
+
+                indexSetInval = setInterval(function() {
+                    var b=document.getElementById('app').childNodes[0].length;
+                    if(b!=0){
+                        removeLoading()
+                        clearInterval(indexSetInval);
+                    }
+                }, 500);
+
 			}
 
 			function removeLoading() {

+ 8 - 7
index/home/index.html

@@ -82,13 +82,14 @@
 				var end_time = (new Date()).getTime();
 				var loading_time = end_time - start_time;
 				console.log(((loading_time) / 1000).toString() + '秒');
-				if (loading_time < 2000) {
-					setTimeout(function() {
-						removeLoading();
-					}, 2000 - (loading_time));
-				} else {
-					removeLoading()
-				}
+				
+                indexSetInval = setInterval(function() {
+                    var b=document.getElementById('app').childNodes[0].length;
+                    if(b!=0){
+                        removeLoading()
+                        clearInterval(indexSetInval);
+                    }
+                }, 500);
 			}
 
 			function removeLoading() {

+ 8 - 1
index/pension/index.html

@@ -53,7 +53,14 @@
 				var end_time = (new Date()).getTime();
 				var loading_time = end_time - start_time;
 				console.log(((loading_time) / 1000).toString() + '秒');
-				removeLoading();
+
+                indexSetInval = setInterval(function() {
+                    var b=document.getElementById('app').childNodes[0].length;
+                    if(b!=0){
+                        removeLoading()
+                        clearInterval(indexSetInval);
+                    }
+                }, 500);
 			}
 
 			function removeLoading() {

+ 5 - 16
src/components/Common.vue

@@ -56,18 +56,7 @@
 			if (isWeiXin()) {
 				if (this.checkOpenId) {
 					if (!this.openId) {
-                        if(this.$route.query.openId){
-                            debugger
-                             this.set_openid(this.$route.query.openId);
-
-                            //角色判定调用不同的信息获取详情
-                            this.getDataByOpenId(this.$route.query.openId);
-                        }else{
-                            this.getOpenid();
-
-                        }
-
-
+						this.getOpenid();
 					} else {
 						this.getDataByOpenId();
 					}
@@ -119,15 +108,15 @@
 				}
 			},
 			//角色判定调用不同的信息获取详情
-			getDataByOpenId(opid) {
-				this.getUserInfoByOpenId(opid);
+			getDataByOpenId() {
+				this.getUserInfoByOpenId();
 			},
 			//获取用户详情
-			getUserInfoByOpenId(opid) {
+			getUserInfoByOpenId() {
 				this.isLoading = true;
 				
 				var type = type || '';
-				API_WeiXin.getDataByOpenId(opid||this.openId).then(response => {
+				API_WeiXin.getDataByOpenId(this.openId).then(response => {
 					
 					this.isLoading = false;
 					

+ 1 - 1
src/projects/pension/views/Master/Mine/Bill/Pay.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <common @asynCallBack="asynCallBack"></common>
-        <top-header :pageTitle="pageTitle"  :leftShow="leftShow" ></top-header>
+        <top-header :pageTitle="pageTitle" :checkOpenId="false" :leftShow="leftShow" ></top-header>
 
         <div class="mui-content vongi-qingjiadt margin60"  >
             <div class="vongi-zd vongi-zdto flew-items">