Commit 7058287b by Lin

feat(reception): 增加接待中心页面高度计算逻辑

- 新增接待中心页面的高度计算,解决双滚动/溢出问题
- 使用屏幕高度作为容器高度基准,确保内容区适应不同屏幕
- 优化样式,提升用户体验和页面布局的灵活性
1 parent f6289409
<template> <template>
<!-- 接待中心 Tab 聚合页:与 pages/index、pages/person/myCenter 一致,SceneShell 负责 hideNativeTabBar + un-tabbar --> <!-- 接待中心 Tab 聚合页:与 pages/index、pages/person/myCenter 一致,SceneShell 负责 hideNativeTabBar + un-tabbar -->
<layout-root :page-vars="pageVars"> <layout-root :page-vars="pageVars">
<view class="reception-shell-page"> <view class="reception-shell-page" :style="receptionShellPageStyle">
<SceneShell ref="shellRef" <SceneShell ref="shellRef"
:active-tab-index="1"> :active-tab-index="1">
<template #default> <template #default>
...@@ -215,6 +215,29 @@ const receptionOrientationHook = useOrientation() ...@@ -215,6 +215,29 @@ const receptionOrientationHook = useOrientation()
const hookOrientation = computed((): string => { const hookOrientation = computed((): string => {
return (receptionOrientationHook.orientationKey as Ref<string>).value return (receptionOrientationHook.orientationKey as Ref<string>).value
}) })
/**
* 固定页面可用高度,避免出现“整页上下滑 + 内部列表滚动”的双滚动/溢出问题。
* 说明:
* - uni-app x App 端不支持 vh/calc,改用 JS 计算后的 px 高度
* - 这里使用 useOrientation 内部的 screenHeight(物理屏幕高)作为页面容器高度基准
* - 内容区继续用 flex 布局分配剩余高度(Tabs 固定、内容自适应)
*/
const receptionShellPageStyle = computed((): UTSJSONObject => {
const h = (receptionOrientationHook.windowHeight as Ref<number>).value
if (h > 0) {
return {
width: '100%',
height: `${h}px`,
overflow: 'hidden'
} as UTSJSONObject
}
return {
width: '100%',
height: '100%',
overflow: 'hidden'
} as UTSJSONObject
})
// ========== Tab 管理 ========== // ========== Tab 管理 ==========
/** 主 Tab:0=业绩看板,1=客户列表 */ /** 主 Tab:0=业绩看板,1=客户列表 */
const mainTabIndex = ref(0) const mainTabIndex = ref(0)
...@@ -1243,6 +1266,16 @@ onUnmounted(() => { ...@@ -1243,6 +1266,16 @@ onUnmounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
@import "./styles/common.scss"; @import "./styles/common.scss";
.reception-shell-page {
flex: 1;
width: 100%;
height: 100%;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* 接待中心页面包一层:供预录表单绝对定位覆盖 */ /* 接待中心页面包一层:供预录表单绝对定位覆盖 */
.reception-center-page { .reception-center-page {
flex: 1; flex: 1;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!