Prechádzať zdrojové kódy

设置h5环境浏览器宽度

@dongkboy 2 mesiacov pred
rodič
commit
bf21014195
2 zmenil súbory, kde vykonal 24 pridanie a 0 odobranie
  1. 22 0
      index.html
  2. 2 0
      pages/login/login.vue

+ 22 - 0
index.html

@@ -23,6 +23,28 @@
 			})
 		</script>
 		<link rel="stylesheet" href="<%= BASE_URL %>static/index.css" />
+		<style>
+			/* #ifdef H5 */
+			/* 在桌面浏览器中限制宽度为375px并居中显示 */
+			@media screen and (min-width: 375px) {
+				body {
+					background-color: #f5f5f5;
+					display: flex;
+					justify-content: center;
+					align-items: flex-start;
+					min-height: 100vh;
+					margin: 0;
+					padding: 0;
+				}
+				.uni-app--maxwidth {
+					width: 400px;
+					min-height: 100vh;
+					background-color: #ffffff;
+					box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
+				}
+			}
+			/* #endif */
+		</style>
 	</head>
 	<body>
 		<!-- 该文件为 H5 平台的模板 HTML,并非应用入口,请勿直接运行此文件。 -->

+ 2 - 0
pages/login/login.vue

@@ -62,6 +62,7 @@
 		</view>
 
 		<view class="footer dis f-c">
+			<!-- #ifdef APP -->
 			<view class="dis a-c j-c">
 				<view class="line"></view>
 				<text class="ml-2 mr-2">第三方登录方式</text>
@@ -72,6 +73,7 @@
 				</image>
 				<image src="/static/image/zfb.png" mode="" @click="onzfbAppLogin"></image>
 			</view>
+			<!-- #endif -->
 		</view>
 		<uni-Popup :show="modalshow" @close='deptclose' headerTitle="请输入下方图形验证码" overflow="auto" maxHeight="580rpx"
 			mode="center" width="90%">