Commit e49d8f91 by Lin

feat(接待中心): 支持横屏模式并优化布局

- 在接待中心页面中实现横屏支持,调整客户和接待记录列表的展示方式
- 根据屏幕方向动态切换布局,横屏时采用左右分栏展示,竖屏时保持原有逻辑
- 优化样式以适应不同屏幕方向,确保用户体验一致性
- 移除默认竖屏锁定逻辑,允许系统自动处理屏幕方向
1 parent cc1177ba
...@@ -15,14 +15,14 @@ export default { ...@@ -15,14 +15,14 @@ export default {
layoutService.init(); layoutService.init();
const sys = uni.getSystemInfoSync(); const sys = uni.getSystemInfoSync();
console.log(`[App] 当前分辨率:${ sys.screenWidth } x ${ sys.screenHeight}`); console.log(`[App] 当前分辨率:${ sys.screenWidth } x ${ sys.screenHeight}`);
// 默认竖屏:锁定后延迟刷新屏幕尺寸,并重试锁定避免首屏被框架改向 // 默认竖屏:如需强制锁定竖屏,再开启这里的锁定逻辑
lockOrientation("portrait-primary"); // lockOrientation("portrait-primary");
setTimeout(() => { setTimeout(() => {
layoutService.refreshScreenInfo(); layoutService.refreshScreenInfo();
updateResolutionConfig(); updateResolutionConfig();
}, 400); }, 400);
setTimeout(() => { lockOrientation("portrait-primary"); }, 600); // setTimeout(() => { lockOrientation("portrait-primary"); }, 600);
setTimeout(() => { lockOrientation("portrait-primary"); }, 1200); // setTimeout(() => { lockOrientation("portrait-primary"); }, 1200);
// #endif // #endif
console.log("App Launch"); console.log("App Launch");
// 启动时仅做分辨率配置,避免后台定时器/录音模拟导致对象被长时间持有 // 启动时仅做分辨率配置,避免后台定时器/录音模拟导致对象被长时间持有
......
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
"versionCode": "126", "versionCode": "126",
"uni-app-x": { "uni-app-x": {
}, },
/* 快应用特有相关 */
"quickapp": {}, "quickapp": {},
/* 小程序特有相关 */
"mp-weixin": { "mp-weixin": {
"appid": "", "appid": "",
"setting": { "setting": {
...@@ -38,10 +36,7 @@ ...@@ -38,10 +36,7 @@
"xxhdpi": "", "xxhdpi": "",
"xxxhdpi": "" "xxxhdpi": ""
} }
}, }
"orientation": [
"portrait-primary"
]
} }
}, },
"app-android": { "app-android": {
...@@ -53,8 +48,8 @@ ...@@ -53,8 +48,8 @@
"system": {} "system": {}
}, },
"lime-sqlite": {}, "lime-sqlite": {},
"uni-recorder-x": {}, // 录音模块 "uni-recorder-x": {},
"uni-recorder": {}, // 录音模块 "uni-recorder": {},
"uni-websocket": {} "uni-websocket": {}
}, },
"icons": { "icons": {
...@@ -66,9 +61,6 @@ ...@@ -66,9 +61,6 @@
"splashScreens": { "splashScreens": {
"default": {} "default": {}
}, },
"orientation": [
"portrait-primary"
],
"permissions": [ "permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
...@@ -92,10 +84,7 @@ ...@@ -92,10 +84,7 @@
"distribute": { "distribute": {
"modules": {}, "modules": {},
"icons": {}, "icons": {},
"splashScreens": {}, "splashScreens": {}
"orientation": [
"portrait-primary"
]
} }
}, },
"web": { "web": {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<!-- <view class="reception-navbar-spacer"></view> --> <!-- <view class="reception-navbar-spacer"></view> -->
<!-- Tab 切换 --> <!-- Tab 切换 -->
<view class="reception-tabs-container"> <view v-if="isLandscape != true" class="reception-tabs-container">
<un-tabs <un-tabs
class="reception-main-tabs" class="reception-main-tabs"
:value="mainTabIndex" :value="mainTabIndex"
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<!-- Tab 内容区域 --> <!-- Tab 内容区域 -->
<view class="reception-content-container"> <view class="reception-content-container">
<!-- 竖屏:保持原逻辑(Tabs 切换展示) -->
<view v-if="isLandscape != true" class="reception-content-portrait">
<ReceptionDashboardTab <ReceptionDashboardTab
v-if="mainTabIndex == 0" v-if="mainTabIndex == 0"
:performance-data="performanceData" :performance-data="performanceData"
...@@ -72,6 +74,57 @@ ...@@ -72,6 +74,57 @@
/> />
</view> </view>
<!-- 横屏:隐藏 Tabs,左右分栏同时展示(左 1/3 业绩看板,右 2/3 客户列表) -->
<view v-else class="reception-content-landscape">
<view class="reception-landscape-left">
<ReceptionDashboardTab
:performance-data="performanceData"
:performance-metrics-visible="performanceMetricsVisible"
:selected-brand="selectedBrand"
:time-progress-percent="timeProgressPercent"
:compare-rows="currentOutputTab.compareRows"
:summary="currentOutputTab.summary"
:target-value-text="monthValueTargetText"
:achievement-value-text="monthValueAchievementText"
:output-tab-index="outputTabIndex"
@toggle-metrics="togglePerformanceMetricsVisibility"
@open-brand-picker="show = true"
@update:output-tab-index="onOutputTabIndexChange"
/>
</view>
<view class="reception-landscape-right">
<ReceptionCustomerListTab
:list-sub-tab-index="listSubTabIndex"
:reception-filter-narrow-mode="receptionFilterNarrowMode"
:entry-filter-index="entryFilterIndex"
:filter-tab-index="filterTabIndex"
:submitted-result-tab-index="submittedResultTabIndex"
:review-tab-index="reviewTabIndex"
:unsubmitted-pending-tab-index="unsubmittedPendingTabIndex"
:customer-list="customerList"
:reception-record-list="receptionRecordList"
:customer-list-loading-more="customerListLoadingMore"
:customer-list-has-more="customerListHasMore"
:reception-list-loading-more="receptionListLoadingMore"
:reception-list-has-more="receptionListHasMore"
@scroll-lower="onListScrollToLower"
@switch-list-sub-tab="switchListSubTab"
@switch-entry-filter-tab="switchEntryFilterTab"
@switch-filter-tab="switchFilterTab"
@open-submitted-result-picker="showSubmittedResultPicker = true"
@open-review-picker="showReviewPicker = true"
@switch-unsubmitted-pending-tab="switchUnsubmittedPendingTab"
@customer-entry-click="onCustomerEntryClick"
@entry-click="onListCustomerEntryClick"
@entry-edit="onListCustomerEntryEdit"
@entry-delete="onListCustomerEntryDelete"
@reception-click="onReceptionCardClick"
/>
</view>
</view>
</view>
<!-- 全局弹窗 --> <!-- 全局弹窗 -->
<un-picker :show="show" :columns="columns" @close="onClose" @cancel="onClose" @confirm="onConfirm" /> <un-picker :show="show" :columns="columns" @close="onClose" @cancel="onClose" @confirm="onConfirm" />
<un-picker <un-picker
...@@ -173,6 +226,11 @@ const receptionFilterNarrowMode = ref(false) ...@@ -173,6 +226,11 @@ const receptionFilterNarrowMode = ref(false)
let receptionDashboardLayoutPollId: number | null = null let receptionDashboardLayoutPollId: number | null = null
const RECEPTION_LAYOUT_POLL_MS = 400 const RECEPTION_LAYOUT_POLL_MS = 400
/** 是否横屏(windowWidth > windowHeight)。横屏模式下隐藏 Tabs,左右分栏同时展示两个模块 */
const isLandscape = ref(false)
/** 记录上一次打印过的方向,避免轮询期间刷屏 */
let lastOrientationLogLandscape: boolean | null = null
/** 顶部安全区占位(px):与系统状态栏/刘海对齐,随窗口信息刷新 */ /** 顶部安全区占位(px):与系统状态栏/刘海对齐,随窗口信息刷新 */
const receptionPageInsetTopPx = ref(0) const receptionPageInsetTopPx = ref(0)
...@@ -213,13 +271,28 @@ function syncReceptionDashboardLayout(): void { ...@@ -213,13 +271,28 @@ function syncReceptionDashboardLayout(): void {
if (receptionPageInsetTopPx.value != topInset) { if (receptionPageInsetTopPx.value != topInset) {
receptionPageInsetTopPx.value = topInset receptionPageInsetTopPx.value = topInset
} }
// 宽高优先取 systemInfo(部分机型旋转后 getWindowInfo 可能刷新不及时)
const sys = uni.getSystemInfoSync()
const sysSw = sys.screenWidth
const sysSh = sys.screenHeight
const ww = info.windowWidth const ww = info.windowWidth
const wh = info.windowHeight const wh = info.windowHeight
const sw = info.screenWidth const sw = info.screenWidth
const sh = info.screenHeight const sh = info.screenHeight
const w = ww > 0 ? ww : sw
const h = wh > 0 ? wh : sh const w = sysSw > 0 ? sysSw : (sw > 0 ? sw : ww)
const h = sysSh > 0 ? sysSh : (sh > 0 ? sh : wh)
const nextSplit = w > h const nextSplit = w > h
if (isLandscape.value != nextSplit) {
isLandscape.value = nextSplit
}
if (lastOrientationLogLandscape == null || lastOrientationLogLandscape != nextSplit) {
lastOrientationLogLandscape = nextSplit
console.log(
`[ReceptionCenter] 屏幕方向变化:${nextSplit ? '横屏' : '竖屏'}(w=${w}, h=${h}, window=${ww}x${wh}, screen=${sw}x${sh})`
)
}
const RECEPTION_FILTER_NARROW_WIDTH = 920 const RECEPTION_FILTER_NARROW_WIDTH = 920
const nextFilterNarrowMode = nextSplit && w > 0 && w < RECEPTION_FILTER_NARROW_WIDTH const nextFilterNarrowMode = nextSplit && w > 0 && w < RECEPTION_FILTER_NARROW_WIDTH
if (receptionFilterNarrowMode.value != nextFilterNarrowMode) { if (receptionFilterNarrowMode.value != nextFilterNarrowMode) {
...@@ -273,6 +346,7 @@ function onMainTabChange(e: any): void { ...@@ -273,6 +346,7 @@ function onMainTabChange(e: any): void {
} }
function onOutputTabIndexChange(index: number): void { function onOutputTabIndexChange(index: number): void {
console.log('[ReceptionCenter] 产值卡片 Tab 切换:', index)
outputTabIndex.value = index outputTabIndex.value = index
} }
...@@ -293,7 +367,11 @@ function switchListSubTab(index: number): void { ...@@ -293,7 +367,11 @@ function switchListSubTab(index: number): void {
/** 客户列表触底加载更多 */ /** 客户列表触底加载更多 */
function onListScrollToLower(): void { function onListScrollToLower(): void {
if (mainTabIndex.value == 1) { // 横屏:左右分栏同时展示「业绩看板 + 客户列表」,此时 mainTabIndex 可能仍为 0
// 因此触底加载不能依赖 mainTabIndex == 1 的门禁,否则横屏永远不触发加载更多
if (isLandscape.value != true && mainTabIndex.value != 1) {
return
}
if (listSubTabIndex.value == 0) { if (listSubTabIndex.value == 0) {
console.log('[ReceptionCenter] 客户列表触底') console.log('[ReceptionCenter] 客户列表触底')
void getCustomerList(true) void getCustomerList(true)
...@@ -301,7 +379,6 @@ function onListScrollToLower(): void { ...@@ -301,7 +379,6 @@ function onListScrollToLower(): void {
console.log('[ReceptionCenter] 接待列表触底') console.log('[ReceptionCenter] 接待列表触底')
void getReceptionRecordList(true) void getReceptionRecordList(true)
} }
}
} }
/** 业绩看板数值是否展示(睁眼可见 / 闭眼隐藏) */ /** 业绩看板数值是否展示(睁眼可见 / 闭眼隐藏) */
...@@ -939,11 +1016,22 @@ function onReviewPickerClose(): void { ...@@ -939,11 +1016,22 @@ function onReviewPickerClose(): void {
onMounted(() => { onMounted(() => {
syncReceptionDashboardLayout() syncReceptionDashboardLayout()
// uni-app x(尤其 APP 端)对 onWindowResize 支持不稳定,这里统一用轮询保证兼容性
// 如需 H5 实时监听,可在 H5 条件编译块里单独注册
receptionDashboardLayoutPollId = setInterval(syncReceptionDashboardLayout, RECEPTION_LAYOUT_POLL_MS) receptionDashboardLayoutPollId = setInterval(syncReceptionDashboardLayout, RECEPTION_LAYOUT_POLL_MS)
// 页面加载后再次兜底计算(避免运行期时区/时间跳变导致不一致) // 页面加载后再次兜底计算(避免运行期时区/时间跳变导致不一致)
setTimeProgress() setTimeProgress()
// 根据当前 Tab 加载对应数据 // 根据当前 Tab 加载对应数据
// 横屏:左右分栏同时展示两个模块,因此初始化时两边数据都需要拉取
if (isLandscape.value == true) {
void getPerformanceData()
if (listSubTabIndex.value == 0) {
void getCustomerList(false)
} else {
void getReceptionRecordList(false)
}
} else {
if (mainTabIndex.value == 0) { if (mainTabIndex.value == 0) {
void getPerformanceData() void getPerformanceData()
} else { } else {
...@@ -953,6 +1041,7 @@ onMounted(() => { ...@@ -953,6 +1041,7 @@ onMounted(() => {
void getReceptionRecordList(false) void getReceptionRecordList(false)
} }
} }
}
console.log('[ReceptionCenter] 页面初始化完成') console.log('[ReceptionCenter] 页面初始化完成')
}) })
...@@ -967,11 +1056,6 @@ onMounted(() => { ...@@ -967,11 +1056,6 @@ onMounted(() => {
onUnmounted(() => { onUnmounted(() => {
uni.$off('refresh-reception-list') uni.$off('refresh-reception-list')
const tid = receptionDashboardLayoutPollId
if (tid != null) {
clearInterval(tid)
receptionDashboardLayoutPollId = null
}
}) })
</script> </script>
...@@ -1022,6 +1106,35 @@ onUnmounted(() => { ...@@ -1022,6 +1106,35 @@ onUnmounted(() => {
flex-direction: column; flex-direction: column;
} }
.reception-content-portrait {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
.reception-content-landscape {
flex: 1;
min-height: 0;
display: flex;
flex-direction: row;
}
.reception-landscape-left {
flex: 1;
min-height: 0;
min-width: 0;
overflow: hidden;
border-right: 1px solid #eef2f7;
}
.reception-landscape-right {
flex: 2;
min-height: 0;
min-width: 0;
overflow: hidden;
}
/* 预录信息 / 客户档案详情 全屏层:对齐 HomeFrame .reception-detail-inner */ /* 预录信息 / 客户档案详情 全屏层:对齐 HomeFrame .reception-detail-inner */
.form-add-inner, .form-add-inner,
.form-detail-inner { .form-detail-inner {
......
<template> <template>
<!-- 客户录入列表:与 customervisits.customerInfoPage 字段对齐(ownerPhone / brandModel / customerTagName / arrivalDate / ownerName) --> <!-- 客户录入列表:与 customervisits.customerInfoPage 字段对齐(ownerPhone / brandModel / customerTagName / arrivalDate / ownerName) -->
<view class="customer-entry-list"> <view :class="['customer-entry-list', isLandscape ? 'customer-entry-list-landscape' : '']">
<!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 --> <!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 -->
<view <view
v-if="loading && (props.customerList == null || props.customerList.length == 0)" v-if="loading && (props.customerList == null || props.customerList.length == 0)"
v-for="i in skeletonCardCount" v-for="i in skeletonCardCount"
:key="'entry-skeleton-' + i" :key="'entry-skeleton-' + i"
class="list-card list-card-entry glass-card" :class="['list-card', 'list-card-entry', 'glass-card', isLandscape ? 'list-card-entry-landscape' : '']"
> >
<un-skeleton rows="3" title loading></un-skeleton> <un-skeleton rows="3" title loading></un-skeleton>
</view> </view>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
v-else v-else
v-for="item in props.customerList" v-for="item in props.customerList"
:key="getStr(item, 'id')" :key="getStr(item, 'id')"
class="list-card list-card-entry glass-card" :class="['list-card', 'list-card-entry', 'glass-card', isLandscape ? 'list-card-entry-landscape' : '']"
@click="onEntryCardClick(item)" @click="onEntryCardClick(item)"
@longpress="onEntryCardLongPress(item)" @longpress="onEntryCardLongPress(item)"
> >
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed, ref, watch } from 'vue' import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
const props = defineProps<{ const props = defineProps<{
/** 客户档案列表(由父级拉取并传入) */ /** 客户档案列表(由父级拉取并传入) */
...@@ -72,6 +72,31 @@ const props = defineProps<{ ...@@ -72,6 +72,31 @@ const props = defineProps<{
const loading = computed<boolean>(() => props.loading === true) const loading = computed<boolean>(() => props.loading === true)
const skeletonCardCount = 3 const skeletonCardCount = 3
/** 是否横屏(w > h)。uni-app x UTS 当前编译目标不支持 onWindowResize,使用轮询响应旋转 */
const isLandscape = ref(false)
let orientationPollId = 0
const ORIENTATION_POLL_MS = 400
function syncOrientation(): void {
const info = uni.getWindowInfo()
// 宽高优先取 systemInfo(部分机型旋转后 getWindowInfo 可能刷新不及时)
const sys = uni.getSystemInfoSync()
const sysSw = sys.screenWidth
const sysSh = sys.screenHeight
const ww = info.windowWidth
const wh = info.windowHeight
const sw = info.screenWidth
const sh = info.screenHeight
const w = sysSw > 0 ? sysSw : (sw > 0 ? sw : ww)
const h = sysSh > 0 ? sysSh : (sh > 0 ? sh : wh)
const nextLandscape = w > h
if (isLandscape.value != nextLandscape) {
isLandscape.value = nextLandscape
}
}
const emit = defineEmits<{ const emit = defineEmits<{
/** 点击卡片:打开客户档案详情 */ /** 点击卡片:打开客户档案详情 */
'entry-click': [item: UTSJSONObject] 'entry-click': [item: UTSJSONObject]
...@@ -91,6 +116,21 @@ watch( ...@@ -91,6 +116,21 @@ watch(
} }
) )
onMounted((): void => {
syncOrientation()
orientationPollId = setInterval((): void => {
syncOrientation()
}, ORIENTATION_POLL_MS)
})
onUnmounted((): void => {
const id = orientationPollId
if (id > 0) {
clearInterval(id)
orientationPollId = 0
}
})
function getStr(data: UTSJSONObject, key: string): string { function getStr(data: UTSJSONObject, key: string): string {
const v = data[key] const v = data[key]
if (v == null) { if (v == null) {
...@@ -229,6 +269,12 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -229,6 +269,12 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
width: 100%; width: 100%;
} }
.customer-entry-list-landscape {
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
.glass-card { .glass-card {
background-color: rgba(255, 255, 255, 0.85); background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.6);
...@@ -248,6 +294,10 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -248,6 +294,10 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
overflow: hidden; overflow: hidden;
} }
.list-card-entry-landscape {
width: 49%;
}
.entry-card-mask { .entry-card-mask {
position: absolute; position: absolute;
left: 0; left: 0;
......
<template> <template>
<!-- 接待复盘记录列表:与接待接口字段对齐,数据由父级拉取后传入 --> <!-- 接待复盘记录列表:与接待接口字段对齐,数据由父级拉取后传入 -->
<view class="reception-record-list"> <view :class="['reception-record-list', isLandscape ? 'reception-record-list-landscape' : '']">
<!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 --> <!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 -->
<view <view
v-if="!loading && (props.receptionRecordList == null || props.receptionRecordList.length == 0)" v-if="!loading && (props.receptionRecordList == null || props.receptionRecordList.length == 0)"
v-for="i in skeletonCardCount" v-for="i in skeletonCardCount"
:key="'reception-skeleton-' + i" :key="'reception-skeleton-' + i"
class="list-card glass-card" :class="['list-card', 'glass-card', isLandscape ? 'list-card-landscape' : '']"
> >
<un-skeleton rows="3" title loading></un-skeleton> <un-skeleton rows="3" title loading></un-skeleton>
</view> </view>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
v-else v-else
v-for="(item, idx) in props.receptionRecordList" v-for="(item, idx) in props.receptionRecordList"
:key="getStr(item, 'batchId') != '' ? getStr(item, 'batchId') + '-' + idx : 'recv-' + idx" :key="getStr(item, 'batchId') != '' ? getStr(item, 'batchId') + '-' + idx : 'recv-' + idx"
class="list-card glass-card" :class="['list-card', 'glass-card', isLandscape ? 'list-card-landscape' : '']"
@click="onCardClick(item)" @click="onCardClick(item)"
> >
<un-skeleton :rows="3" title :loading="loading"> <un-skeleton :rows="3" title :loading="loading">
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed } from 'vue' import { computed, onMounted, onUnmounted, ref } from 'vue'
const props = defineProps<{ const props = defineProps<{
/** 接待记录列表(由父级拉取并传入) */ /** 接待记录列表(由父级拉取并传入) */
...@@ -60,11 +60,51 @@ const props = defineProps<{ ...@@ -60,11 +60,51 @@ const props = defineProps<{
const loading = computed<boolean>(() => props.loading === true) const loading = computed<boolean>(() => props.loading === true)
const skeletonCardCount = 3 const skeletonCardCount = 3
/** 是否横屏(w > h)。uni-app x UTS 当前编译目标不支持 onWindowResize,使用轮询响应旋转 */
const isLandscape = ref(false)
let orientationPollId = 0
const ORIENTATION_POLL_MS = 400
function syncOrientation(): void {
const info = uni.getWindowInfo()
// 宽高优先取 systemInfo(部分机型旋转后 getWindowInfo 可能刷新不及时)
const sys = uni.getSystemInfoSync()
const sysSw = sys.screenWidth
const sysSh = sys.screenHeight
const ww = info.windowWidth
const wh = info.windowHeight
const sw = info.screenWidth
const sh = info.screenHeight
const w = sysSw > 0 ? sysSw : (sw > 0 ? sw : ww)
const h = sysSh > 0 ? sysSh : (sh > 0 ? sh : wh)
const nextLandscape = w > h
if (isLandscape.value != nextLandscape) {
isLandscape.value = nextLandscape
}
}
const emit = defineEmits<{ const emit = defineEmits<{
/** 点击卡片:父级根据 filterTabIndex 等处理详情或 toast */ /** 点击卡片:父级根据 filterTabIndex 等处理详情或 toast */
'reception-click': [item: UTSJSONObject] 'reception-click': [item: UTSJSONObject]
}>() }>()
onMounted((): void => {
syncOrientation()
orientationPollId = setInterval((): void => {
syncOrientation()
}, ORIENTATION_POLL_MS)
})
onUnmounted((): void => {
const id = orientationPollId
if (id > 0) {
clearInterval(id)
orientationPollId = 0
}
})
function getStr(data: UTSJSONObject, key: string): string { function getStr(data: UTSJSONObject, key: string): string {
const v = data[key] const v = data[key]
if (v == null) { if (v == null) {
...@@ -209,6 +249,12 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -209,6 +249,12 @@ function onCardClick(item: UTSJSONObject): void {
width: 100%; width: 100%;
} }
.reception-record-list-landscape {
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
.glass-card { .glass-card {
background-color: rgba(255, 255, 255, 0.85); background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.6);
...@@ -223,6 +269,10 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -223,6 +269,10 @@ function onCardClick(item: UTSJSONObject): void {
margin-bottom: 12px; margin-bottom: 12px;
} }
.list-card-landscape {
width: 49%;
}
.card-header-row { .card-header-row {
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
......
...@@ -143,7 +143,9 @@ const showReceptionEmpty = computed((): boolean => { ...@@ -143,7 +143,9 @@ const showReceptionEmpty = computed((): boolean => {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
width: 100%; width: 100%;
height: auto; /* scroll-view 在 APP 端需要“确定高度”才能产生滚动,从而触发 scrolltolower
横屏分栏 flex 布局下 auto 高度容易导致不滚动 */
height: 100%;
} }
.sub-tabs-row { .sub-tabs-row {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*/ */
// #ifdef APP // #ifdef APP
import { layoutService } from '@/services/LayoutService.uts' import { layoutService } from '@/services/LayoutService.uts'
import { lockOrientation } from '@/utils/plus-screen.uts' import { lockOrientation, unlockOrientation } from '@/utils/plus-screen.uts'
import { updateResolutionConfig } from '@/services/adapter/index.uts' import { updateResolutionConfig } from '@/services/adapter/index.uts'
// #endif // #endif
...@@ -36,7 +36,8 @@ export function applyScreenOrientationLock(): void { ...@@ -36,7 +36,8 @@ export function applyScreenOrientationLock(): void {
refreshTimer = 0 refreshTimer = 0
}, 800) }, 800)
} else { } else {
lockOrientation('portrait-primary') // 不再默认锁定竖屏:手机等设备交由系统/用户旋转控制
unlockOrientation()
} }
// #endif // #endif
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!