Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ff936d5b
authored
Apr 13, 2026
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/rework' of
http://192.168.3.233:8090/monorepo/venus
into feature/rework
2 parents
90e4fbbd
71e14a30
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
891 additions
and
996 deletions
apps/uniappX/uniapp-x-tape/.hbuilderx/launch.json
apps/uniappX/uniapp-x-tape/components/HomeFrame/MainTabShellLandscape.uvue
apps/uniappX/uniapp-x-tape/components/HomeFrame/MainTabShellPortrait.uvue
apps/uniappX/uniapp-x-tape/components/HomeFrame/SceneShell.uvue
apps/uniappX/uniapp-x-tape/components/HomeFrame/Tabbar.uvue
apps/uniappX/uniapp-x-tape/components/HomeFrame/TabbarLandscape.uvue
apps/uniappX/uniapp-x-tape/components/HomeFrame/TabbarPortrait.uvue
apps/uniappX/uniapp-x-tape/components/HomeFrame/index.uvue
apps/uniappX/uniapp-x-tape/components/HomeFrame/styles/common.scss
apps/uniappX/uniapp-x-tape/components/HomeFrame/styles/index.vars.uts
apps/uniappX/uniapp-x-tape/components/HomeFrame/tabbarShared.uts
apps/uniappX/uniapp-x-tape/pages.json
apps/uniappX/uniapp-x-tape/pages/receptionCenter/center.uvue
apps/uniappX/uniapp-x-tape/.hbuilderx/launch.json
View file @
ff936d5
...
...
@@ -3,7 +3,7 @@
"configurations"
:
[
{
"customPlaygroundType"
:
"local"
,
"playground"
:
"
custom
"
,
"playground"
:
"
standard
"
,
"type"
:
"uni-app:app-android"
}
]
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/MainTabShellLandscape.uvue
View file @
ff936d5
<template>
<view class="main-tab-shell-root">
<view class="main-tab-shell-body main-tab-shell-body-landscape">
<HomeFrameTabbarLandscape :adapter-class-name="adapterClassName"
:user-name="userName"
<HomeFrameTabbarLandscape :user-name="userName"
:current-tab-index="currentTabIndex"
:scene-type-list="sceneTypeList"
:show-scene-popup="showScenePopup"
...
...
@@ -22,11 +21,12 @@
</template>
<script setup lang="uts">
import { computed } from "vue";
import { computed
, inject, type Ref
} from "vue";
import HomeFrameTabbarLandscape from "./TabbarLandscape.uvue";
import type { HomeFrameTabbarSource } from "./tabbarShared.uts";
import { useHomeFrameTabbar } from "./tabbarShared.uts";
import { SCENE_SHELL_USER_INFO_INJECT_KEY, useHomeFrameTabbar } from "./tabbarShared.uts";
import { storage } from "@/utils/storage.uts";
type MainTabShellSlotProps = {
userInfo: UTSJSONObject
...
...
@@ -40,17 +40,22 @@ defineSlots<MainTabShellSlots>();
const props = defineProps<{
activeTabIndex: number
userInfo?: null | UTSJSONObject
}>();
const shellUserInfoRef = inject(SCENE_SHELL_USER_INFO_INJECT_KEY, null) as Ref<UTSJSONObject> | null;
const tabbarSource: HomeFrameTabbarSource = {
getAdapterClass: (): null | string => null,
getTabIndex: (): number => props.activeTabIndex,
getUserInfo: (): null | UTSJSONObject => props.userInfo as null | UTSJSONObject
getUserInfo: (): null | UTSJSONObject => {
const r = shellUserInfoRef;
if (r != null) {
return r.value as UTSJSONObject;
}
return storage.get("userInfo") as null | UTSJSONObject;
}
};
const _tabbar = useHomeFrameTabbar(tabbarSource);
const adapterClassName = _tabbar.adapterClassName;
const userName = _tabbar.userName;
const currentTabIndex = _tabbar.currentTabIndex;
const sceneTypeList = _tabbar.sceneTypeList;
...
...
@@ -65,8 +70,12 @@ const onChooseScene = _tabbar.onChooseScene;
const jumpPersonCenter = _tabbar.jumpPersonCenter;
const slotUserInfo = computed((): UTSJSONObject => {
const u = props.userInfo;
return u != null ? u : ({} as UTSJSONObject);
const r = shellUserInfoRef;
if (r != null) {
return r.value as UTSJSONObject;
}
const raw = storage.get("userInfo");
return raw != null ? raw as UTSJSONObject : ({} as UTSJSONObject);
});
</script>
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/MainTabShellPortrait.uvue
View file @
ff936d5
...
...
@@ -4,11 +4,7 @@
<view class="main-tab-shell-slot main-tab-shell-slot-portrait">
<slot :user-info="slotUserInfo"></slot>
</view>
<HomeFrameTabbarPortrait :adapter-class-name="adapterClassName"
:is-pad-portrait-mode="isPadPortraitMode"
:tabbar-height="tabbarHeight"
:tabbar-icon-size="tabbarIconSize"
:current-tab-index="currentTabIndex"
<HomeFrameTabbarPortrait :current-tab-index="currentTabIndex"
:scene-type-list="sceneTypeList"
:show-scene-popup="showScenePopup"
:show-setting="showSetting"
...
...
@@ -21,11 +17,12 @@
</template>
<script setup lang="uts">
import { computed } from "vue";
import { computed
, inject, type Ref
} from "vue";
import HomeFrameTabbarPortrait from "./TabbarPortrait.uvue";
import type { HomeFrameTabbarSource } from "./tabbarShared.uts";
import { useHomeFrameTabbar } from "./tabbarShared.uts";
import { SCENE_SHELL_USER_INFO_INJECT_KEY, useHomeFrameTabbar } from "./tabbarShared.uts";
import { storage } from "@/utils/storage.uts";
type MainTabShellSlotProps = {
userInfo: UTSJSONObject
...
...
@@ -39,20 +36,22 @@ defineSlots<MainTabShellSlots>();
const props = defineProps<{
activeTabIndex: number
userInfo?: null | UTSJSONObject
}>();
const shellUserInfoRef = inject(SCENE_SHELL_USER_INFO_INJECT_KEY, null) as Ref<UTSJSONObject> | null;
const tabbarSource: HomeFrameTabbarSource = {
getAdapterClass: (): null | string => null,
getTabIndex: (): number => props.activeTabIndex,
getUserInfo: (): null | UTSJSONObject => props.userInfo as null | UTSJSONObject
getUserInfo: (): null | UTSJSONObject => {
const r = shellUserInfoRef;
if (r != null) {
return r.value as UTSJSONObject;
}
return storage.get("userInfo") as null | UTSJSONObject;
}
};
const _tabbar = useHomeFrameTabbar(tabbarSource);
const adapterClassName = _tabbar.adapterClassName;
const isPadPortraitMode = _tabbar.isPadPortraitMode;
const tabbarHeight = _tabbar.tabbarHeight;
const tabbarIconSize = _tabbar.tabbarIconSize;
const currentTabIndex = _tabbar.currentTabIndex;
const sceneTypeList = _tabbar.sceneTypeList;
const showScenePopup = _tabbar.showScenePopup;
...
...
@@ -63,8 +62,12 @@ const onSettingVisible = _tabbar.onSettingVisible;
const onChooseScene = _tabbar.onChooseScene;
const slotUserInfo = computed((): UTSJSONObject => {
const u = props.userInfo;
return u != null ? u : ({} as UTSJSONObject);
const r = shellUserInfoRef;
if (r != null) {
return r.value as UTSJSONObject;
}
const raw = storage.get("userInfo");
return raw != null ? raw as UTSJSONObject : ({} as UTSJSONObject);
});
</script>
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/SceneShell.uvue
View file @
ff936d5
<template>
<!-- 物理 tab 三页共用:横/竖两套壳 + 默认槽;方向由 updateOrientation + useOrientation 驱动 -->
<MainTabShellPortrait v-if="shellIsPortrait"
:active-tab-index="props.activeTabIndex"
:user-info="userInfo">
:active-tab-index="props.activeTabIndex">
<template #default="{ userInfo: u }">
<slot :user-info="u"></slot>
</template>
</MainTabShellPortrait>
<MainTabShellLandscape v-else
:active-tab-index="props.activeTabIndex"
:user-info="userInfo">
:active-tab-index="props.activeTabIndex">
<template #default="{ userInfo: u }">
<slot :user-info="u"></slot>
</template>
...
...
@@ -17,7 +15,7 @@
</template>
<script setup lang="uts">
import { computed, defineExpose, onMounted, onResize, ref, type Ref } from "vue";
import { computed, defineExpose, onMounted, onResize,
provide,
ref, type Ref } from "vue";
import { updateOrientation, useOrientation } from "@/services/adapter/hooks/index.uts";
import { requestRecordPermission } from "@/utils/permission.uts";
...
...
@@ -26,6 +24,7 @@ import { hideNativeTabBar } from "@/utils/tabBarShell.uts";
import MainTabShellLandscape from "./MainTabShellLandscape.uvue";
import MainTabShellPortrait from "./MainTabShellPortrait.uvue";
import { SCENE_SHELL_USER_INFO_INJECT_KEY } from "./tabbarShared.uts";
type SceneShellSlotProps = {
userInfo: UTSJSONObject
...
...
@@ -51,6 +50,8 @@ const shellIsPortrait = computed((): boolean => {
});
onMounted((): void => {
requestRecordPermission();
hideNativeTabBar();
updateOrientation();
});
...
...
@@ -59,6 +60,7 @@ onResize((_res: any): void => {
});
const userInfo = ref<UTSJSONObject>({});
provide(SCENE_SHELL_USER_INFO_INJECT_KEY, userInfo);
function updateApp(): void {
const info = storage.get("userInfo");
...
...
@@ -67,12 +69,6 @@ function updateApp(): void {
}
}
onLoad((_options) => {
requestRecordPermission();
hideNativeTabBar();
updateOrientation();
});
onShow(() => {
hideNativeTabBar();
});
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/Tabbar.uvue
View file @
ff936d5
<template>
<HomeFrameTabbarLandscape v-if="!isPortraitMode"
:adapter-class-name="adapterClassName"
:user-name="userName"
:current-tab-index="currentTabIndex"
:scene-type-list="sceneTypeList"
...
...
@@ -14,10 +13,6 @@
@choose-scene="onChooseScene"
@jump-person-center="jumpPersonCenter" />
<HomeFrameTabbarPortrait v-else
:adapter-class-name="adapterClassName"
:is-pad-portrait-mode="isPadPortraitMode"
:tabbar-height="tabbarHeight"
:tabbar-icon-size="tabbarIconSize"
:current-tab-index="currentTabIndex"
:scene-type-list="sceneTypeList"
:show-scene-popup="showScenePopup"
...
...
@@ -39,7 +34,6 @@ import type { HomeFrameTabbarSource } from "./tabbarShared.uts";
import { useHomeFrameTabbar } from "./tabbarShared.uts";
const props = defineProps<{
adapterClass?: string
tabIndex?: number
userInfo?: null | UTSJSONObject
}>();
...
...
@@ -51,19 +45,11 @@ const isPortraitMode = computed((): boolean => {
});
const tabbarSource: HomeFrameTabbarSource = {
getAdapterClass: (): null | string => props.adapterClass as null | string,
getTabIndex: (): number => props.tabIndex != null ? (props.tabIndex as number) : 0,
getUserInfo: (): null | UTSJSONObject => props.userInfo as null | UTSJSONObject
};
const _tabbar = useHomeFrameTabbar(tabbarSource);
const adapterClassName = _tabbar.adapterClassName;
const isPadPortraitMode = _tabbar.isPadPortraitMode;
const tabbarHeight = _tabbar.tabbarHeight;
const tabbarIconSize = _tabbar.tabbarIconSize;
const landscapeTabbarRootStyle = _tabbar.landscapeTabbarRootStyle;
const landscapeTabbarInnerHeight = _tabbar.landscapeTabbarInnerHeight;
const landscapeTabbarIconSize = _tabbar.landscapeTabbarIconSize;
const currentTabIndex = _tabbar.currentTabIndex;
const sceneTypeList = _tabbar.sceneTypeList;
const userName = _tabbar.userName;
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/TabbarLandscape.uvue
View file @
ff936d5
<template>
<view class="home-tabbar home-tabbar-landscape"
:class="[adapterClassName]">
<image class="home-tabbar-bg-img"
<view class="home-tabbar home-tabbar-landscape">
<!-- <image class="home-tabbar-bg-img"
mode="aspectFill"
src="/static/images/home/left-bg.png" />
src="/static/images/home/left-bg.png" />
-->
<view class="hf-landscape-column">
<view class="user-box user-box-clickable hf-landscape-user"
@click="emit('jumpPersonCenter')">
<view class="hf-landscape-profile">
<un-avatar :text="avatarText"
shape="circle"
size="
5
2"
size="
4
2"
bgColor="#2f6af7"
color="#ffffff"
fontSize="20" />
...
...
@@ -33,19 +32,19 @@
</view>
</view>
</view>
<view class="home-tabbar-footer flex-col hf-landscape-footer"
>
<view class="hf-landscape-footer-btn"
@tap="emit('sceneChange')">
<image class="hf-landscape-footer-icon"
mode="aspectFit
"
src="/static/images/home/scene-change.png" />
</view
>
<view class="hf-landscape-footer-btn hf-landscape-footer-btn--after"
@tap="emit('setting')">
<image class="hf-landscape-footer-icon"
mode="aspectFit
"
src="/static/images/home/setting.png" />
</view
>
</view
>
<view class="home-tabbar-footer flex-col hf-landscape-footer">
<view class="hf-landscape-footer-btn"
@tap="emit('sceneChange')">
<image class="hf-landscape-footer-icon
"
mode="aspectFit"
src="/static/images/home/scene-change.png" /
>
</view>
<view class="hf-landscape-footer-btn hf-landscape-footer-btn--after"
@tap="emit('setting')">
<image class="hf-landscape-footer-icon
"
mode="aspectFit"
src="/static/images/home/setting.png" /
>
</view>
</view>
<CenterPopup :list="sceneTypeList"
...
...
@@ -67,7 +66,6 @@ import SettingBox from "@/pages/person/SettingBox.uvue";
import { HOME_FRAME_TABS } from "./tabbarShared.uts";
const props = defineProps<{
adapterClassName: string
userName: string
currentTabIndex: number
sceneTypeList: UTSJSONObject[]
...
...
@@ -108,16 +106,15 @@ function onTabItemClick(index: number): void {
<style scoped lang="scss">
@import "./styles/common.scss";
/*
横屏侧栏主列:顶/左右/底对称留白,子块共一条竖直中轴
*/
/*
顶部用户区:仅内容高度,不把中间 Tab 区挤没
*/
.hf-landscape-column {
flex: 1;
min-height: 0;
flex-shrink: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
padding: 14px 10px
20px
;
padding: 14px 10px
0
;
position: relative;
z-index: 1;
}
...
...
@@ -143,7 +140,7 @@ function onTabItemClick(index: number): void {
/* 与 MyCenterMain .name 一致;与 Tab 文案同宽便于视觉对齐 */
.hf-landscape-name {
margin-top: 10px;
font-size: 1
9
px;
font-size: 1
4
px;
font-weight: 600;
color: #1a2433;
line-height: 24px;
...
...
@@ -155,15 +152,6 @@ function onTabItemClick(index: number): void {
white-space: nowrap;
}
.hf-landscape-tab-wrap {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 0;
}
.hf-landscape-footer {
width: 100%;
display: flex;
...
...
@@ -171,8 +159,8 @@ function onTabItemClick(index: number): void {
align-items: center;
box-sizing: border-box;
flex-shrink: 0;
margin-top: auto
;
padding-
bottom: 0
;
padding-left: 10px
;
padding-
right: 10px
;
}
.hf-landscape-footer-btn {
...
...
@@ -194,10 +182,11 @@ function onTabItemClick(index: number): void {
flex-shrink: 0;
}
/* 横屏侧栏 Tab
区域
*/
/* 横屏侧栏 Tab
:占满中间 landscape-tabbar-wrap,条目在剩余高度内垂直居中
*/
.landscape-vertical-tabs {
flex: 1;
min-height: 0;
width: 100%;
height: var(--tabbar-height, 540px);
padding-left: var(--tabbar-padding, 16px);
padding-right: var(--tabbar-padding, 16px);
padding-top: 8px;
...
...
@@ -231,8 +220,8 @@ function onTabItemClick(index: number): void {
}
.landscape-vertical-tabs__icon {
width: var(--tabbar-icon-size
, 28px
);
height: var(--tabbar-icon-size
, 28px
);
width: var(--tabbar-icon-size);
height: var(--tabbar-icon-size);
flex-shrink: 0;
}
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/TabbarPortrait.uvue
View file @
ff936d5
<template>
<view class="home-tabbar home-tabbar-portrait"
:class="[adapterClassName, isPadPortraitMode ? 'home-tabbar-portrait-pad' : '']">
<view class="home-tabbar home-tabbar-portrait home-tabbar-portrait-pad">
<un-tabbar :model-value="currentTabIndex"
class="portrait-un-tabbar"
:fixed="true"
...
...
@@ -9,13 +8,12 @@
active-color="#3773f8"
inactive-color="#8a98b5"
bg-color="#ffffff"
:height="tabbarHeight"
@change="emit('tabChange', ($event as string | number))">
<un-tabbar-item v-for="(item, index) in tabs"
:key="index"
:name="index"
:text="item.label"
:icon-size="tabbarIconSize">
:text="item.label">
<template #icon="{ active }">
<image v-if="active === true"
class="tabbar-icon-img"
...
...
@@ -45,10 +43,6 @@ import SettingBox from "@/pages/person/SettingBox.uvue";
import { HOME_FRAME_TABS } from "./tabbarShared.uts";
defineProps<{
adapterClassName: string
isPadPortraitMode: boolean
tabbarHeight: number
tabbarIconSize: number
currentTabIndex: number
sceneTypeList: UTSJSONObject[]
showScenePopup: boolean
...
...
@@ -67,4 +61,10 @@ const tabs = HOME_FRAME_TABS;
<style scoped lang="scss">
@import "./styles/common.scss";
/* 与 layout-root 注入的 index.vars.uts 中 --tabbar-icon-size 一致;横屏侧栏见 TabbarLandscape .landscape-vertical-tabs__icon */
.tabbar-icon-img {
width: var(--tabbar-icon-size);
height: var(--tabbar-icon-size);
}
</style>
apps/uniappX/uniapp-x-tape/components/HomeFrame/index.uvue
View file @
ff936d5
...
...
@@ -65,7 +65,7 @@
</template>
<script setup lang="uts">
import { computed, defineExpose, ref } from "vue";
import { computed, defineExpose,
onMounted,
ref } from "vue";
import type { UnSwiperItem } from "@/uni_modules/uview-unix";
...
...
@@ -235,7 +235,8 @@ function onStartClick(): void {
emit("start");
}
onLoad((options) => {
onMounted((): void => {
requestRecordPermission();
});
defineExpose({
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/styles/common.scss
View file @
ff936d5
...
...
@@ -454,6 +454,7 @@
pointer-events
:
none
;
}
.hf-landscape-column
,
.user-box
,
.landscape-tabbar-wrap
,
.home-tabbar-footer
{
...
...
@@ -464,6 +465,8 @@
.home-tabbar-landscape
{
min-height
:
0
;
height
:
100%
;
align-self
:
stretch
;
}
.home-tabbar-portrait
{
...
...
@@ -577,8 +580,9 @@
min-height
:
0
;
}
/* 横屏:footer 为侧栏第三段,由父级 flex 贴底;竖屏若复用此类名再按需加 margin */
.home-tabbar-footer
{
margin-top
:
auto
;
flex-shrink
:
0
;
padding-bottom
:
40px
;
}
...
...
apps/uniappX/uniapp-x-tape/components/HomeFrame/styles/index.vars.uts
View file @
ff936d5
...
...
@@ -85,8 +85,8 @@ export default {
'--common-title-height': '54px',
'--entrance-icon-size': '64px',
'--entrance-item-gap': 'var(--l-spacing-3xl)',
'--tabbar-height': '
64
0px',
'--tabbar-icon-size': '
34
px',
'--tabbar-height': '
7
0px',
'--tabbar-icon-size': '
46
px',
'--tabbar-width': '140px',
},
...
...
@@ -126,7 +126,7 @@ export default {
'--entrance-icon-size': '64px',
'--entrance-item-gap': 'var(--l-spacing-3xl)',
'--tabbar-height': '70px',
'--tabbar-icon-size': '3
4
px',
'--tabbar-icon-size': '3
2
px',
},
}
}
apps/uniappX/uniapp-x-tape/components/HomeFrame/tabbarShared.uts
View file @
ff936d5
import { computed, ref } from "vue";
import { cssClassRef } from "@/services/adapter";
import { storage } from "@/utils/storage.uts";
import { notifyUserSceneTypeChanged } from "@/utils/userSceneEvents.uts";
import { hideNativeTabBar } from "@/utils/tabBarShell.uts";
export type HomeFrameTabbarSource = {
getAdapterClass: () => null | string
getTabIndex: () => number
getUserInfo: () => null | UTSJSONObject
}
/** SceneShell `provide`:`Ref<UTSJSONObject>`;MainTabShell `inject`,与插槽同源 */
export const SCENE_SHELL_USER_INFO_INJECT_KEY = "homeFrame.sceneShellUserInfo"
export type TabItem = {
label: string;
icon: string;
...
...
@@ -98,20 +99,6 @@ export function useHomeFrameTabbar(source: HomeFrameTabbarSource) {
const showScenePopup = ref(false);
const showSetting = ref(false);
const adapterClassName = computed((): string => {
const cls = source.getAdapterClass();
if (cls != null && cls !== "") {
return cls as string;
}
const fromRef = cssClassRef.value;
return fromRef != null ? (fromRef as string) : "";
});
const isPadPortraitMode = computed((): boolean => {
const cls = adapterClassName.value;
return cls.indexOf("layout-portrait-768x1174") >= 0;
});
const currentTabIndex = computed((): number => {
return source.getTabIndex();
});
...
...
@@ -264,8 +251,6 @@ export function useHomeFrameTabbar(source: HomeFrameTabbarSource) {
return {
showScenePopup,
showSetting,
adapterClassName,
isPadPortraitMode,
currentTabIndex,
sceneTypeList,
sceneTypeIdList,
...
...
apps/uniappX/uniapp-x-tape/pages.json
View file @
ff936d5
...
...
@@ -13,24 +13,6 @@
}
},
{
"path"
:
"pages/usedCar/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"pages/equity/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"pages/boutique/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"pages/receptionCenter/center"
,
"style"
:
{
"navigationStyle"
:
"custom"
...
...
@@ -43,12 +25,6 @@
}
},
{
"path"
:
"pages/test/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"pages/index/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
...
...
apps/uniappX/uniapp-x-tape/pages/receptionCenter/center.uvue
View file @
ff936d5
<template>
<!-- 接待中心 Tab 聚合页:与 pages/index、pages/person/myCenter 一致,SceneShell 负责 hideNativeTabBar + un-tabbar -->
<layout-root :page-vars="pageVars">
<view class="reception-shell-page" :style="receptionShellPageStyle">
<SceneShell ref="shellRef"
:active-tab-index="1">
<template #default>
<!-- <view class="test test-view">
<!-- 接待中心 Tab 聚合页:与 pages/index、pages/person/myCenter 一致,SceneShell 负责 hideNativeTabBar + un-tabbar -->
<layout-root :page-vars="pageVars">
<view class="reception-shell-page" :style="receptionShellPageStyle">
<SceneShell ref="shellRef"
:active-tab-index="1">
<template #default>
<!-- <view class="test test-view">
<text class="test-orientation-text">hooks:{{ hookOrientation }} {{ hookOrientation=='landscape'?'横屏':'竖屏'}} {{ isLandscape }}</text>
</view> -->
<view class="reception-center-page">
<!-- <un-navbar title="接待中心" left-icon="" /> -->
<!-- <view class="reception-navbar-spacer"></view> -->
<!-- Tab 切换 -->
<view v-if="isLandscape != true" class="reception-tabs-container" :style="receptionTabsContainerStyle">
<un-tabs
class="reception-main-tabs"
:style="receptionMainTabsShellStyle"
:value="mainTabIndex"
:list="mainTabs"
:height="mainTabBarHeight"
:lineWidth="mainTabLineWidth"
:lineHeight="mainTabLineHeight"
lineColor="#1677ff"
:activeStyle="mainTabActiveStyle"
:inactiveStyle="mainTabInactiveStyle"
:itemStyle="mainTabItemStyle"
@change="onMainTabChange"
></un-tabs>
</view>
<!-- Tab 内容区域 -->
<view class="reception-content-container">
<!-- 竖屏:保持原逻辑(Tabs 切换展示) -->
<view v-if="isLandscape != true" class="reception-content-portrait">
<!-- 竖屏:业绩看板内容溢出时允许上下滚动 -->
<scroll-view
v-if="mainTabIndex == 0"
class="reception-dashboard-scroll"
scroll-y="true"
show-scrollbar="false"
>
<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"
/>
</scroll-view>
<view v-if="mainTabIndex == 1" class="reception-list-wrapper">
<ReceptionCustomerListTab
:sticky-header="isLandscape"
: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="openSubmittedResultPicker"
@open-review-picker="openReviewPicker"
@switch-unsubmitted-pending-tab="switchUnsubmittedPendingTab"
@customer-entry-click="onCustomerEntryClick"
@entry-click="onListCustomerEntryClick"
@entry-edit="onListCustomerEntryEdit"
@entry-delete="onListCustomerEntryDelete"
@reception-click="onReceptionCardClick"
/>
<view class="reception-center-page">
<!-- Tab 切换 -->
<view v-if="isLandscape != true"
class="reception-tabs-container"
:style="receptionTabsContainerStyle">
<un-tabs :active-style="mainTabActiveStyle"
class="reception-main-tabs"
:height="mainTabBarHeight"
:inactive-style="mainTabInactiveStyle"
:item-style="mainTabItemStyle"
line-color="#1677ff"
:line-height="mainTabLineHeight"
:line-width="mainTabLineWidth"
:list="mainTabs"
:style="receptionMainTabsShellStyle"
:value="mainTabIndex"
@change="onMainTabChange">
</un-tabs>
</view>
<!-- Tab 内容区域 -->
<view class="reception-content-container">
<!-- 竖屏:保持原逻辑(Tabs 切换展示) -->
<view v-if="isLandscape != true" class="reception-content-portrait">
<!-- 竖屏:业绩看板内容溢出时允许上下滚动 -->
<scroll-view v-if="mainTabIndex == 0"
class="reception-dashboard-scroll"
scroll-y="true"
show-scrollbar="false">
<ReceptionDashboardTab :achievement-value-text="monthValueAchievementText"
:compare-rows="currentOutputTab.compareRows"
:output-tab-index="outputTabIndex"
:performance-data="performanceData"
:performance-metrics-visible="performanceMetricsVisible"
:selected-brand="selectedBrand"
:summary="currentOutputTab.summary"
:target-value-text="monthValueTargetText"
:time-progress-percent="timeProgressPercent"
@open-brand-picker="show = true"
@toggle-metrics="togglePerformanceMetricsVisibility"
@update:output-tab-index="onOutputTabIndexChange" />
</scroll-view>
<view v-if="mainTabIndex == 1" class="reception-list-wrapper">
<ReceptionCustomerListTab :customer-list="customerList"
:customer-list-has-more="customerListHasMore"
:customer-list-loading-more="customerListLoadingMore"
:entry-filter-index="entryFilterIndex"
:filter-tab-index="filterTabIndex"
:list-sub-tab-index="listSubTabIndex"
:reception-filter-narrow-mode="receptionFilterNarrowMode"
:reception-list-has-more="receptionListHasMore"
:reception-list-loading-more="receptionListLoadingMore"
:reception-record-list="receptionRecordList"
:review-tab-index="reviewTabIndex"
:sticky-header="isLandscape"
:submitted-result-tab-index="submittedResultTabIndex"
:unsubmitted-pending-tab-index="unsubmittedPendingTabIndex"
@customer-entry-click="onCustomerEntryClick"
@entry-click="onListCustomerEntryClick"
@entry-delete="onListCustomerEntryDelete"
@entry-edit="onListCustomerEntryEdit"
@open-review-picker="openReviewPicker"
@open-submitted-result-picker="openSubmittedResultPicker"
@reception-click="onReceptionCardClick"
@scroll-lower="onListScrollToLower"
@switch-entry-filter-tab="switchEntryFilterTab"
@switch-filter-tab="switchFilterTab"
@switch-list-sub-tab="switchListSubTab"
@switch-unsubmitted-pending-tab="switchUnsubmittedPendingTab" />
</view>
</view>
<!-- 横屏:隐藏 Tabs,左右分栏同时展示(左 1/3 业绩看板,右 2/3 客户列表) -->
<view v-else class="reception-content-landscape">
<view class="reception-landscape-left">
<ReceptionDashboardTab :achievement-value-text="monthValueAchievementText"
:compare-rows="currentOutputTab.compareRows"
:output-tab-index="outputTabIndex"
:performance-data="performanceData"
:performance-metrics-visible="performanceMetricsVisible"
:selected-brand="selectedBrand"
:summary="currentOutputTab.summary"
:target-value-text="monthValueTargetText"
:time-progress-percent="timeProgressPercent"
@open-brand-picker="show = true"
@toggle-metrics="togglePerformanceMetricsVisibility"
@update:output-tab-index="onOutputTabIndexChange" />
</view>
<view class="reception-landscape-right">
<ReceptionCustomerListTab :customer-list="customerList"
:customer-list-has-more="customerListHasMore"
:customer-list-loading-more="customerListLoadingMore"
:entry-filter-index="entryFilterIndex"
:filter-tab-index="filterTabIndex"
:list-sub-tab-index="listSubTabIndex"
:reception-filter-narrow-mode="receptionFilterNarrowMode"
:reception-list-has-more="receptionListHasMore"
:reception-list-loading-more="receptionListLoadingMore"
:reception-record-list="receptionRecordList"
:review-tab-index="reviewTabIndex"
:sticky-header="isLandscape"
:submitted-result-tab-index="submittedResultTabIndex"
:unsubmitted-pending-tab-index="unsubmittedPendingTabIndex"
@customer-entry-click="onCustomerEntryClick"
@entry-click="onListCustomerEntryClick"
@entry-delete="onListCustomerEntryDelete"
@entry-edit="onListCustomerEntryEdit"
@open-review-picker="openReviewPicker"
@open-submitted-result-picker="openSubmittedResultPicker"
@reception-click="onReceptionCardClick"
@scroll-lower="onListScrollToLower"
@switch-entry-filter-tab="switchEntryFilterTab"
@switch-filter-tab="switchFilterTab"
@switch-list-sub-tab="switchListSubTab"
@switch-unsubmitted-pending-tab="switchUnsubmittedPendingTab" />
</view>
</view>
</view>
<!-- 全局弹窗 -->
<un-picker :columns="columns"
:show="show"
@cancel="onClose"
@close="onClose"
@confirm="onConfirm" />
<un-picker :key="submittedResultPickerLayerKey"
:columns="submittedResultPickerColumns"
:default-index="submittedResultPickerDefaultIndex"
:show="showSubmittedResultPicker"
@cancel="onSubmittedResultPickerClose"
@close="onSubmittedResultPickerClose"
@confirm="onSubmittedResultPickerConfirm" />
<un-picker :key="reviewPickerLayerKey"
:columns="reviewPickerColumns"
:default-index="reviewPickerDefaultIndex"
:show="showReviewPicker"
@cancel="onReviewPickerClose"
@close="onReviewPickerClose"
@confirm="onReviewPickerConfirm" />
<!-- 客户录入列表 → 客户档案(FormDetail) -->
<view v-if="showCustomerFormDetail" class="form-detail-inner">
<FormDetail :detail="customerFormDetailItem"
:show="showCustomerFormDetail"
@close="onCustomerFormDetailClose" />
</view>
<!-- 接待复盘列表 → 接待详情(receptionDetail) -->
<view v-if="showReceptionRecordDetail" class="form-detail-inner">
<ReceptionDetail :item="receptionRecordItem" @close="onReceptionRecordDetailClose" />
</view>
</view>
</template>
</SceneShell>
</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
:sticky-header="isLandscape"
: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="openSubmittedResultPicker"
@open-review-picker="openReviewPicker"
@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
:key="submittedResultPickerLayerKey"
:show="showSubmittedResultPicker"
:columns="submittedResultPickerColumns"
:default-index="submittedResultPickerDefaultIndex"
@close="onSubmittedResultPickerClose"
@cancel="onSubmittedResultPickerClose"
@confirm="onSubmittedResultPickerConfirm"
/>
<un-picker
:key="reviewPickerLayerKey"
:show="showReviewPicker"
:columns="reviewPickerColumns"
:default-index="reviewPickerDefaultIndex"
@close="onReviewPickerClose"
@cancel="onReviewPickerClose"
@confirm="onReviewPickerConfirm"
/>
<!-- 客户录入列表 → 客户档案(FormDetail) -->
<view v-if="showCustomerFormDetail" class="form-detail-inner">
<FormDetail
:show="showCustomerFormDetail"
:detail="customerFormDetailItem"
@close="onCustomerFormDetailClose"
/>
</view>
<!-- 接待复盘列表 → 接待详情(receptionDetail) -->
<view v-if="showReceptionRecordDetail" class="form-detail-inner">
<ReceptionDetail :item="receptionRecordItem" @close="onReceptionRecordDetailClose" />
</view>
</view>
</template>
</SceneShell>
</view>
</layout-root>
</layout-root>
</template>
<script setup lang="uts">
// 接待中心 Tab 聚合页
import { ref, computed, onMounted, onUnmounted, watch, onResize, type Ref, type ComponentPublicInstance } from 'vue'
import SceneShell from '@/components/HomeFrame/SceneShell.uvue'
import { type UnPickerColumn, type UnPickerColumnItem, type UnPickerConfirmEvent, type UnTabItem } from '@/uni_modules/uview-unix'
import FormDetail from './forms/FormDetail.uvue'
import ReceptionDetail from './receptionDetail.uvue'
import ReceptionDashboardTab from './tabs/ReceptionDashboardTab.uvue'
import ReceptionCustomerListTab from './tabs/ReceptionCustomerListTab.uvue'
import type { CompareRow, OutputSummary } from './types/reception-output-types.uts'
import { getStr, getNum, getTs, getCurrentMonthRange, getTodayDayRangeStrings, getMockPerformanceData, isPerformanceDataEmpty, resolveHasMore, mergeByKey } from './types/reception-center-helpers.uts'
import { getMerchantPerformance, getCustomerFileList, getReceptionList } from '@/api/receiption.uts'
import { storage } from '@/utils/storage.uts'
import { resolutionState } from '@/services/adapter/index.uts'
import { type ComponentPublicInstance, type Ref, computed, onMounted, onResize, onUnmounted, ref, watch } from "vue";
import { type UnPickerColumn, type UnPickerColumnItem, type UnPickerConfirmEvent, type UnTabItem } from "@/uni_modules/uview-unix";
import { getCustomerFileList, getMerchantPerformance, getReceptionList } from "@/api/receiption.uts";
import SceneShell from "@/components/HomeFrame/SceneShell.uvue";
import { cssClassRef } from "@/services/adapter";
import { updateOrientation, useOrientation } from '@/services/adapter/hooks/index.uts'
// 导入样式变量
import {
getPortraitConfig,
getReceptionPortraitMainTabsConfig,
type ReceptionPortraitMainTabsConfig
} from "./styles/portrait.uts";
import pageVars from './styles/index.vars'
const shellRef = ref(null)
import { updateOrientation, useOrientation } from "@/services/adapter/hooks/index.uts";
import { storage } from "@/utils/storage.uts";
import FormDetail from "./forms/FormDetail.uvue";
import ReceptionDetail from "./receptionDetail.uvue";
import pageVars from "./styles/index.vars";
import { getReceptionPortraitMainTabsConfig, type ReceptionPortraitMainTabsConfig } from "./styles/portrait.uts";
import ReceptionCustomerListTab from "./tabs/ReceptionCustomerListTab.uvue";
import ReceptionDashboardTab from "./tabs/ReceptionDashboardTab.uvue";
import { getCurrentMonthRange, getMockPerformanceData, getNum, getStr, getTodayDayRangeStrings, mergeByKey, resolveHasMore } from "./types/reception-center-helpers.uts";
import type { CompareRow, OutputSummary } from "./types/reception-output-types.uts";
const shellRef = ref(null);
onShow(() => {
// 页面每次「显示」时,让外壳组件从本地缓存里刷新用户信息。
if (shellRef.value != null) {
(shellRef.value as ComponentPublicInstance).$callMethod(
'updateApp')
(shellRef.value as ComponentPublicInstance).$callMethod(
"updateApp");
}
})
});
const isPortrait768x1174 = computed((): boolean => {
// 仅在 768x1174 分辨率(竖屏适配类名)下展示顶部安全区占位
return cssClassRef.value.indexOf('layout-portrait-768x1174') >= 0
})
/** useOrientation 全局状态,配合 updateOrientation 在 onMounted / onResize 刷新后展示 */
const receptionOrientationHook = useOrientation()
// 仅在 768x1174 分辨率(竖屏适配类名)下展示顶部安全区占位
return cssClassRef.value.indexOf("layout-portrait-768x1174") >= 0;
});
const receptionOrientationHook = useOrientation();
const hookOrientation = computed((): string => {
return (receptionOrientationHook.orientationKey as Ref<string>).value
})
return (receptionOrientationHook.orientationKey as Ref<string>).value;
});
/**
* 固定页面可用高度,避免出现“整页上下滑 + 内部列表滚动”的双滚动/溢出问题。
* 说明:
...
...
@@ -232,138 +206,119 @@ const hookOrientation = computed((): string => {
* - 内容区继续用 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
})
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:0=业绩看板,1=客户列表 */
const mainTabIndex = ref(0)
const mainTabIndex = ref(0)
;
const mainTabs: UnTabItem[] = [
{ name: '业绩看板' } as UnTabItem,
{ name: '客户列表' } as UnTabItem
]
// 动态样式 - 根据分辨率返回不同的样式
// 动态样式 - 根据分辨率返回不同的样式
const dynamicModuleBoxStyle = computed((): any => {
// 使用 cssClassRef.value 确保响应式
const adapterCls = cssClassRef.value;
if (adapterCls.indexOf('layout-portrait-768x1174') >= 0) {
const cfg = getPortraitConfig(adapterCls)
return cfg != null ? ({ ...cfg } as UTSJSONObject) : ({} as UTSJSONObject);
}
// computed 返回值不能为 null(UTS 中 Any? -> Any 会触发类型不匹配)
return {} as UTSJSONObject;
});
{ name: "业绩看板" } as UnTabItem,
{ name: "客户列表" } as UnTabItem
];
/** 仅 layout-portrait-768x1174 有值;其它分辨率为 null,主 Tab 保持模板 + scss 原样式 */
const receptionPortraitMainTabsOverride = computed((): null | ReceptionPortraitMainTabsConfig => {
return getReceptionPortraitMainTabsConfig(cssClassRef.value)
})
return getReceptionPortraitMainTabsConfig(cssClassRef.value);
})
;
const receptionTabsContainerStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {} as UTSJSONObject
}
return {
padding: c.containerPadding,
// 仅 768x1174 竖屏需要额外顶距,其它分辨率强制为 0(避免顶部出现多余空隙)
marginTop: '30px',
} as UTSJSONObject
})
const c = receptionPortraitMainTabsOverride.value;
if (c == null) {
return {} as UTSJSONObject;
}
return {
padding: c.containerPadding,
marginTop: "30px",
} as UTSJSONObject;
});
const receptionMainTabsShellStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {} as UTSJSONObject
}
return {
padding: c.mainTabsPadding,
borderRadius: c.mainTabsBorderRadius,
boxShadow: c.mainTabsBoxShadow
} as UTSJSONObject
})
const c = receptionPortraitMainTabsOverride.value;
if (c == null) {
return {} as UTSJSONObject;
}
return {
padding: c.mainTabsPadding,
borderRadius: c.mainTabsBorderRadius,
boxShadow: c.mainTabsBoxShadow
} as UTSJSONObject;
})
;
const mainTabBarHeight = computed((): number => {
const c = receptionPortraitMainTabsOverride.value
return c != null ? c.height : 52
})
const c = receptionPortraitMainTabsOverride.value;
return c != null ? c.height : 52;
})
;
const mainTabLineWidth = computed((): number => {
const c = receptionPortraitMainTabsOverride.value
return c != null ? c.lineWidth : 42
})
const c = receptionPortraitMainTabsOverride.value;
return c != null ? c.lineWidth : 42;
})
;
const mainTabLineHeight = computed((): number => {
const c = receptionPortraitMainTabsOverride.value
return c != null ? c.lineHeight : 4
})
const c = receptionPortraitMainTabsOverride.value;
return c != null ? c.lineHeight : 4;
})
;
const mainTabActiveStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {
color: '#1677ff'
,
fontWeight: 700,
fontSize: '17px'
} as UTSJSONObject
}
return {
color: '#1677ff'
,
fontWeight: 700,
fontSize: c.activeFontSize
} as UTSJSONObject
})
const c = receptionPortraitMainTabsOverride.value;
if (c == null) {
return {
color: "#1677ff"
,
fontWeight: 700,
fontSize: "17px"
} as UTSJSONObject;
}
return {
color: "#1677ff"
,
fontWeight: 700,
fontSize: c.activeFontSize
} as UTSJSONObject;
})
;
const mainTabInactiveStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {
color: '#94a3b8'
,
fontWeight: 500,
fontSize: '15px'
} as UTSJSONObject
}
return {
color: '#94a3b8'
,
fontWeight: 400,
fontSize: c.inactiveFontSize
} as UTSJSONObject
})
const c = receptionPortraitMainTabsOverride.value;
if (c == null) {
return {
color: "#94a3b8"
,
fontWeight: 500,
fontSize: "15px"
} as UTSJSONObject;
}
return {
color: "#94a3b8"
,
fontWeight: 400,
fontSize: c.inactiveFontSize
} as UTSJSONObject;
})
;
const mainTabItemStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {
paddingLeft: '18px'
,
paddingRight: '18px'
} as UTSJSONObject
}
return {
paddingLeft: c.itemPaddingLeft,
paddingRight: c.itemPaddingRight,
paddingBottom: c.itemPaddingBottom
} as UTSJSONObject
})
const c = receptionPortraitMainTabsOverride.value;
if (c == null) {
return {
paddingLeft: "18px"
,
paddingRight: "18px"
} as UTSJSONObject;
}
return {
paddingLeft: c.itemPaddingLeft,
paddingRight: c.itemPaddingRight,
paddingBottom: c.itemPaddingBottom
} as UTSJSONObject;
})
;
/** 客户列表下的二级 Tab:0=客户录入,1=接待复盘(原 rightTabIndex) */
const listSubTabIndex = ref(0)
const listSubTabIndex = ref(0)
;
// 产值卡片 tabs:0=本月交付转化率,1=本月交付客单价
const outputTabIndex = ref(0);
...
...
@@ -378,7 +333,7 @@ const entryFilterIndex = ref(0);
const submittedResultTabIndex = ref(0);
// 未提交下子 tabs:0=待上传,1=待提交(当前与列表参数同样映射到 orderFinishFlag,若后端字段不同再拆参)
const unsubmittedPendingTabIndex = ref(0);
const reviewTabIndex = ref(0)
const reviewTabIndex = ref(0)
;
// Tab 数据结构
type OutputTabData = {
...
...
@@ -387,143 +342,143 @@ type OutputTabData = {
}
// 业绩数据(需在使用前声明,UTS 不支持变量提升)
const performanceData = ref<UTSJSONObject>({})
const performanceData = ref<UTSJSONObject>({})
;
// 时间进度:按「当月日期 / 当月天数」换算为百分比
const timeProgress = ref<number>(0)
const timeProgress = ref<number>(0)
;
function setTimeProgress(): void {
// e.g. 2026-03-30 => 30 / 31 => 97%
const now = new Date()
const nowNum = now.getDate()
// 通过“下个月第 0 天”拿到“本月最后一天”,从而得到当月天数
const monthDayNum = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate()
timeProgress.value = monthDayNum > 0 ? Math.round(nowNum / monthDayNum * 100) : 0
// e.g. 2026-03-30 => 30 / 31 => 97%
const now = new Date();
const nowNum = now.getDate();
// 通过“下个月第 0 天”拿到“本月最后一天”,从而得到当月天数
const monthDayNum = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate();
timeProgress.value = monthDayNum > 0 ? Math.round(nowNum / monthDayNum * 100) : 0;
}
// 页面首次渲染也要有值(避免首帧出现 0% 闪烁)
setTimeProgress()
setTimeProgress()
;
const timeProgressPercent = computed((): number => {
// 防御性 clamp:确保 width 与文本不会出现异常值
if (timeProgress.value < 0) { return 0
}
if (timeProgress.value > 100) { return 100
}
return timeProgress.value
})
// 防御性 clamp:确保 width 与文本不会出现异常值
if (timeProgress.value < 0) { return 0;
}
if (timeProgress.value > 100) { return 100;
}
return timeProgress.value;
})
;
// 当前 tab 数据:由 outputTabIndex 与 performanceData 驱动
// Tab0=本月交付转化率:展示率(excellentStoreAvgDealRate/thisStoreDealRate/personalDealRate)
// Tab1=本月交付客单价:展示额(excellentStoreAvgDeal/thisStoreKdj/personalKdj)
const currentOutputTab = computed((): OutputTabData => {
const d = performanceData.value
const idx = outputTabIndex.value
// 转化率:当前值即百分比(0-100),宽度 = 当前值/100 换算为百分比展示,即 value%
const toRatePct = (x: number): string => Math.min(100, x).toFixed(1) + '%'
const tab0: OutputTabData = {
compareRows: [
{ label: '优秀门店均值', barWidthPercent: toRatePct(getNum(d, 'excellentStoreAvgDealRate')), barClass: 'bg-blue-500', value: getNum(d, 'excellentStoreAvgDealRate').toFixed(1) + '%'
},
{ label: '本门店', barWidthPercent: toRatePct(getNum(d, 'thisStoreDealRate')), barClass: 'bg-blue-400', value: getNum(d, 'thisStoreDealRate').toFixed(1) + '%'
},
{ label: '个人', barWidthPercent: toRatePct(getNum(d, 'personalDealRate')), barClass: 'bg-blue-400', value: getNum(d, 'personalDealRate').toFixed(1) + '%'
}
],
summary: {
summaryLabel: '实际产值'
,
summaryValueNum: getNum(d, 'actualProduction'
).toFixed(1),
summaryValueUnit: '万'
,
personalLabel: '个人产值'
,
personalValue: getNum(d, 'personalProduction').toFixed(1) + '万'
,
ringPercent: getNum(d, 'achievementRatio').toFixed(1) + '%'
,
ringLabel: '达成率'
,
ringPercentNum: Math.min(100, getNum(d, 'achievementRatio'
)),
ringComparePercent: 100
}
}
const eAvg = getNum(d, 'excellentStoreAvgDeal')
const thisVal = getNum(d, 'thisStoreKdj')
const perVal = getNum(d, 'personalKdj')
// 客单价:以最大值为100%基准,当前值/最大值*100 换算展示
const maxDeal = eAvg > thisVal ? (eAvg > perVal ? eAvg : perVal) : (thisVal > perVal ? thisVal : perVal)
const toDealPct = (x: number): string => (maxDeal > 0 ? (x / maxDeal * 100) : 0).toFixed(1) + '%'
const tab1: OutputTabData = {
compareRows: [
{ label: '优秀门店均值', barWidthPercent: toDealPct(eAvg), barClass: 'bg-blue-500', value: '¥' + Math.round(eAvg)
},
{ label: '本门店', barWidthPercent: toDealPct(thisVal), barClass: 'bg-blue-400', value: '¥' + Math.round(thisVal)
},
{ label: '个人', barWidthPercent: toDealPct(perVal), barClass: 'bg-blue-400', value: '¥' + Math.round(perVal)
}
],
summary: {
summaryLabel: '实际产值'
,
summaryValueNum: getNum(d, 'actualProduction'
).toFixed(1),
summaryValueUnit: '万'
,
personalLabel: '个人产值'
,
personalValue: getNum(d, 'personalProduction').toFixed(1) + '万'
,
ringPercent: getNum(d, 'achievementRatio').toFixed(1) + '%'
,
ringLabel: '达成率'
,
ringPercentNum: Math.min(100, getNum(d, 'achievementRatio'
)),
ringComparePercent: 100
}
}
if (idx == 1) { return tab1
}
return tab0
})
const d = performanceData.value;
const idx = outputTabIndex.value;
// 转化率:当前值即百分比(0-100),宽度 = 当前值/100 换算为百分比展示,即 value%
const toRatePct = (x: number): string => `${Math.min(100, x).toFixed(1) }%`;
const tab0: OutputTabData = {
compareRows: [
{ label: "优秀门店均值", barWidthPercent: toRatePct(getNum(d, "excellentStoreAvgDealRate")), barClass: "bg-blue-500", value: `${getNum(d, "excellentStoreAvgDealRate").toFixed(1) }%`
},
{ label: "本门店", barWidthPercent: toRatePct(getNum(d, "thisStoreDealRate")), barClass: "bg-blue-400", value: `${getNum(d, "thisStoreDealRate").toFixed(1) }%`
},
{ label: "个人", barWidthPercent: toRatePct(getNum(d, "personalDealRate")), barClass: "bg-blue-400", value: `${getNum(d, "personalDealRate").toFixed(1) }%`
}
],
summary: {
summaryLabel: "实际产值"
,
summaryValueNum: getNum(d, "actualProduction"
).toFixed(1),
summaryValueUnit: "万"
,
personalLabel: "个人产值"
,
personalValue: `${getNum(d, "personalProduction").toFixed(1) }万`
,
ringPercent: `${getNum(d, "achievementRatio").toFixed(1) }%`
,
ringLabel: "达成率"
,
ringPercentNum: Math.min(100, getNum(d, "achievementRatio"
)),
ringComparePercent: 100
}
};
const eAvg = getNum(d, "excellentStoreAvgDeal");
const thisVal = getNum(d, "thisStoreKdj");
const perVal = getNum(d, "personalKdj");
// 客单价:以最大值为100%基准,当前值/最大值*100 换算展示
const maxDeal = eAvg > thisVal ? (Math.max(eAvg, perVal)) : (Math.max(thisVal, perVal));
const toDealPct = (x: number): string => `${(maxDeal > 0 ? (x / maxDeal * 100) : 0).toFixed(1) }%`;
const tab1: OutputTabData = {
compareRows: [
{ label: "优秀门店均值", barWidthPercent: toDealPct(eAvg), barClass: "bg-blue-500", value: `¥${ Math.round(eAvg)}`
},
{ label: "本门店", barWidthPercent: toDealPct(thisVal), barClass: "bg-blue-400", value: `¥${ Math.round(thisVal)}`
},
{ label: "个人", barWidthPercent: toDealPct(perVal), barClass: "bg-blue-400", value: `¥${ Math.round(perVal)}`
}
],
summary: {
summaryLabel: "实际产值"
,
summaryValueNum: getNum(d, "actualProduction"
).toFixed(1),
summaryValueUnit: "万"
,
personalLabel: "个人产值"
,
personalValue: `${getNum(d, "personalProduction").toFixed(1) }万`
,
ringPercent: `${getNum(d, "achievementRatio").toFixed(1) }%`
,
ringLabel: "达成率"
,
ringPercentNum: Math.min(100, getNum(d, "achievementRatio"
)),
ringComparePercent: 100
}
};
if (idx == 1) { return tab1;
}
return tab0;
})
;
/** 本月产值卡片底部:目标产值展示(有接口字段则用数据,否则保留占位) */
const monthValueTargetText = computed((): string => {
const d = performanceData.value
const v = getNum(d, 'targetProduction')
if (v > 0) {
return v.toFixed(0) + '万'
}
return '-'
})
const d = performanceData.value;
const v = getNum(d, "targetProduction");
if (v > 0) {
return `${v.toFixed(0) }万`;
}
return "-";
})
;
/** 本月产值卡片底部:达成比例(有接口字段则用数据,否则保留占位) */
const monthValueAchievementText = computed((): string => {
const d = performanceData.value
const v = getNum(d, 'productionContribution')
if (v > 0) {
return v.toFixed(0) + '%'
}
return '-'
})
const d = performanceData.value;
const v = getNum(d, "productionContribution");
if (v > 0) {
return `${v.toFixed(0) }%`;
}
return "-";
})
;
// 客户档案列表(客户录入 Tab,接口 dj.api.smartcarlife.customervisits.customerInfoPage)
const customerList = ref<UTSJSONObject[]>([])
const customerList = ref<UTSJSONObject[]>([])
;
// 接待复盘列表(接待复盘 Tab,接口 dj.api.smartcarlife.reception.customer.page)
const receptionRecordList = ref<UTSJSONObject[]>([])
const receptionRecordList = ref<UTSJSONObject[]>([])
;
/** 客户档案分页(customerInfoPage) */
const CUSTOMER_FILE_PAGE_SIZE = 10
const customerFilePageNum = ref(1)
const CUSTOMER_FILE_PAGE_SIZE = 10
;
const customerFilePageNum = ref(1)
;
/** 客户录入列表:触底加载更多 */
const customerListLoadingMore = ref(false)
const customerListHasMore = ref(true)
const customerListLoadingMore = ref(false)
;
const customerListHasMore = ref(true)
;
/** 接待复盘分页(reception.customer.page) */
const RECEPTION_PAGE_SIZE = 10
const receptionPageNum = ref(1)
const receptionListLoadingMore = ref(false)
const receptionListHasMore = ref(true)
const show = ref(false)
const RECEPTION_PAGE_SIZE = 10
;
const receptionPageNum = ref(1)
;
const receptionListLoadingMore = ref(false)
;
const receptionListHasMore = ref(true)
;
const show = ref(false)
;
/** 已提交:战败/成交下拉 */
const showSubmittedResultPicker = ref(false)
const showSubmittedResultPicker = ref(false)
;
/** 每次打开战败/成交选择器递增,保证 default-index 作用到滚轮 */
const submittedResultPickerLayerKey = ref(0)
const submittedResultPickerLayerKey = ref(0)
;
/** 已提交:未复盘/复盘下拉 */
const showReviewPicker = ref(false)
const showReviewPicker = ref(false)
;
/** 每次打开复盘选择器递增,保证 default-index 一定作用到滚轮(避免仅首次挂载生效) */
const reviewPickerLayerKey = ref(0)
const reviewPickerLayerKey = ref(0)
;
/** 右侧筛选区窄屏适配:避免 segmented 最小宽度导致横向溢出 */
const receptionFilterNarrowMode = ref(false)
const receptionFilterNarrowMode = ref(false)
;
/** uni-app x UTS 当前编译目标不支持 uni.onWindowResize,用定时轮询窗口尺寸以响应旋转 */
let receptionDashboardLayoutPollId: number | null = null
const RECEPTION_LAYOUT_POLL_MS = 400
const receptionDashboardLayoutPollId: null | number = null;
const RECEPTION_LAYOUT_POLL_MS = 400
;
/** 是否横屏:与 orientationKey / hookOrientation 同源(useOrientation 的 isPortrait),保持 computed 随 updateOrientation 更新 */
const isLandscape = computed((): boolean => {
return (receptionOrientationHook.isPortrait as Ref<boolean>).value != true
})
return (receptionOrientationHook.isPortrait as Ref<boolean>).value != true;
})
;
/** 记录上一次打印过的方向,避免轮询期间刷屏 */
let lastOrientationLogLandscape: boolean | null = null
let lastOrientationLogLandscape: boolean | null = null
;
function syncReceptionDashboardLayout(): void {
/**
/**
* 接待中心「布局同步」:
* - 横竖屏 UI 由 useOrientation(isPortrait / orientationKey)与 isLandscape(computed)驱动,须先刷新全局方向再读 isLandscape
* - 横屏窄宽时启用筛选区窄模式,避免 segmented 等控件最小宽度导致溢出
...
...
@@ -532,355 +487,351 @@ function syncReceptionDashboardLayout(): void {
* - uni-app x(尤其 APP 端)对 onWindowResize 支持不稳定,因此通过定时轮询触发同步
* - 部分机型旋转后 getWindowInfo 的 windowWidth/windowHeight 刷新可能滞后,这里优先用 systemInfo 的 screenWidth/screenHeight 做兜底
*/
updateOrientation()
// 必须用 uni.getWindowInfo():uview-unix 的 getWindowInfo 在 Android 上返回 GetWindowInfoResult,不能 as UTSJSONObject
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
// 横屏判定:宽 > 高。取值优先级:systemInfo.screen* -> windowInfo.screen* -> windowInfo.window*
const w = sysSw > 0 ? sysSw : (sw > 0 ? sw : ww)
const h = sysSh > 0 ? sysSh : (sh > 0 ? sh : wh)
if (lastOrientationLogLandscape == null || lastOrientationLogLandscape != isLandscape.value) {
lastOrientationLogLandscape = isLandscape.value
console.log(
`[ReceptionCenter] 屏幕方向变化:${isLandscape.value ? '横屏' : '竖屏'
}(w=${w}, h=${h}, window=${ww}x${wh}, screen=${sw}x${sh})`
)
}
console.log('[ReceptionCenter] syncReceptionDashboardLayout'
);
updateOrientation();
// 必须用 uni.getWindowInfo():uview-unix 的 getWindowInfo 在 Android 上返回 GetWindowInfoResult,不能 as UTSJSONObject
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;
// 横屏判定:宽 > 高。取值优先级:systemInfo.screen* -> windowInfo.screen* -> windowInfo.window*
const w = sysSw > 0 ? sysSw : (sw > 0 ? sw : ww);
const h = sysSh > 0 ? sysSh : (sh > 0 ? sh : wh);
if (lastOrientationLogLandscape == null || lastOrientationLogLandscape != isLandscape.value) {
lastOrientationLogLandscape = isLandscape.value;
console.log(
`[ReceptionCenter] 屏幕方向变化:${isLandscape.value ? "横屏" : "竖屏"
}(w=${w}, h=${h}, window=${ww}x${wh}, screen=${sw}x${sh})`
);
}
console.log("[ReceptionCenter] syncReceptionDashboardLayout"
);
// 横屏窄宽适配:避免右侧筛选区控件(如 segmented)在小于阈值时出现横向溢出
const RECEPTION_FILTER_NARROW_WIDTH = 920
const nextFilterNarrowMode = isLandscape.value && w > 0 && w < RECEPTION_FILTER_NARROW_WIDTH
if (receptionFilterNarrowMode.value != nextFilterNarrowMode) {
receptionFilterNarrowMode.value = nextFilterNarrowMode
}
// 横屏窄宽适配:避免右侧筛选区控件(如 segmented)在小于阈值时出现横向溢出
const RECEPTION_FILTER_NARROW_WIDTH = 920;
const nextFilterNarrowMode = isLandscape.value && w > 0 && w < RECEPTION_FILTER_NARROW_WIDTH;
if (receptionFilterNarrowMode.value != nextFilterNarrowMode) {
receptionFilterNarrowMode.value = nextFilterNarrowMode;
}
}
let getPerformanceDataImpl: () => Promise<void> = async (): Promise<void> => {}
let getCustomerListImpl: (append: boolean) => Promise<void> = async (_append: boolean): Promise<void> => {}
let getReceptionRecordListImpl: (append: boolean) => Promise<void> = async (_append: boolean): Promise<void> => {}
let getPerformanceDataImpl: () => Promise<void> = async (): Promise<void> => {}
;
let getCustomerListImpl: (append: boolean) => Promise<void> = async (_append: boolean): Promise<void> => {}
;
let getReceptionRecordListImpl: (append: boolean) => Promise<void> = async (_append: boolean): Promise<void> => {}
;
// onResize 回调可能在窗口尺寸变化过程中高频触发,这里做一次去重,避免控制台刷屏
let lastOnResizeWidth: nu
mber | null = null
let lastOnResizeHeight: nu
mber | null = null
let lastOnResizeWidth: nu
ll | number = null;
let lastOnResizeHeight: nu
ll | number = null;
onResize((res: any) => {
// 1) 直接打印回调参数(满足“打印返回参数”的需求)
console.log('[ReceptionCenter][onResize] res =', res)
// 2) 尝试从回调中提取 width/height 做去重(字段结构在不同端可能不同,必须防御性处理)
let w: number | null = null
let h: number | null = null
const obj = res as UTSJSONObject
const sizeRaw = obj['size']
if (sizeRaw != null) {
const sizeObj = sizeRaw as UTSJSONObject
const ww = sizeObj['windowWidth']
const wh = sizeObj['windowHeight']
if (typeof ww === 'number') { w = ww }
if (typeof wh === 'number') { h = wh }
} else {
const ww = obj['windowWidth']
const wh = obj['windowHeight']
if (typeof ww === 'number') { w = ww }
if (typeof wh === 'number') { h = wh }
}
if (w != null && h != null) {
if (lastOnResizeWidth != w || lastOnResizeHeight != h) {
lastOnResizeWidth = w
lastOnResizeHeight = h
console.log(`[ReceptionCenter][onResize] size = ${w}x${h}`)
}
}
updateOrientation()
syncReceptionDashboardLayout()
})
// 1) 直接打印回调参数(满足“打印返回参数”的需求)
console.log("[ReceptionCenter][onResize] res =", res);
// 2) 尝试从回调中提取 width/height 做去重(字段结构在不同端可能不同,必须防御性处理)
let w: null | number = null;
let h: null | number = null;
const obj = res as UTSJSONObject;
const sizeRaw = obj.size;
if (sizeRaw != null) {
const sizeObj = sizeRaw as UTSJSONObject;
const ww = sizeObj.windowWidth;
const wh = sizeObj.windowHeight;
if (typeof ww === "number") { w = ww; }
if (typeof wh === "number") { h = wh; }
} else {
const ww = obj.windowWidth;
const wh = obj.windowHeight;
if (typeof ww === "number") { w = ww; }
if (typeof wh === "number") { h = wh; }
}
if (w != null && h != null && (lastOnResizeWidth != w || lastOnResizeHeight != h)) {
lastOnResizeWidth = w;
lastOnResizeHeight = h;
console.log(`[ReceptionCenter][onResize] size = ${w}x${h}`);
}
updateOrientation();
syncReceptionDashboardLayout();
});
function getPerformanceData(): Promise<void> {
return getPerformanceDataImpl()
return getPerformanceDataImpl();
}
function getCustomerList(append: boolean): Promise<void> {
console.log('[ReceptionCenter] 获取客户列表触底加载', append)
return getCustomerListImpl(append)
console.log("[ReceptionCenter] 获取客户列表触底加载", append);
return getCustomerListImpl(append);
}
function getReceptionRecordList(append: boolean): Promise<void> {
return getReceptionRecordListImpl(append)
return getReceptionRecordListImpl(append);
}
// ========== Tab 切换事件 ==========
/** 主 Tab 切换 */
function onMainTabChange(e: any): void {
let nextIndex = 0
if (typeof e === 'number'
) {
nextIndex = e
} else {
const eventObj = e as UTSJSONObject
const idx = eventObj['index']
if (idx != null && typeof idx === 'number'
) {
nextIndex = idx
}
}
mainTabIndex.value = nextIndex
console.log('[ReceptionCenter] 主 Tab 切换:', mainTabIndex.value)
if (mainTabIndex.value == 0) {
void getPerformanceData()
} else {
customerFilePageNum.value = 1
receptionPageNum.value = 1
if (listSubTabIndex.value == 0) {
void getCustomerList(false)
} else {
void getReceptionRecordList(false)
}
}
let nextIndex = 0;
if (typeof e === "number"
) {
nextIndex = e;
} else {
const eventObj = e as UTSJSONObject;
const idx = eventObj.index;
if (idx != null && typeof idx === "number"
) {
nextIndex = idx;
}
}
mainTabIndex.value = nextIndex;
console.log("[ReceptionCenter] 主 Tab 切换:", mainTabIndex.value);
if (mainTabIndex.value == 0) {
void getPerformanceData();
} else {
customerFilePageNum.value = 1;
receptionPageNum.value = 1;
if (listSubTabIndex.value == 0) {
void getCustomerList(false);
} else {
void getReceptionRecordList(false);
}
}
}
function onOutputTabIndexChange(index: number): void {
console.log('[ReceptionCenter] 产值卡片 Tab 切换:', index)
outputTabIndex.value = index
console.log("[ReceptionCenter] 产值卡片 Tab 切换:", index);
outputTabIndex.value = index;
}
/** 客户列表下的二级 Tab 切换 */
function switchListSubTab(index: number): void {
listSubTabIndex.value = index
console.log('[ReceptionCenter] 列表二级 Tab 切换:', listSubTabIndex.value)
// 重置页码并加载对应列表
if (index == 0) {
customerFilePageNum.value = 1
void getCustomerList(false)
} else {
receptionPageNum.value = 1
void getReceptionRecordList(false)
}
listSubTabIndex.value = index;
console.log("[ReceptionCenter] 列表二级 Tab 切换:", listSubTabIndex.value);
// 重置页码并加载对应列表
if (index == 0) {
customerFilePageNum.value = 1;
void getCustomerList(false);
} else {
receptionPageNum.value = 1;
void getReceptionRecordList(false);
}
}
/** 客户列表触底加载更多 */
function onListScrollToLower(): void {
// 横屏:左右分栏同时展示「业绩看板 + 客户列表」,此时 mainTabIndex 可能仍为 0
// 因此触底加载不能依赖 mainTabIndex == 1 的门禁,否则横屏永远不触发加载更多
if (isLandscape.value != true && mainTabIndex.value != 1) {
return
}
if (listSubTabIndex.value == 0) {
console.log('[ReceptionCenter] 客户列表触底')
void getCustomerList(true)
} else {
console.log('[ReceptionCenter] 接待列表触底')
void getReceptionRecordList(true)
}
// 横屏:左右分栏同时展示「业绩看板 + 客户列表」,此时 mainTabIndex 可能仍为 0
// 因此触底加载不能依赖 mainTabIndex == 1 的门禁,否则横屏永远不触发加载更多
if (isLandscape.value != true && mainTabIndex.value != 1) {
return;
}
if (listSubTabIndex.value == 0) {
console.log("[ReceptionCenter] 客户列表触底");
void getCustomerList(true);
} else {
console.log("[ReceptionCenter] 接待列表触底");
void getReceptionRecordList(true);
}
}
/** 业绩看板数值是否展示(睁眼可见 / 闭眼隐藏) */
const performanceMetricsVisible = ref(true)
const performanceMetricsVisible = ref(true)
;
function togglePerformanceMetricsVisibility(): void {
performanceMetricsVisible.value = !performanceMetricsVisible.value
performanceMetricsVisible.value = !performanceMetricsVisible.value;
}
// 客户档案详情(客户录入列表卡片)
const showCustomerFormDetail = ref(false)
const customerFormDetailItem = ref<
UTSJSONObject | null>(null)
const showCustomerFormDetail = ref(false)
;
const customerFormDetailItem = ref<
null | UTSJSONObject>(null);
// 接待复盘详情(接待列表卡片 → receptionDetail.uvue)
const showReceptionRecordDetail = ref(false)
const receptionRecordItem = ref<UTSJSONObject>({})
const showReceptionRecordDetail = ref(false)
;
const receptionRecordItem = ref<UTSJSONObject>({})
;
function onReceptionCardClick(item: UTSJSONObject): void {
if (filterTabIndex.value == 0) {
// 与 FormAdd 打开方式一致:navigateTo + query record(JSON)
uni.navigateTo({
url: `/pages/receptionCenter/receptionDetail?record=${encodeURIComponent(JSON.stringify(item))}`
})
} else {
uni.showToast({ title: '该接待尚不支持复盘', icon: 'none' })
}
if (filterTabIndex.value == 0) {
// 与 FormAdd 打开方式一致:navigateTo + query record(JSON)
uni.navigateTo({
url: `/pages/receptionCenter/receptionDetail?record=${encodeURIComponent(JSON.stringify(item))}`
});
} else {
uni.showToast({ title: "该接待尚不支持复盘", icon: "none" });
}
}
// 是否使用鸿蒙/问界口径(true=问界/鸿蒙;false=延保/权益)
// channelType == 1 => 问界/鸿蒙
const isHarmonyValue = ref(false)
const isHarmonyValue = ref(false)
;
type PerformanceTypeItem = { label: string; value: number }
function performanceTypeList(): UnPickerColumn {
let list: PerformanceTypeItem[] = []
let list: PerformanceTypeItem[] = []
;
if (isHarmonyValue.value) {
list = [
{ label:
'问界'
, value: 1 },
{ label:
'鸿蒙'
, value: 2 },
]
{ label:
"问界"
, value: 1 },
{ label:
"鸿蒙"
, value: 2 },
]
;
} else {
list = [
{ label:
'延保'
, value: 1 },
{ label:
'权益'
, value: 3 },
]
{ label:
"延保"
, value: 1 },
{ label:
"权益"
, value: 3 },
]
;
}
// 对象字面量需显式断言为 UnPickerColumnItem,否则 UTS 会推断为 UTSJSONObject
const items: UnPickerColumn = []
let i = 0
const items: UnPickerColumn = []
;
let i = 0
;
while (i < list.length) {
items.push({ text: list[i].label, value: list[i].value } as UnPickerColumnItem)
i++
items.push({ text: list[i].label, value: list[i].value } as UnPickerColumnItem)
;
i++
;
}
return items
return items
;
}
// 选中的类型(默认取当前列表第一项)
const selectedBrand = ref<string>(performanceTypeList()[0].text)
const selectedBrandValue = ref<number>(performanceTypeList()[0].value as number)
const selectedBrand = ref<string>(performanceTypeList()[0].text)
;
const selectedBrandValue = ref<number>(performanceTypeList()[0].value as number)
;
watch(isHarmonyValue, () => {
// 口径切换时,避免 selectedBrand 仍指向旧列表项
const items = performanceTypeList()
const items = performanceTypeList()
;
if (items.length > 0) {
selectedBrand.value = items[0].text
selectedBrandValue.value = items[0].value as number
selectedBrand.value = items[0].text
;
selectedBrandValue.value = items[0].value as number
;
}
})
})
;
// picker 列
const columns = computed((): UnPickerColumn[] => {
return [performanceTypeList()]
})
return [performanceTypeList()]
;
})
;
/** 战败/成交:与 submittedResultTabIndex 0/1 一致 */
const submittedResultPickerColumns = computed((): UnPickerColumn[] => {
const col: UnPickerColumn = []
col.push({ text: '战败', value: 0 } as UnPickerColumnItem)
col.push({ text: '成交', value: 1 } as UnPickerColumnItem)
return [col]
})
const col: UnPickerColumn = [];
col.push({ text: "战败", value: 0 } as UnPickerColumnItem, { text: "成交", value: 1 } as UnPickerColumnItem);
return [col];
});
/** 打开战败/成交下拉时按当前选中回显(下标与 submittedResultTabIndex 一致) */
const submittedResultPickerDefaultIndex = computed((): number[] => {
return [submittedResultTabIndex.value]
})
return [submittedResultTabIndex.value]
;
})
;
/** 未复盘/复盘:与 reviewTabIndex 0/1 一致 */
const reviewPickerColumns = computed((): UnPickerColumn[] => {
const col: UnPickerColumn = []
col.push({ text: '未复盘', value: 0 } as UnPickerColumnItem)
col.push({ text: '已复盘', value: 1 } as UnPickerColumnItem)
return [col]
})
const col: UnPickerColumn = [];
col.push({ text: "未复盘", value: 0 } as UnPickerColumnItem, { text: "已复盘", value: 1 } as UnPickerColumnItem);
return [col];
});
/** 打开复盘下拉时按当前 Tab 回显滚轮位置(单列,下标与 reviewTabIndex 一致) */
const reviewPickerDefaultIndex = computed((): number[] => {
return [reviewTabIndex.value]
})
return [reviewTabIndex.value]
;
})
;
// 确认:将选中值填充到 tag,并关闭弹窗
const onConfirm = (e: UnPickerConfirmEvent): void => {
const items = e.value
if (items != null && items.length > 0) {
selectedBrand.value = items[0].text
selectedBrandValue.value = items[0].value as number
}
show.value = false
}
const items = e.value;
if (items != null && items.length > 0) {
selectedBrand.value = items[0].text;
selectedBrandValue.value = items[0].value as number;
}
show.value = false;
}
;
// 取消:仅关闭弹窗,不更新选中值
const onClose = (): void => {
show.value = false
}
show.value = false;
}
;
// 客户录入按钮点击:跳转到预录信息页面
function onCustomerEntryClick(): void {
uni.navigateTo({
url: '/pages/receptionCenter/FormAdd'
})
uni.navigateTo({
url: "/pages/receptionCenter/FormAdd"
});
}
function onListCustomerEntryEdit(item: UTSJSONObject): void {
uni.navigateTo({
url: `/pages/receptionCenter/FormAdd?record=${encodeURIComponent(JSON.stringify(item))}`
})
uni.navigateTo({
url: `/pages/receptionCenter/FormAdd?record=${encodeURIComponent(JSON.stringify(item))}`
});
}
function onCustomerFormDetailClose(): void {
showCustomerFormDetail.value = false
customerFormDetailItem.value = null
showCustomerFormDetail.value = false;
customerFormDetailItem.value = null;
}
function onReceptionRecordDetailClose(): void {
showReceptionRecordDetail.value = false
receptionRecordItem.value = {}
showReceptionRecordDetail.value = false;
receptionRecordItem.value = {};
}
function onListCustomerEntryClick(item: UTSJSONObject): void {
// 与 FormAdd 打开方式一致:navigateTo + query record(JSON)
uni.navigateTo({
url: `/pages/receptionCenter/forms/FormDetail?record=${encodeURIComponent(JSON.stringify(item))}`
})
// 与 FormAdd 打开方式一致:navigateTo + query record(JSON)
uni.navigateTo({
url: `/pages/receptionCenter/forms/FormDetail?record=${encodeURIComponent(JSON.stringify(item))}`
});
}
function onListCustomerEntryDelete(item: UTSJSONObject): void {
const idStr = getStr(item, 'id')
const list = customerList.value
const next: UTSJSONObject[] = []
let i = 0
while (i < list.length) {
if (getStr(list[i], 'id'
) != idStr) {
next.push(list[i])
}
i++
}
customerList.value = next
uni.showToast({ title: '已删除', icon: 'none' })
const idStr = getStr(item, "id");
const list = customerList.value;
const next: UTSJSONObject[] = [];
let i = 0;
while (i < list.length) {
if (getStr(list[i], "id"
) != idStr) {
next.push(list[i]);
}
i++;
}
customerList.value = next;
uni.showToast({ title: "已删除", icon: "none" });
}
/**
* 从登录态取门店 merchantId 与场景业务类型(与 FormAdd 一致:sceneType==0 为 1,否则 2)。
* 缺登录或门店号时返回 null,调用方跳过请求。
*/
function getLoginShopMerchantAndSceneBussiness():
UTSJSONObject | null
{
const rawUser = storage.get(
'userInfo') as UTSJSONObject | null
function getLoginShopMerchantAndSceneBussiness():
null | UTSJSONObject
{
const rawUser = storage.get(
"userInfo") as null | UTSJSONObject;
if (rawUser == null) {
return null
return null
;
}
const merchantId = rawUser
['shopMerchantId']
if (merchantId == null || `${merchantId}` ==
''
) {
return null
const merchantId = rawUser
.shopMerchantId;
if (merchantId == null || `${merchantId}` ==
""
) {
return null
;
}
const sceneTypeRaw = rawUser
['sceneType']
const sceneTypeNum = sceneTypeRaw != null ? (sceneTypeRaw as number) : 1
const sceneBussiness = sceneTypeNum == 0 ? 1 : 2
const sceneTypeRaw = rawUser
.sceneType;
const sceneTypeNum = sceneTypeRaw != null ? (sceneTypeRaw as number) : 1
;
const sceneBussiness = sceneTypeNum == 0 ? 1 : 2
;
return {
merchantId
: merchantId
,
sceneBussiness
: sceneBussiness
,
} as UTSJSONObject
merchantId,
sceneBussiness,
} as UTSJSONObject
;
}
/** 当日到店:与 receiption.uts 中 customerInfoPage 示例时间格式一致 */
// 客户档案列表请求参数(预录列表:分页 + 今日到店时传 startTime/endTime)
function getDefaultCustomerFileParams():
UTSJSONObject | null
{
const ctx = getLoginShopMerchantAndSceneBussiness()
function getDefaultCustomerFileParams():
null | UTSJSONObject
{
const ctx = getLoginShopMerchantAndSceneBussiness()
;
if (ctx == null) {
return null
return null
;
}
const params = {
"pageNum": customerFilePageNum.value,
"pageSize": CUSTOMER_FILE_PAGE_SIZE,
"receptionStatus": 1,
"merchantId": ctx
['merchantId']
,
"bussinessScene": ctx
['sceneBussiness']
as number,
} as UTSJSONObject
"merchantId": ctx
.merchantId
,
"bussinessScene": ctx
.sceneBussiness
as number,
} as UTSJSONObject
;
if (entryFilterIndex.value == 0) {
const range = getTodayDayRangeStrings()
params
['startTime'] = range['startTime']
params
['endTime'] = range['endTime']
const range = getTodayDayRangeStrings()
;
params
.startTime = range.startTime;
params
.endTime = range.endTime;
}
return params
return params
;
}
/**
...
...
@@ -889,391 +840,391 @@ function getDefaultCustomerFileParams(): UTSJSONObject | null {
* - 复盘/未复盘 → reviewFlag(0=已复盘,非 0 如 1=未复盘)
* - 战败/成交(已提交)/ 待上传·待提交(未提交)→ orderFinishFlag(0/1;未提交若后端另有字段请改映射)
*/
function getDefaultReceptionListParams():
UTSJSONObject | null
{
const ctx = getLoginShopMerchantAndSceneBussiness()
function getDefaultReceptionListParams():
null | UTSJSONObject
{
const ctx = getLoginShopMerchantAndSceneBussiness()
;
if (ctx == null) {
return null
return null
;
}
// 与 reviewTabIndex、复盘选择器一致:0=已复盘,1=未复盘
const reviewFlag = reviewTabIndex.value
const submitted = filterTabIndex.value == 0 ? 1 : 0
const reviewFlag = reviewTabIndex.value
;
const submitted = filterTabIndex.value == 0 ? 1 : 0
;
const orderFinishFlag = submitted == 1
? (submittedResultTabIndex.value == 1 ? 1 : 0)
: (unsubmittedPendingTabIndex.value == 1 ? 1 : 0)
: (unsubmittedPendingTabIndex.value == 1 ? 1 : 0)
;
return {
"merchantId": ctx
['merchantId']
,
"merchantId": ctx
.merchantId
,
"pageNum": receptionPageNum.value,
"pageSize": RECEPTION_PAGE_SIZE,
"reviewFlag": reviewFlag,
"orderFinishFlag": orderFinishFlag,
"bussinessType": ctx
['sceneBussiness']
as number,
"bussinessType": ctx
.sceneBussiness
as number,
"submitted": submitted,
} as UTSJSONObject
} as UTSJSONObject
;
}
// 页面加载/模块切换时请求门店业绩数据
getPerformanceDataImpl = async (): Promise<void> => {
const raw = storage.get(
'userInfo') as UTSJSONObject | null
const raw = storage.get(
"userInfo") as null | UTSJSONObject;
if (raw == null) {
performanceData.value = getMockPerformanceData()
return
performanceData.value = getMockPerformanceData()
;
return
;
}
const userInfo = raw
const shopMerchantId = userInfo
['shopMerchantId']
const sceneType = userInfo
['sceneType']
const range = getCurrentMonthRange()
const userInfo = raw
;
const shopMerchantId = userInfo
.shopMerchantId;
const sceneType = userInfo
.sceneType;
const range = getCurrentMonthRange()
;
// 组装接口入参(对齐旧项目逻辑)
const params: UTSJSONObject = {
merchantIdList: shopMerchantId,
sceneType: sceneType != null ? sceneType : 1,
startDate: range
['startDate']
,
endDate: range
['endDate']
,
} as UTSJSONObject
startDate: range
.startDate
,
endDate: range
.endDate
,
} as UTSJSONObject
;
if (sceneType != null && sceneType == 0) {
if (isHarmonyValue.value === true) {
// 鸿蒙/问界:bussinessType 固定 1,hmzxFlag 来自当前模块值
params
['bussinessType'] = 1
params
['hmzxFlag'] = selectedBrandValue.value
params
.bussinessType = 1;
params
.hmzxFlag = selectedBrandValue.value;
} else {
// 延保/权益:bussinessType 来自当前模块值
params
['bussinessType'] = selectedBrandValue.value
params
.bussinessType = selectedBrandValue.value;
}
} else {
// 非 0 场景:hmzxFlag 由 isHarmony 决定(模块值只用于展示,不参与接口参数)
params
['hmzxFlag'] = isHarmonyValue.value === true ? 3 : 4
params
.hmzxFlag = isHarmonyValue.value === true ? 3 : 4;
}
try {
const res = await getMerchantPerformance(params)
const resObj = res as UTSJSONObject
const bizData = resObj
['data'] as UTSJSONObject | null
const res = await getMerchantPerformance(params)
;
const resObj = res as UTSJSONObject
;
const bizData = resObj
.data as null | UTSJSONObject;
// performanceData.value = isPerformanceDataEmpty(bizData) ? getMockPerformanceData() : (bizData as UTSJSONObject)
performanceData.value = bizData as UTSJSONObject
} catch
(err)
{
performanceData.value = getMockPerformanceData()
performanceData.value = bizData as UTSJSONObject
;
} catch {
performanceData.value = getMockPerformanceData()
;
}
}
}
;
watch(selectedBrandValue, () => {
// picker 模块值切换:刷新业绩看板
getPerformanceData()
})
getPerformanceData()
;
})
;
/** append=false 首屏/筛选重置替换列表;append=true 触底追加下一页(pageNum 先 +1 再请求,失败回退) */
getCustomerListImpl = async (append: boolean): Promise<void> => {
if (append) {
if (customerListHasMore.value != true) {
return
return
;
}
if (customerListLoadingMore.value == true) {
return
return
;
}
}
let pageBumped = false
let pageBumped = false
;
if (append) {
customerFilePageNum.value = customerFilePageNum.value + 1
pageBumped = true
customerFilePageNum.value = customerFilePageNum.value + 1
;
pageBumped = true
;
} else {
customerListHasMore.value = true
customerListHasMore.value = true
;
}
const fileParams = getDefaultCustomerFileParams()
const fileParams = getDefaultCustomerFileParams()
;
if (fileParams == null) {
console.warn(
'[getCustomerList] 无登录门店信息,跳过客户档案列表请求')
console.warn(
"[getCustomerList] 无登录门店信息,跳过客户档案列表请求");
if (pageBumped) {
customerFilePageNum.value = customerFilePageNum.value - 1
customerFilePageNum.value = customerFilePageNum.value - 1
;
}
return
return
;
}
// 首屏/筛选重置与加载更多统一置位,供列表骨架屏、底部「加载中」与空态判断使用(append=false 原先未置 true,导致首屏一直空白)
customerListLoadingMore.value = true
customerListLoadingMore.value = true
;
try {
const res = await getCustomerFileList(fileParams)
console.log('[ReceptionCenter] 获取客户列表res', res)
const resObj = res as UTSJSONObject
const codeRaw = resObj
['code']
if (`${codeRaw}` !=
'0'
) {
const msgRaw = resObj
['message']
const msgStr = msgRaw != null && `${msgRaw}` !=
'' ? `${msgRaw}` : '客户列表加载失败'
const res = await getCustomerFileList(fileParams)
;
console.log("[ReceptionCenter] 获取客户列表res", res);
const resObj = res as UTSJSONObject
;
const codeRaw = resObj
.code;
if (`${codeRaw}` !=
"0"
) {
const msgRaw = resObj
.message;
const msgStr = msgRaw != null && `${msgRaw}` !=
"" ? `${msgRaw}` : "客户列表加载失败";
if (append != true) {
customerList.value = []
customerListHasMore.value = false
customerList.value = []
;
customerListHasMore.value = false
;
}
if (pageBumped) {
customerFilePageNum.value = customerFilePageNum.value - 1
customerFilePageNum.value = customerFilePageNum.value - 1
;
}
uni.showToast({ title: msgStr, icon:
'none' })
return
uni.showToast({ title: msgStr, icon:
"none" });
return
;
}
const bizData = resObj
['data'] as UTSJSONObject | null
const bizData = resObj
.data as null | UTSJSONObject;
if (bizData == null) {
if (append != true) {
customerList.value = []
customerList.value = []
;
}
customerListHasMore.value = false
customerListHasMore.value = false
;
if (pageBumped) {
customerFilePageNum.value = customerFilePageNum.value - 1
customerFilePageNum.value = customerFilePageNum.value - 1
;
}
return
return
;
}
const list = bizData
['list']
if (list == null || (
list instanceof Array
) != true) {
const list = bizData
.list;
if (list == null || (
Array.isArray(list)
) != true) {
if (append != true) {
customerList.value = []
customerList.value = []
;
}
customerListHasMore.value = false
customerListHasMore.value = false
;
if (pageBumped) {
customerFilePageNum.value = customerFilePageNum.value - 1
customerFilePageNum.value = customerFilePageNum.value - 1
;
}
return
return
;
}
const arr: UTSJSONObject[] = []
let i = 0
const arr: UTSJSONObject[] = []
;
let i = 0
;
while (i < list.length) {
const item = list[i] as UTSJSONObject
arr.push(item)
i++
const item = list[i] as UTSJSONObject
;
arr.push(item)
;
i++
;
}
if (append == true) {
customerList.value = mergeByKey(customerList.value, arr,
'id')
customerList.value = mergeByKey(customerList.value, arr,
"id");
} else {
customerList.value = arr
customerList.value = arr
;
}
customerListHasMore.value = resolveHasMore(
bizData,
arr.length,
customerList.value.length,
CUSTOMER_FILE_PAGE_SIZE
)
} catch (err) {
console.error(
'获取客户档案列表失败:', err)
)
;
} catch (err
or
) {
console.error(
"获取客户档案列表失败:", error);
if (pageBumped) {
customerFilePageNum.value = customerFilePageNum.value - 1
customerFilePageNum.value = customerFilePageNum.value - 1
;
}
if (append != true) {
customerListHasMore.value = false
customerListHasMore.value = false
;
}
uni.showToast({ title:
'网络异常,请稍后重试', icon: 'none' })
uni.showToast({ title:
"网络异常,请稍后重试", icon: "none" });
} finally {
customerListLoadingMore.value = false
customerListLoadingMore.value = false
;
}
}
}
;
/** append=false 重置页码后整表替换;append=true 触底下一页合并(与 getCustomerList 一致) */
getReceptionRecordListImpl = async (append: boolean): Promise<void> => {
if (append) {
if (receptionListHasMore.value != true) {
return
return
;
}
if (receptionListLoadingMore.value == true) {
return
return
;
}
}
let pageBumped = false
let pageBumped = false
;
if (append) {
receptionPageNum.value = receptionPageNum.value + 1
pageBumped = true
receptionPageNum.value = receptionPageNum.value + 1
;
pageBumped = true
;
} else {
receptionListHasMore.value = true
receptionListHasMore.value = true
;
}
const receptionParams = getDefaultReceptionListParams()
const receptionParams = getDefaultReceptionListParams()
;
if (receptionParams == null) {
console.warn(
'[getReceptionRecordList] 无登录门店信息,跳过接待复盘列表请求')
console.warn(
"[getReceptionRecordList] 无登录门店信息,跳过接待复盘列表请求");
if (pageBumped) {
receptionPageNum.value = receptionPageNum.value - 1
receptionPageNum.value = receptionPageNum.value - 1
;
}
return
return
;
}
receptionListLoadingMore.value = true
console.log("receptionParams接待复盘参数",
receptionParams);
receptionListLoadingMore.value = true
;
console.log("receptionParams接待复盘参数",
receptionParams);
try {
const res = await getReceptionList(receptionParams)
console.log("receptionParams接待复盘列表",
res);
const resObj = res as UTSJSONObject
const codeRaw = resObj
['code']
if (`${codeRaw}` !=
'0'
) {
const msgRaw = resObj
['message']
const msgStr = msgRaw != null && `${msgRaw}` !=
'' ? `${msgRaw}` : '接待列表加载失败'
const res = await getReceptionList(receptionParams)
;
console.log("receptionParams接待复盘列表",
res);
const resObj = res as UTSJSONObject
;
const codeRaw = resObj
.code;
if (`${codeRaw}` !=
"0"
) {
const msgRaw = resObj
.message;
const msgStr = msgRaw != null && `${msgRaw}` !=
"" ? `${msgRaw}` : "接待列表加载失败";
if (append != true) {
receptionRecordList.value = []
receptionListHasMore.value = false
receptionRecordList.value = []
;
receptionListHasMore.value = false
;
}
if (pageBumped) {
receptionPageNum.value = receptionPageNum.value - 1
receptionPageNum.value = receptionPageNum.value - 1
;
}
uni.showToast({ title: msgStr, icon:
'none' })
return
uni.showToast({ title: msgStr, icon:
"none" });
return
;
}
const bizData = resObj
['data'] as UTSJSONObject | null
const bizData = resObj
.data as null | UTSJSONObject;
if (bizData == null) {
if (append != true) {
receptionRecordList.value = []
receptionRecordList.value = []
;
}
receptionListHasMore.value = false
receptionListHasMore.value = false
;
if (pageBumped) {
receptionPageNum.value = receptionPageNum.value - 1
receptionPageNum.value = receptionPageNum.value - 1
;
}
return
return
;
}
const list = bizData
['list']
if (list == null || (
list instanceof Array
) != true) {
const list = bizData
.list;
if (list == null || (
Array.isArray(list)
) != true) {
if (append != true) {
receptionRecordList.value = []
receptionRecordList.value = []
;
}
receptionListHasMore.value = false
receptionListHasMore.value = false
;
if (pageBumped) {
receptionPageNum.value = receptionPageNum.value - 1
receptionPageNum.value = receptionPageNum.value - 1
;
}
return
return
;
}
const arr: UTSJSONObject[] = []
let i = 0
const arr: UTSJSONObject[] = []
;
let i = 0
;
while (i < list.length) {
const item = list[i] as UTSJSONObject
arr.push(item)
i++
const item = list[i] as UTSJSONObject
;
arr.push(item)
;
i++
;
}
if (append == true) {
receptionRecordList.value = mergeByKey(receptionRecordList.value, arr,
'batchId')
receptionRecordList.value = mergeByKey(receptionRecordList.value, arr,
"batchId");
} else {
receptionRecordList.value = arr
receptionRecordList.value = arr
;
}
receptionListHasMore.value = resolveHasMore(
bizData,
arr.length,
receptionRecordList.value.length,
RECEPTION_PAGE_SIZE
)
} catch (err) {
console.error(
'获取接待复盘列表失败:', err)
)
;
} catch (err
or
) {
console.error(
"获取接待复盘列表失败:", error);
if (pageBumped) {
receptionPageNum.value = receptionPageNum.value - 1
receptionPageNum.value = receptionPageNum.value - 1
;
}
if (append != true) {
receptionListHasMore.value = false
receptionListHasMore.value = false
;
}
uni.showToast({ title:
'网络异常,请稍后重试', icon: 'none' })
uni.showToast({ title:
"网络异常,请稍后重试", icon: "none" });
} finally {
receptionListLoadingMore.value = false
receptionListLoadingMore.value = false
;
}
}
}
;
function switchFilterTab(index: number): void {
filterTabIndex.value = index
receptionPageNum.value = 1
void getReceptionRecordList(false)
filterTabIndex.value = index
;
receptionPageNum.value = 1
;
void getReceptionRecordList(false)
;
}
function switchEntryFilterTab(index: number): void {
entryFilterIndex.value = index
customerFilePageNum.value = 1
void getCustomerList(false)
entryFilterIndex.value = index
;
customerFilePageNum.value = 1
;
void getCustomerList(false)
;
}
function switchReviewTab(index: number): void {
reviewTabIndex.value = index
receptionPageNum.value = 1
void getReceptionRecordList(false)
reviewTabIndex.value = index
;
receptionPageNum.value = 1
;
void getReceptionRecordList(false)
;
}
function switchSubmittedResultTab(index: number): void {
submittedResultTabIndex.value = index
receptionPageNum.value = 1
void getReceptionRecordList(false)
submittedResultTabIndex.value = index
;
receptionPageNum.value = 1
;
void getReceptionRecordList(false)
;
}
function switchUnsubmittedPendingTab(index: number): void {
unsubmittedPendingTabIndex.value = index
receptionPageNum.value = 1
void getReceptionRecordList(false)
unsubmittedPendingTabIndex.value = index
;
receptionPageNum.value = 1
;
void getReceptionRecordList(false)
;
}
function onSubmittedResultPickerConfirm(e: UnPickerConfirmEvent): void {
const items = e.value
const items = e.value
;
if (items != null && items.length > 0) {
const idx = items[0].value as number
switchSubmittedResultTab(idx)
const idx = items[0].value as number
;
switchSubmittedResultTab(idx)
;
}
showSubmittedResultPicker.value = false
showSubmittedResultPicker.value = false
;
}
function onSubmittedResultPickerClose(): void {
showSubmittedResultPicker.value = false
showSubmittedResultPicker.value = false
;
}
function openSubmittedResultPicker(): void {
submittedResultPickerLayerKey.value = submittedResultPickerLayerKey.value + 1
showSubmittedResultPicker.value = true
submittedResultPickerLayerKey.value = submittedResultPickerLayerKey.value + 1
;
showSubmittedResultPicker.value = true
;
}
function onReviewPickerConfirm(e: UnPickerConfirmEvent): void {
const items = e.value
const items = e.value
;
if (items != null && items.length > 0) {
const idx = items[0].value as number
const idx = items[0].value as number
;
if (reviewTabIndex.value != idx) {
switchReviewTab(idx)
switchReviewTab(idx)
;
}
}
showReviewPicker.value = false
showReviewPicker.value = false
;
}
function onReviewPickerClose(): void {
showReviewPicker.value = false
showReviewPicker.value = false
;
}
function openReviewPicker(): void {
reviewPickerLayerKey.value = reviewPickerLayerKey.value + 1
showReviewPicker.value = true
reviewPickerLayerKey.value = reviewPickerLayerKey.value + 1
;
showReviewPicker.value = true
;
}
onMounted(() => {
// 先刷新全局方向,再同步安全区与窄屏模式(与 isLandscape 的 computed 数据源一致)
updateOrientation()
syncReceptionDashboardLayout()
// uni-app x(尤其 APP 端)对 onWindowResize 支持不稳定,这里统一用轮询保证兼容性
// 如需 H5 实时监听,可在 H5 条件编译块里单独注册
// 页面加载后再次兜底计算(避免运行期时区/时间跳变导致不一致)
setTimeProgress()
// 根据当前 Tab 加载对应数据
// 横屏:左右分栏同时展示两个模块,因此初始化时两边数据都需要拉取
if (isLandscape.value == true) {
void getPerformanceData()
if (listSubTabIndex.value != 0) {
void getReceptionRecordList(false)
}
} else {
if (mainTabIndex.value == 0) {
void getPerformanceData()
} else {
if (listSubTabIndex.value == 0) {
// 客户列表会在下方统一触发一次
} else {
void getReceptionRecordList(false)
}
}
}
// 默认页面加载完成后拉取一次客户列表
customerFilePageNum.value = 1
void getCustomerList(false)
})
// 先刷新全局方向,再同步安全区与窄屏模式(与 isLandscape 的 computed 数据源一致)
updateOrientation();
syncReceptionDashboardLayout();
// uni-app x(尤其 APP 端)对 onWindowResize 支持不稳定,这里统一用轮询保证兼容性
// 如需 H5 实时监听,可在 H5 条件编译块里单独注册
// 页面加载后再次兜底计算(避免运行期时区/时间跳变导致不一致)
setTimeProgress();
// 根据当前 Tab 加载对应数据
// 横屏:左右分栏同时展示两个模块,因此初始化时两边数据都需要拉取
if (isLandscape.value == true) {
void getPerformanceData();
if (listSubTabIndex.value != 0) {
void getReceptionRecordList(false);
}
} else {
if (mainTabIndex.value == 0) {
void getPerformanceData();
} else {
if (listSubTabIndex.value == 0) {
// 客户列表会在下方统一触发一次
} else {
void getReceptionRecordList(false);
}
}
}
// 默认页面加载完成后拉取一次客户列表
customerFilePageNum.value = 1;
void getCustomerList(false);
})
;
// 在 center.uvue setup 顶部监听自定义事件,刷新列表
onMounted(() => {
uni.$on('refresh-reception-list'
, () => {
// 重新加载第一页
customerFilePageNum.value = 1
void getCustomerList(false)
})
})
uni.$on("refresh-reception-list"
, () => {
// 重新加载第一页
customerFilePageNum.value = 1;
void getCustomerList(false);
});
})
;
onUnmounted(() => {
uni.$off('refresh-reception-list')
})
uni.$off("refresh-reception-list");
})
;
</script>
<style scoped lang="scss">
...
...
@@ -1316,11 +1267,6 @@ onUnmounted(() => {
box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.reception-navbar-spacer {
height: 44px;
flex-shrink: 0;
}
.reception-route-body {
flex: 1;
width: 100%;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment