소스 검색

页面内容顶格显示修复

mazhenhang 3 일 전
부모
커밋
01c55d79b0

+ 5 - 0
LiangZhiYUMao/pages/matchmaker-workbench/edit-profile.vue

@@ -1,5 +1,6 @@
 <template>
   <view class="edit-profile">
+	  <view class="status-bar-placeholder" :style="{height: statusBarHeight + 'px', backgroundColor: '#FFF9F9'}"></view>
     <!-- 顶部导航栏 -->
     <view class="header">
       <view class="back-btn" @click="handleBack">
@@ -141,6 +142,7 @@ import api from '../../utils/api.js'
 export default {
   data() {
     return {
+		statusBarHeight: 0,
       // 默认头像
       defaultAvatar: 'https://q.qlogo.cn/qqapp/1105591438/05E13358B43B3D39D6AC2D6888828201/100',
 
@@ -190,6 +192,9 @@ export default {
   },
   onLoad() {
     this.initPage()
+	//获取状态栏高度
+	const systemInfo = uni.getSystemInfoSync()
+	this.statusBarHeight = systemInfo.statusBarHeight
   },
   methods: {
     async initPage() {

+ 7 - 1
LiangZhiYUMao/pages/matchmaker-workbench/index.vue

@@ -1,5 +1,6 @@
 <template>
   <view class="matchmaker-workbench">
+	   <view class="status-bar-placeholder" :style="{height: statusBarHeight + 'px', backgroundColor: '#FFF9F9'}"></view>
     <!-- 顶部导航栏 -->
     <view class="header">
       <text class="header-title">红娘工作台</text>
@@ -129,6 +130,7 @@ import api from '@/utils/api.js'
 export default {
 		data() {
 				return {
+					statusBarHeight: 0,
 					bestMatchmakers: [],
 					announcements: [],
 					currentAnnouncementIndex: 0,
@@ -157,6 +159,9 @@ export default {
 				this.loadRankingData()
 				this.loadAnnouncements()
 				this.loadFunctionGridData()
+				//获取状态栏高度
+				  const systemInfo = uni.getSystemInfoSync()
+				  this.statusBarHeight = systemInfo.statusBarHeight
 			},
 		methods: {
 			// 加载当前登录红娘信息
@@ -370,7 +375,8 @@ export default {
   align-items: center;
   justify-content: space-between;
   padding: 25rpx 30rpx;
-  padding-top: calc(25rpx + env(safe-area-inset-top));
+  // padding-top: calc(25rpx + env(safe-area-inset-top));
+  padding: 25rpx 30rpx;
   background: #FFF9F9;
   border-bottom: 1rpx solid #F0F0F0;
 

+ 5 - 0
LiangZhiYUMao/pages/matchmaker-workbench/mine.vue

@@ -1,5 +1,6 @@
 <template>
   <view class="matchmaker-mine">
+	  <view class="status-bar-placeholder" :style="{height: statusBarHeight + 'px', backgroundColor: '#FFF9F9'}"></view>
     <!-- 顶部导航栏 -->
     <view class="header">
       <view class="back-btn" @click="goBack"></view>
@@ -196,6 +197,7 @@ import api from '../../utils/api.js'
 export default {
   data() {
     return {
+		statusBarHeight: 0,
       profile: {
         realName: '',
         avatarUrl: '',
@@ -224,6 +226,9 @@ export default {
     this.loadProfileData()
     this.checkSignInStatus()
     this.generateCalendar()
+	//获取状态栏高度
+	  const systemInfo = uni.getSystemInfoSync()
+	  this.statusBarHeight = systemInfo.statusBarHeight
   },
   onShow() {
     // 从编辑资料页返回时,自动刷新个人资料

+ 27 - 1
LiangZhiYUMao/pages/matchmaker-workbench/my-resources.vue

@@ -1,7 +1,11 @@
 <template>
 	<view class="my-resources">
+		<view class="status-bar-placeholder" :style="{height: statusBarHeight + 'px', backgroundColor: '#FFFFFF'}"></view>
 		<!-- 顶部导航栏 -->
 		<view class="header">
+			<view class="header-left" @click="goBack">
+			    <text class="back-icon">←</text>
+			  </view>
 			<text class="header-title">我的资源</text>
 			<view class="header-right">
 				<text class="dropdown-arrow">▼</text>
@@ -234,6 +238,7 @@
 export default {
 		data() {
 			return {
+				statusBarHeight: 0,
 				searchKeyword: '',
 				isFirstLoad: true, // 标记是否为首次加载
 				currentTab: 'resource', // 当前选中的标签:'resource' 或 'clue'
@@ -297,6 +302,9 @@ export default {
 			
 			// 启动定时刷新,每30秒检查一次用户注册状态变化
 			this.startAutoRefresh()
+			//获取状态栏高度
+			  const systemInfo = uni.getSystemInfoSync()
+			  this.statusBarHeight = systemInfo.statusBarHeight
 		},
 		onShow() {
 			// 页面显示时刷新列表(从其他页面返回时,非首次加载)
@@ -316,6 +324,13 @@ export default {
 			this.stopAutoRefresh()
 		},
 		methods: {
+			
+			//返回上一页
+			  goBack() {
+			    uni.navigateBack({
+			      delta: 1 // 返回上一级页面
+			    })
+			  },
 			// 获取审核状态文本
 			getAuditStatusText(status) {
 				if (status === null || status === undefined) {
@@ -1135,14 +1150,25 @@ export default {
 		align-items: center;
 		justify-content: space-between;
 		padding: 20rpx 30rpx;
-		padding-top: calc(20rpx + env(safe-area-inset-top));
+		// padding-top: calc(20rpx + env(safe-area-inset-top));
 		background: #FFFFFF;
 		border-bottom: 1rpx solid #F0F0F0;
+		.header-left {
+			width: 40rpx; // 固定宽度,避免挤压标题
+		}
+		// 新增:返回按钮样式
+		  .back-icon {
+		    font-size: 36rpx;
+		    color: #9C27B0; // 和标题颜色统一
+		    font-weight: bold;
+		  }
 
 		.header-title {
 			font-size: 36rpx;
 			font-weight: bold;
 			color: #9C27B0;
+			flex: 1; // 让标题占中间剩余空间,实现居中
+			text-align: center;
 		}
 
 	.header-right {

+ 5 - 0
LiangZhiYUMao/pages/matchmaker-workbench/ranking.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="matchmaker-ranking">
+		<view class="status-bar-placeholder" :style="{height: statusBarHeight + 'px', backgroundColor: '#FFF9F9'}"></view>
 		<!-- 顶部导航栏 -->
 		<view class="header">
 			<view class="back-btn" @click="goBack"></view>
@@ -111,6 +112,7 @@
 export default {
 		data() {
 			return {
+				statusBarHeight: 0,
 				loading: false,
 				rankingList: [],
 				defaultAvatar: '/static/default-avatar.svg',
@@ -139,6 +141,9 @@ export default {
 			}
 			// 加载排行榜数据
 			this.loadRankingData()
+			//获取状态栏高度
+			  const systemInfo = uni.getSystemInfoSync()
+			  this.statusBarHeight = systemInfo.statusBarHeight
 		},
 		methods: {
 			// 返回上一页

+ 6 - 4
LiangZhiYUMao/pages/page3/page3.vue

@@ -1,13 +1,14 @@
 <template>
   <view class="content">
-    <!-- 背景图片 -->
-    <image class="bg-image" src="http://115.190.125.125:9000/static-images/login-bg.png" mode="aspectFill"></image>
+    <!-- 背景图片 http://115.190.125.125:9000/static-images/login-bg.png-->
+    <image class="bg-image" src="https://api.zhongruanke.cn/minio/static-images/login-bg.png" mode="aspectFill"></image>
 
 
     <!-- 顶部标题区域 -->
     <view class="header-section">
       <!-- <view class="app-logo">🪶🪶</view> -->
-      <image class="app-logo" src="http://115.190.125.125:9000/static-images/logo.png" mode="widthFix"></image>
+	  <!-- http://115.190.125.125:9000/static-images/logo.png -->
+      <image class="app-logo" src="https://api.zhongruanke.cn/minio/static-images/logo.png" mode="widthFix"></image>
       <!-- <view class="app-name">青鸾之恋</view> -->
       <view class="app-slogan">真诚相遇 · 携手一生</view>
     </view>
@@ -16,7 +17,8 @@
     <view class="login-box">
       <!-- 微信一键登录 -->
       <button class="wechat-login-btn" @click="login_zheshow">
-        <image class="wechat-icon" src="http://115.190.125.125:9000/static-images/wechat-icon.png" mode="aspectFit"></image>
+		  <!-- http://115.190.125.125:9000/static-images/wechat-icon.png -->
+        <image class="wechat-icon" src="https://api.zhongruanke.cn/minio/static-images/wechat-icon.png" mode="aspectFit"></image>
         <text>微信一键登录</text>
       </button>
 

+ 17 - 7
LiangZhiYUMao/pages/plaza/publish.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="publish-page">
 		<!-- 自定义导航栏 -->
-		<view class="custom-navbar">
+		<view class="custom-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
 			<view class="navbar-left" @click="goBack">
 				<text class="back-icon">← 返回</text>
 			</view>
@@ -10,7 +10,7 @@
 		</view>
 		
 		<!-- 内容区域 -->
-		<scroll-view class="content-scroll" scroll-y>
+		<scroll-view class="content-scroll" scroll-y :style="{ paddingTop: `calc(96rpx + ${statusBarHeightRpx}rpx)` }">
 			<view class="form-container">
 				<!-- 内容输入 -->
 				<view class="content-section">
@@ -68,7 +68,10 @@ export default {
             isEdit: false,
             dynamicId: null,
             visibility: 1,
-            mediaType: 1
+            mediaType: 1,
+			statusBarHeight: 0, // 状态栏高度(单位:px)
+			statusBarHeightRpx: 0, // 状态栏高度(转换为rpx,适配页面布局)
+			isIos: false // 是否为苹果设备
         }
 	},
 	
@@ -97,6 +100,13 @@ export default {
 				this.visibility = parseInt(options.visibility)
 			}
 		}
+		// 1. 获取系统信息(设备类型、状态栏高度)
+		    const systemInfo = uni.getSystemInfoSync();
+		    this.isIos = systemInfo.platform === 'ios'; // 判断是否为苹果设备
+		    this.statusBarHeight = systemInfo.statusBarHeight; // 获取状态栏高度(px)
+		    // 转换状态栏高度为rpx(uni-app中1rpx = 屏幕宽度/750 px)
+		    this.statusBarHeightRpx = (systemInfo.statusBarHeight * 750) / systemInfo.screenWidth;
+
 	},
 	methods: {
 		// 返回上一页
@@ -287,8 +297,8 @@ export default {
 		align-items: center;
 		justify-content: space-between;
 		padding: 0 32rpx;
-        padding-top: constant(safe-area-inset-top);
-        padding-top: env(safe-area-inset-top);
+        // padding-top: constant(safe-area-inset-top);
+        // padding-top: env(safe-area-inset-top);
 		z-index: 1000;
         box-shadow: none;
 		
@@ -327,8 +337,8 @@ export default {
 	
 	// 内容滚动区域
 .content-scroll {
-    padding-top: calc(96rpx + constant(safe-area-inset-top));
-    padding-top: calc(96rpx + env(safe-area-inset-top));
+    // padding-top: calc(96rpx + constant(safe-area-inset-top));
+    // padding-top: calc(96rpx + env(safe-area-inset-top));
     height: calc(100vh - 100rpx); // 预留底部发布栏空间
     padding-bottom: 0;
 }