Commit 7c862638 by Lin

feat(reception): 添加顶部安全区以优化接待中心布局

- 新增自定义导航页的顶部安全区,避免与状态栏/刘海重叠
- 移除 un-segmented 组件的多余属性,简化样式
- 更新接待中心组件的布局逻辑,确保在不同设备上良好显示
1 parent e3647338
<template>
<!-- 与 HomeFrame 接待详情一致:预录表单用绝对定位层 + v-show,不再使用 FormAdd 内 un-popup -->
<view class="reception-center-page">
<!-- 自定义导航页:按窗口安全区预留顶部,避免状态栏/刘海与首屏「业绩看板」重叠 -->
<view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view>
<!-- 根节点包一层:保证 scroll-view 在 flex 父级内获得确定高度,否则 4.0+ 默认高度=内容高,无法内部滚动、scrolltolower 不触发 -->
<view class="reception-dashboard-root">
<scroll-view
......@@ -80,8 +82,6 @@
<view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented
type="card"
:height="24"
:font-size="11"
bg-color="rgba(241, 245, 249, 0.5)"
active-color="#000000"
:model-value="entryFilterIndex"
......@@ -97,8 +97,6 @@
<view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented
type="card"
:height="24"
:font-size="11"
bg-color="rgba(241, 245, 249, 0.5)"
active-color="#000000"
:model-value="filterTabIndex"
......@@ -114,8 +112,6 @@
<view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented
type="card"
:height="24"
:font-size="12"
bg-color="rgba(241, 245, 249, 0.5)"
active-color="#000000"
:model-value="submittedResultTabIndex"
......@@ -130,8 +126,6 @@
<view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented
type="card"
:height="24"
:font-size="11"
bg-color="#f1f5f9"
active-color="#000000"
:model-value="reviewTabIndex"
......@@ -146,8 +140,6 @@
<view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented
type="card"
:height="24"
:font-size="11"
bg-color="rgba(241, 245, 249, 0.5)"
active-color="#000000"
:model-value="unsubmittedPendingTabIndex"
......@@ -325,9 +317,46 @@ const RECEPTION_LAYOUT_POLL_MS = 400
/** 调试:@scroll 采样计数(不读 event,避免 UTS 编译/运行期问题) */
let receptionDashboardScrollSampleCount = 0
/** 顶部安全区占位(px):与系统状态栏/刘海对齐,随窗口信息刷新 */
const receptionPageInsetTopPx = ref(0)
const receptionSafeTopSpacerStyle = computed((): UTSJSONObject => {
return {
height: `${receptionPageInsetTopPx.value}px`,
width: '100%',
} as UTSJSONObject
})
function syncReceptionDashboardLayout(): void {
// 必须用 uni.getWindowInfo():uview-unix 的 getWindowInfo 在 Android 上返回 GetWindowInfoResult,不能 as UTSJSONObject
const info = uni.getWindowInfo()
// 自定义导航:预留顶部安全区,避免与状态栏/刘海重叠(优先 safeAreaInsets.top)
let topInset = 0
const insets = info.safeAreaInsets
if (insets != null) {
const t = insets.top
if (t > 0) {
topInset = Math.round(t)
}
}
if (topInset <= 0) {
const safe = info.safeArea
if (safe != null) {
const st = safe.top
if (st > 0) {
topInset = Math.round(st)
}
}
}
if (topInset <= 0) {
const sb = info.statusBarHeight
if (sb > 0) {
topInset = Math.round(sb)
}
}
if (receptionPageInsetTopPx.value != topInset) {
receptionPageInsetTopPx.value = topInset
}
const ww = info.windowWidth
const wh = info.windowHeight
const sw = info.screenWidth
......@@ -1190,6 +1219,7 @@ function switchRightTab(index: number): void {
}
onMounted(() => {
syncReceptionDashboardLayout()
receptionDashboardLayoutPollId = setInterval(syncReceptionDashboardLayout, RECEPTION_LAYOUT_POLL_MS)
// 页面加载后再次兜底计算(避免运行期时区/时间跳变导致不一致)
setTimeProgress()
......@@ -1239,6 +1269,12 @@ onUnmounted(() => {
flex-direction: column;
}
/* 动态高度由 receptionSafeTopSpacerStyle 注入,避免与状态栏区域重叠 */
.reception-safe-top-spacer {
width: 100%;
flex-shrink: 0;
}
/* 预录信息 / 客户档案详情 全屏层:对齐 HomeFrame .reception-detail-inner */
.form-add-inner,
.form-detail-inner {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!