dwh 2 år sedan
förälder
incheckning
6bc0f73892
4 ändrade filer med 56 tillägg och 64 borttagningar
  1. 1 8
      src/App.vue
  2. 0 5
      src/public.scss
  3. 4 0
      src/views/friends/friends.vue
  4. 51 51
      src/views/login/login.vue

+ 1 - 8
src/App.vue

@@ -1,6 +1,5 @@
 <template>
 	<div id="app">
-		<div class="statusBar" :style="{'height':`${statusBarHeight}px`}"></div>
 		<keep-alive>
 			<router-view v-if="$route.meta.keepAlive"></router-view>
 		</keep-alive>
@@ -9,16 +8,10 @@
 </template>
 <script>
 	export default{
-		data() {
-			return{
-				statusBarHeight:0
-			}
-		},
-		mounted() {
+		created() {
 			window.getStatusBarHeightInvoke=(data)=>{
 				localStorage.setItem('safeBottomHeight',data.safeBottomHeight);
 				localStorage.setItem('statusBarHeight',data.statusBarHeight);
-				this.statusBarHeight=data.statusBarHeight;
 			};
 			window.idfaInvoke=(data)=>{
 				localStorage.setItem('idfa',data.idfa);

+ 0 - 5
src/public.scss

@@ -52,9 +52,4 @@
 	textarea,input{outline: none;border: none;}
 	#app{
 		background-color: $bgcolor1;
-	}
-	img{
-		/*长按默认事件取消*/
-		-webkit-touch-callout: none !important;
-		-webkit-user-select: none;
 	}

+ 4 - 0
src/views/friends/friends.vue

@@ -1,5 +1,6 @@
 <template>
 	<div class="container flex-between">
+		<div class="statusBar" :style="{'height':`${statusBarHeight}px`}"></div>
 		<div id="topnav" class="topnav flex-between" ref="topnav">
 			<div class="top-left flex-start">
 				<div class="nav-item" v-for="(item,index) in navs" :key="index" :style="{
@@ -456,6 +457,9 @@
 		computed: {
 			userInfo(){
 				return this.$store.state.userInfo||{};
+			},
+			statusBarHeight(){
+				return localStorage.getItem('statusBarHeight');
 			}
 		},
 		mounted() {

+ 51 - 51
src/views/login/login.vue

@@ -37,25 +37,25 @@
 			this.$nextTick(()=>{
 				this.$refs.myvideo.play();
 			})
-			window.getStatusBarHeightInvoke=(data)=>{
-				localStorage.setItem('safeBottomHeight',data.safeBottomHeight);
-				localStorage.setItem('statusBarHeight',data.statusBarHeight);
-			};
-			window.idfaInvoke=(data)=>{
-				localStorage.setItem('idfa',data.idfa);
-			};
-			window.deviceInfoInvoke=(data)=>{
-				localStorage.setItem('deviceInfo',data.data);
-			};
-			window.deviceTokenInvoke=(data)=>{
-				if(data.code===1){
-					localStorage.setItem('deviceToken',data.deviceId)
-				}
-			};
-			this.getStatusBarHeight();
-			this.getIDFA();
-			this.getDeviceInfo();
-			this.getDeviceToken();
+			// window.getStatusBarHeightInvoke=(data)=>{
+			// 	localStorage.setItem('safeBottomHeight',data.safeBottomHeight);
+			// 	localStorage.setItem('statusBarHeight',data.statusBarHeight);
+			// };
+			// window.idfaInvoke=(data)=>{
+			// 	localStorage.setItem('idfa',data.idfa);
+			// };
+			// window.deviceInfoInvoke=(data)=>{
+			// 	localStorage.setItem('deviceInfo',data.data);
+			// };
+			// window.deviceTokenInvoke=(data)=>{
+			// 	if(data.code===1){
+			// 		localStorage.setItem('deviceToken',data.deviceId)
+			// 	}
+			// };
+			// this.getStatusBarHeight();
+			// this.getIDFA();
+			// this.getDeviceInfo();
+			// this.getDeviceToken();
 		},
 		methods: {
 			onVideoPause(){//解决切换页面视频自动暂停
@@ -70,38 +70,38 @@
 			toPrivate(){
 				window.location.href=protocal.privacy;
 			},
-			getStatusBarHeight(){//获取状态栏和底部安全距离
-				window.webkit.messageHandlers.call.postMessage({
-					api:"com.js.getStatusBarHeight",
-					data:{
-						url:''
-					},
-					callback:'getStatusBarHeightInvoke'
-				}) 
-			},
-			getIDFA(){
-				window.webkit.messageHandlers.call.postMessage({
-					api:"com.js.getIDFA",
-					data:{},
-					callback:'idfaInvoke'
-				}) 
-			},
-			getDeviceInfo(){
-				window.webkit.messageHandlers.call.postMessage({
-					api:"com.js.getDeviceInfo",
-					data:{
-						info:['idfa','platform','resolution','brand','ov','cate','appId','lang','currTime','av','model','deviceCode']
-					},
-					callback:'deviceInfoInvoke'
-				}) 
-			},
-			getDeviceToken(){
-				window.webkit.messageHandlers.call.postMessage({
-					api:"com.js.deviceToken",
-					data:{},
-					callback:'deviceTokenInvoke'
-				}) 
-			},
+			// getStatusBarHeight(){//获取状态栏和底部安全距离
+			// 	window.webkit.messageHandlers.call.postMessage({
+			// 		api:"com.js.getStatusBarHeight",
+			// 		data:{
+			// 			url:''
+			// 		},
+			// 		callback:'getStatusBarHeightInvoke'
+			// 	}) 
+			// },
+			// getIDFA(){
+			// 	window.webkit.messageHandlers.call.postMessage({
+			// 		api:"com.js.getIDFA",
+			// 		data:{},
+			// 		callback:'idfaInvoke'
+			// 	}) 
+			// },
+			// getDeviceInfo(){
+			// 	window.webkit.messageHandlers.call.postMessage({
+			// 		api:"com.js.getDeviceInfo",
+			// 		data:{
+			// 			info:['idfa','platform','resolution','brand','ov','cate','appId','lang','currTime','av','model','deviceCode']
+			// 		},
+			// 		callback:'deviceInfoInvoke'
+			// 	}) 
+			// },
+			// getDeviceToken(){
+			// 	window.webkit.messageHandlers.call.postMessage({
+			// 		api:"com.js.deviceToken",
+			// 		data:{},
+			// 		callback:'deviceTokenInvoke'
+			// 	}) 
+			// },
 		}
 	}
 </script>