Jelajahi Sumber

IOS头部抖动问题

git-svn-id: svn://svn7.apicloud.com/A6007457911931/%E5%9C%88%E5%A4%9A%E5%A4%9A@659 0e1a2743-8d03-4e5a-a60c-7e26af42b145
1149931599@qq.com 4 tahun lalu
induk
melakukan
b233cb39f6
9 mengubah file dengan 68 tambahan dan 26 penghapusan
  1. 2 0
      config.xml
  2. 1 0
      css/style.css
  3. 20 6
      html/frame0.html
  4. 17 6
      html/frame1.html
  5. 3 0
      html/home/hoteldtl.html
  6. 1 1
      html/hotel/frame1.html
  7. 1 1
      html/my/syssetting.html
  8. 4 1
      index.html
  9. 19 11
      script/api.js

+ 2 - 0
config.xml

@@ -22,12 +22,14 @@
   <preference name="customRefreshHeader" value="UIPullRefresh" />
   <preference name="autoUpdate" value="false" />
   <preference name="urlScheme" value="qzaiwangscheme" />
+  <preference name="useWKWebView" value="true" />
   <permission name="camera"/>  
   <permission name="record"/>  
   <permission name="location"/>  
   <permission name="fileSystem"/>  
   <permission name="internet"/>  
   <permission name="bootCompleted"/>  
+  
   <permission name="hardware"/>  
   <access origin="*"/>  
   <meta-data name="com.openinstall.APP_KEY" value="kc2epk" />

+ 1 - 0
css/style.css

@@ -355,6 +355,7 @@ section {
     z-index: 999;
     background-image: url('../image/back_top.png');
     background-size: 100% 100%;
+	
 }
 
 /*******login**********/

+ 20 - 6
html/frame0.html

@@ -12,7 +12,7 @@
 		<link rel="stylesheet" type="text/css" href="../css/style.css" />
 		<link rel="stylesheet" type="text/css" href="../css/swiper.min.css" />
 		<style>
-			.swiper-container {
+				 .swiper-container {
           width: 100%;
           height: 100%;
         }
@@ -40,6 +40,7 @@
             padding-top: 0.1rem;
             float: left;
             line-height: 0;
+		      	position: absolute;
         }
         .home-hotel-right { /*width: 4.2rem;*/ }
         .home-hotel-dsc {
@@ -148,6 +149,18 @@
             transform: scale(0.5);
             border-radius: 0.08rem;
         }
+		.header{
+			position: fixed;
+			padding: 0 0.2rem;
+			top: 0;
+			right: 0;
+			left: 1px;
+			z-index: 2;
+			background: #fff;
+			-webkit-transform: translateZ(0);
+			transform: translateZ(0);
+		}
+
     </style>
 		<script>
 			(function(window) {
@@ -168,10 +181,10 @@
 		</script>
 	</head>
 
-	<body>
+	<body >
 		<div class="topbar"></div>
 		<section>
-			<div style="position: fixed;width: 6.9rem;margin-left: -1px;z-index: 2;background: #fff;" id="header">
+			<div id="header" class="header">
 				<div class="home-top" style="padding: 0.1rem 0;">
 					<div class="home-top-left"><img id="set-local" class="home-top-local" src="../image/home_local.png" /> <span class="local-name">&nbsp;正在搜索您附近的酒店</span></div>
 					<div class="home-top-right" style="margin-top: -0.05rem;">
@@ -250,8 +263,8 @@
 			if (!storage || !storage[0] || !storage[0].granted) {
 				reqPermission('storage')
 			}
-			
-			
+
+
 			get_adv();//弹窗
 			getRouteData();//轮播吞
 			webtoappinit();
@@ -302,6 +315,7 @@
 				name: 'hoteldtl',
 				url: './home/hoteldtl.html',
 				bounces: false,
+				useWKWebView: true,
 				pageParam: {
 					keyid: _keyid
 				}
@@ -576,7 +590,7 @@
 			$('.weui-gallery').remove()
 			getAddress();
 		}
-		
+
 		function getRouteHotelData() {
 			if (_lon == '0') {
 				$(".border-none").removeClass("mask-hidden");

+ 17 - 6
html/frame1.html

@@ -34,8 +34,15 @@
         }
         .white-back {
             position: fixed;
-            z-index: 1;
+			z-index: 1;
+			top: 0;
+			left: 0;
+			right: 0;
+			padding: 0 0.2rem;
         }
+		.new-list{
+			margin-top: 1.3rem;
+		}
       </style>
     <script>
     (function(w, d, m) {
@@ -59,10 +66,10 @@
     </script>
 </head>
 
-<body>
+<body id="viewport">
     <div class="topbar"></div>
-    <section style="width:100%;" class="white-back">
-        <div class="home-search" style="margin-top: 0.26rem;">
+    <div class="white-back" id="header">
+        <div class="home-search">
             <img src="../image/search.png"> 搜索文章
         </div>
         <div style="padding-top: 0.2rem;">
@@ -70,8 +77,8 @@
                 <div class="swiper-wrapper"></div>
             </div>
 		</div>
-    </section>
-    <section class="new-list" page="1" style="padding-top: 1.6rem"></section>
+    </div>
+    <section class="new-list" page="1" style="padding-top: 0rem;"></section>
     <div class="back-top mask-hidden" id="fix1"></div>
 </body>
 <script type="text/javascript" src="../script/api.js"></script>
@@ -82,6 +89,9 @@
 var _acid = '';
 var _minid = 1;
 apiready = function() {
+	var $header = $api.byId('header');
+	$api.fixIos7Bar($header);
+	$api.fixStatusBar($header);
     setIosTopBar();
     getCatogoryData();
     getRouteData();
@@ -91,6 +101,7 @@ apiready = function() {
             threshold: 200
         }
     }, function(ret, err) {
+		console.log(ret);
         getRouteData();
     });
     api.addEventListener({

+ 3 - 0
html/home/hoteldtl.html

@@ -346,6 +346,7 @@
 			right: 0;
 			top:32.5px;
 			z-index: 999;
+			transform: translateZ(0);-webkit-transform: translateZ(0);
 		}
     </style>
 		<script>
@@ -716,6 +717,7 @@
 				name: 'showhotel',
 				url: './showhotel.html',
 				bounces: false,
+				useWKWebView: true,
 				pageParam: {
 					keyid: _storeid
 				}
@@ -761,6 +763,7 @@
 				name: 'showgoods',
 				url: './showgoods.html',
 				bounces: false,
+				useWKWebView: true,
 				pageParam: {
 					keyid: _goodsid,
 					storeid: _storeid,

+ 1 - 1
html/hotel/frame1.html

@@ -90,7 +90,7 @@
             <!-- <li class="more-btn"></li> -->
         </ul>
     </header>
-    <section class="white-back" style="position: fixed;z-index: 2;margin-top: 0.81rem;">
+    <section class="white-back" style=" position: fixed;z-index: 2;margin-top: 0.81rem;">
         <div class="swiper-container" style="padding-bottom: 0.1em;width: 6.86rem;">
             <div class="swiper-wrapper">
                 <div class="swiper-slide active" state="100" state_as="all"><span>全部</span></div>

+ 1 - 1
html/my/syssetting.html

@@ -85,7 +85,7 @@
         <div class="setting-item mask-hidden" id="feed-back">
             意见反馈 <span style="float:right;color:#cccccc;" class="iconfont">&#xe62e;</span>
         </div>
-        <div class="m-bottom" style="position: fixed;bottom: 0.5rem;width: 91.47%;">退出登录</div>
+        <div class="m-bottom" style=" position: fixed;bottom: 0.5rem;width: 91.47%;">退出登录</div>
     </section>
 </body>
 <script type="text/javascript" src="../../script/api.js"></script>

+ 4 - 1
index.html

@@ -82,6 +82,8 @@ var _adv_article_id = '0';
 var _webinkeyid = '0';
 var _webinstoreid = '0';
 apiready = function() {
+	var $header = $api.byId('footer');
+	$api.fixTabBar($header);
     _webinkeyid = api.pageParam.keyid;
     _webinstoreid = api.pageParam.storeid;
     _adv_type = api.pageParam.advtype;
@@ -266,7 +268,8 @@ function randomSwitchBtn(tag) {
     $api.addCls(eHeaderLis[index], 'active');
     api.setFrameGroupIndex({
         name: 'group',
-        index: index
+        index: index,
+		
     });
 }
 </script>

+ 19 - 11
script/api.js

@@ -479,17 +479,25 @@
 
 
     /*by king*/
-    u.fixIos7Bar = function(el) {
-        return u.fixStatusBar(el);
-    };
-    u.fixStatusBar = function(el) {
-        if (!u.isElement(el)) {
-            console.warn('$api.fixStatusBar Function need el param, el param must be DOM Element');
-            return 0;
-        }
-        el.style.paddingTop = api.safeArea.top + 'px';
-        return el.offsetHeight;
-    };
+	u.fixIos7Bar = function(el){
+		return u.fixStatusBar(el);
+	};
+	u.fixStatusBar = function(el){
+		if(!u.isElement(el)){
+			console.warn('$api.fixStatusBar Function need el param, el param must be DOM Element');
+			return 0;
+		}
+		el.style.paddingTop = api.safeArea.top + 'px';
+		return el.offsetHeight;
+	};
+	u.fixTabBar = function(el){
+	    if(!u.isElement(el)){
+	        console.warn('$api.fixTabBar Function need el param, el param must be DOM Element');
+	        return 0;
+	    }
+	    el.style.paddingBottom = api.safeArea.bottom + 'px';
+	    return el.offsetHeight;
+	};
     u.toast = function(title, text, time) {
         var opts = {};
         var show = function(opts, time) {