浏览代码

添加样式判断

306132416@qq.com 5 年之前
父节点
当前提交
0ece8dfae7
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      pages/index/index.vue

+ 7 - 2
pages/index/index.vue

@@ -1,9 +1,9 @@
 <template>
 	<view class="content">
 		  <!-- #ifdef MP-WEIXIN -->
-		                <official-account class="relevance"></official-account>
+		                <official-account class="relevance" @error="loadFail"></official-account>
 		  <!-- #endif -->
-		<image class="logo" src="/static/bg-home.jpg" mode="widthFix"></image>
+		<image class="logo" src="/static/bg-home.jpg" mode="widthFix" :style="{marginTop:marginTopCss}"></image>
 		<view class="getPhone-box" :style="{ bottom: bottomCss}">
 			<button type="primary" class="custom-btn"  open-type="getPhoneNumber"  style="margin-right: 5%!important;"
 			@getphonenumber="getPhoneNumber($event,'custom')" >观展登录</button> 
@@ -27,6 +27,7 @@
 				productList:[
 				],
 				bottomCss:'20%',
+				marginTopCss:'75px',
 				userInfoObj:{},
 			}
 		},
@@ -47,6 +48,10 @@
 			    }
 		},
 		methods: {
+			loadFail(e){
+				console.log(e)
+				this.marginTopCss = 0;
+			},
 			getEquipmentHeight(){
 			    let phoneHeight = uni.getSystemInfoSync().windowHeight;
 				console.log(phoneHeight)