Browse Source

欢迎页调整

zhengkaixin 3 years ago
parent
commit
b434eac5cc
1 changed files with 47 additions and 9 deletions
  1. 47 9
      pages/login/welcome.vue

+ 47 - 9
pages/login/welcome.vue

@@ -1,11 +1,18 @@
 <template>
 	<view>
+		
+		
 		<view class="welcome">
-			<view class="welcome-state1">
-				<view class="welcome-next" @click="gotoIndex()">{{step?step+'|':''}}跳过</view>
-				<view class="welcome-foot">
-					<u-image width="185px" height="48px" src="../../static/img/logo.png"></u-image>
-				</view>
+			
+			<view class="welcome-state1" >
+				<view class="welcome-next" style="z-index: 999;" @click="gotoIndex()">{{step?step+'|':''}}跳过</view>
+				
+			</view>
+			
+			<u-image  id="imgw" @load="imgsload" ref="imgw"  mode="widthFix"></u-image>
+			
+ 			<view class="welcome-foot">
+				<u-image width="185px" height="48px" src="../../static/img/logo.png"></u-image>
 			</view>
 			<!-- <view class="welcome-state2">
 				<view class="welcome-logo">
@@ -32,6 +39,28 @@
 			}
 		},
 		methods: {
+			imgsload(e){
+				 
+				
+				uni.getSystemInfo({
+					success: (res) => {
+						console.log(res)
+						
+						const query = uni.createSelectorQuery().in(this);
+						query.select('#imgw').boundingClientRect(data => {
+						  console.log("得到布局位置信息" + JSON.stringify(data));
+						  console.log("节点离页面顶部的距离为" + data.height);
+						  var windowH=res.windowHeight;
+						  var imgH= data.height;
+						  var value=windowH-imgH;
+						  if(value>100){
+							  document.getElementsByClassName("welcome-foot")[0].style="height:"+value+"px"
+						  }
+						}).exec();
+						
+					}
+				})
+			},
 			 findNoLTextConfigure(){
 				 loginApi.findNoLTextConfigure().then((response) => {
 				
@@ -85,10 +114,14 @@
 			},
 			setBackImg(){
 				var  img=this.carhelp.getConfig().homepageLogo
-				// img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"		
+				// img="../../static/img/AAA.jpg"		
 				if(img){
-					document.body.style="background:url("+img+") no-repeat;background-size: 100%;"
+					this.$refs.imgw.src=img
+					//document.body.style="background:url("+img+") no-repeat;background-size: 100%;"
+				}else{
+					this.$refs.imgw.src="../../static/img/welcome_bg.png"
 				}
+				
 			},
 			gotoIndex(){
 				if(this.isReady){
@@ -111,12 +144,16 @@
 					},1000)
 			},
 			onReadyIng(){
+				//let state = {};
+				
+								
 				this.indexstep()
 				this.setBackImg( )
 			},
 			
 		},
 		onLoad(op) {
+			
 			this.findNoLTextConfigure()
 			this.findByOpenId()
 			if(op.gunId){
@@ -152,8 +189,9 @@
 </script>
 <style>
 	page{
-		background:url(../../static/img/welcome_bg.png) no-repeat;
-		background-size:100%;
+		/* background:url(../../static/img/welcome_bg.png) no-repeat;
+		background-size:100%; */
+		background-color: #ffffff;
 	}
 </style>
 <style  lang="scss" scoped>