Commit 621f1ec9 by liimin

feat(接待中心): 重构接待中心模块并新增业绩看板

- 重构接待中心组件结构,将 MyCenter、ReceptionCenter 等组件移至 pages 目录统一管理
- 新增业绩看板功能,包含客流情况、产值对比和本月业绩三个核心卡片组件
- 实现客户录入与接待复盘双标签页布局,支持今日到店/全部客户筛选
- 新增统一毛玻璃卡片容器 CardContainer 和共享样式文件
- 优化 MessageBox 组件样式,增加关闭事件处理
- 新增类型定义文件和工具函数,提高代码可维护性
- 在 pages.json 中注册接待中心相关页面并更新 easycom 配置
1 parent b776f3ed
Showing 31 changed files with 1801 additions and 343 deletions
...@@ -159,9 +159,9 @@ import { storage } from "@/utils/storage.uts"; ...@@ -159,9 +159,9 @@ import { storage } from "@/utils/storage.uts";
import HomeFrameLeftSide from "./LeftSide.uvue"; import HomeFrameLeftSide from "./LeftSide.uvue";
import HomeFrameMessageIndex from "./MessageIndex.uvue"; import HomeFrameMessageIndex from "./MessageIndex.uvue";
import MyCenter from "./MyCenter.uvue"; import MyCenter from "@/pages/person/myCenter.uvue";
import ReceptionCenter from "./ReceptionCenter/center.uvue"; import ReceptionCenter from "@/pages/receptionCenter/center.uvue";
import ReceptionDetail from "./ReceptionCenter/receptionDetail.uvue"; import ReceptionDetail from "@/pages/receptionCenter/receptionDetail.uvue";
const props = defineProps<{ const props = defineProps<{
showFooter?: boolean showFooter?: boolean
......
<template> <template>
<un-popup :mode="position" <un-popup :mode="position"
:show="visible" :show="visible"
:z-index="zIndex" :z-index="zIndex"
> @close="handlePopupClose"
>
<view class="tips-wrapper" <view class="tips-wrapper"
:class="[{'radius': position === 'center'}]" :class="[{'radius': position === 'center'}]"
:style="popupStyle"> :style="popupStyle">
...@@ -174,6 +175,11 @@ function confirm(): void { ...@@ -174,6 +175,11 @@ function confirm(): void {
emit("confirm"); emit("confirm");
} }
function handlePopupClose(): void {
visible.value = false;
emit("close");
}
// 处理关闭按钮点击(不触发事件,只隐藏) // 处理关闭按钮点击(不触发事件,只隐藏)
function handleHide(): void { function handleHide(): void {
hide(); hide();
...@@ -241,43 +247,52 @@ defineExpose({ open, close, hide }); ...@@ -241,43 +247,52 @@ defineExpose({ open, close, hide });
.tips-footer { .tips-footer {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: space-between;
height: 50px; padding: 16px 24px 24px;
flex-shrink: 0; flex-shrink: 0;
border-top: 1px solid #e8e8e8; border-top: 1px solid #f1f3f5;
flex-direction: row; flex-direction: row;
} }
.tips-btn { .tips-btn {
width: 50%; flex: 1;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 44px;
border-radius: 8px;
}
.tips-btn.close {
background-color: #f1f5f9;
margin-right: 12px;
}
.tips-btn.preview {
background-color: #3b82f6;
} }
} }
.tips-title-text { .tips-title-text {
font-weight: 500; font-weight: 700;
font-size: 18px; font-size: 18px;
color: #292d33; color: #1e293b;
text-align: center; text-align: center;
} }
.tips-btn-text { .tips-btn-text {
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
line-height: 22px; font-weight: 700;
font-weight: 500;
} }
.tips-btn-text-close { .tips-btn-text-close {
color: #6c6c70; color: #64748b;
} }
.tips-btn-text-preview { .tips-btn-text-preview {
color: #2c66f7; color: #ffffff;
} }
.radius{ .radius{
border-radius: 10px; border-radius: 10px;
......
...@@ -61,6 +61,13 @@ ...@@ -61,6 +61,13 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "接待详情" "navigationBarTitleText": "接待详情"
} }
},
{
"path": "pages/receptionCenter/FormAdd",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "客户档案"
}
} }
], ],
"easycom": { "easycom": {
...@@ -74,8 +81,8 @@ ...@@ -74,8 +81,8 @@
"^home-frame$": "@/components/HomeFrame/index.uvue", "^home-frame$": "@/components/HomeFrame/index.uvue",
"^layout-root$": "@/components/LayoutRoot/index.uvue", "^layout-root$": "@/components/LayoutRoot/index.uvue",
"^Layout$": "@/components/Layout/index.uvue", "^Layout$": "@/components/Layout/index.uvue",
"^segment-tab$": "@/components/HomeFrame/ReceptionCenter/SegmentTab.uvue", "^segment-tab$": "@/pages/receptionCenter/SegmentTab.uvue",
"^reception-detail$": "@/components/HomeFrame/ReceptionCenter/receptionDetail.uvue" "^reception-detail$": "@/pages/receptionCenter/receptionDetail.uvue"
} }
}, },
"globalStyle": { "globalStyle": {
......
<template> <template>
<view class="my-center"> <view class="my-center">
<view class="safe-top-spacer" :style="safeTopStyle"></view>
<scroll-view class="my-scroll" :scroll-y="true" :show-scrollbar="false"> <scroll-view class="my-scroll" :scroll-y="true" :show-scrollbar="false">
<view class="my-content"> <view class="my-content">
<view class="profile-head"> <view class="profile-card">
<un-avatar :text="avatarText" <view class="profile-head">
shape="circle" <un-avatar :text="avatarText"
size="52" shape="circle"
bgColor="#2f6af7" size="52"
color="#ffffff" bgColor="#2f6af7"
fontSize="20" /> color="#ffffff"
<text class="name">{{ userName }}</text> fontSize="20" />
<view class="profile-main">
<text class="name">{{ userName }}</text>
<text class="meta">{{ plainPhone }}</text>
</view>
<view class="scene-tag">
<text class="scene-tag-text">{{ currentSceneTitle }}</text>
</view>
</view>
<view class="profile-divider"></view>
<view class="profile-shop-row">
<text class="profile-shop-label">当前门店</text>
<text class="profile-shop-value">{{ shopName }}</text>
</view>
</view> </view>
<un-gap height="12" bg-color="transparent"></un-gap> <un-gap height="12" bg-color="transparent"></un-gap>
<view class="section-block"> <view class="section-shell">
<un-cell-group title="账号信息" :border="false" round="14" backgroundColor="#ffffff"> <un-cell-group title="账号信息" :border="false" round="14" backgroundColor="#ffffff">
<un-cell title="姓名" <un-cell title="姓名"
:value="userName" :value="userName"
...@@ -33,7 +47,7 @@ ...@@ -33,7 +47,7 @@
<un-gap height="12" bg-color="transparent"></un-gap> <un-gap height="12" bg-color="transparent"></un-gap>
<view class="section-block"> <view class="section-shell">
<un-cell-group title="常用功能" :border="false" round="14" backgroundColor="#ffffff"> <un-cell-group title="常用功能" :border="false" round="14" backgroundColor="#ffffff">
<un-cell title="切换场景" <un-cell title="切换场景"
:value="currentSceneTitle" :value="currentSceneTitle"
...@@ -67,12 +81,12 @@ ...@@ -67,12 +81,12 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed, ref } from "vue"; import { computed, ref, onMounted } from "vue";
import CenterPopup from "@/components/CenterPopup.uvue"; import CenterPopup from "@/components/CenterPopup.uvue";
import { storage } from "@/utils/storage.uts"; import { storage } from "@/utils/storage.uts";
import SettingBox from "./SettingBox.uvue"; import SettingBox from "@/components/HomeFrame/SettingBox.uvue";
const props = defineProps<{ const props = defineProps<{
userInfo?: null | UTSJSONObject userInfo?: null | UTSJSONObject
...@@ -82,6 +96,42 @@ type SceneTypeItem = { title: string; describe: string; icon: string; }; ...@@ -82,6 +96,42 @@ type SceneTypeItem = { title: string; describe: string; icon: string; };
const showScenePopup = ref(false); const showScenePopup = ref(false);
const showSetting = ref(false); const showSetting = ref(false);
const safeTopPx = ref(0);
const safeTopStyle = computed((): UTSJSONObject => {
return {
height: `${safeTopPx.value}px`,
width: "100%",
} as UTSJSONObject;
});
function syncSafeTopInset(): void {
const info = uni.getWindowInfo();
let topInset = 0;
const insets = info.safeAreaInsets;
if (insets != null) {
const t = insets.top;
if (t != null && t > 0) {
topInset = Math.round(t);
}
}
if (topInset <= 0) {
const safe = info.safeArea;
if (safe != null) {
const st = safe.top;
if (st != null && st > 0) {
topInset = Math.round(st);
}
}
}
if (topInset <= 0) {
const sb = info.statusBarHeight;
if (sb != null && sb > 0) {
topInset = Math.round(sb);
}
}
safeTopPx.value = topInset;
}
function getSceneTypeItem(sceneId: number): null | SceneTypeItem { function getSceneTypeItem(sceneId: number): null | SceneTypeItem {
if (sceneId == 1) return { title: "轻改", describe: "太阳膜升级转化", icon: "轻" }; if (sceneId == 1) return { title: "轻改", describe: "太阳膜升级转化", icon: "轻" };
...@@ -202,6 +252,10 @@ function onChooseScene(index: number): void { ...@@ -202,6 +252,10 @@ function onChooseScene(index: number): void {
function goAttendance(): void { function goAttendance(): void {
uni.navigateTo({ url: "/pages/person/attendance" }); uni.navigateTo({ url: "/pages/person/attendance" });
} }
onMounted(() => {
syncSafeTopInset();
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -210,15 +264,21 @@ function goAttendance(): void { ...@@ -210,15 +264,21 @@ function goAttendance(): void {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: linear-gradient(180deg, #eef4ff 0%, #f7f9fc 36%, #f7f9fc 100%); background: linear-gradient(180deg, #edf4ff 0%, #f4f8ff 34%, #f7f9fc 100%);
}
.safe-top-spacer {
width: 100%;
flex-shrink: 0;
} }
.my-scroll { .my-scroll {
width: 100%; width: 100%;
height: 100%; flex: 1;
min-height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 24px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -229,22 +289,18 @@ function goAttendance(): void { ...@@ -229,22 +289,18 @@ function goAttendance(): void {
align-items: stretch; align-items: stretch;
} }
.section-block { .profile-card {
width: 100%; background: linear-gradient(145deg, #ffffff 0%, #f6f9ff 100%);
border: 1px solid #dfe9f7;
} border-radius: 16px;
padding: 14px 14px 12px;
.profile-row { box-shadow: 0 8px 20px rgba(37, 99, 235, 0.10);
display: flex;
flex-direction: row;
align-items: center;
} }
.profile-head { .profile-head {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
padding: 10px 6px 2px;
} }
.profile-main { .profile-main {
...@@ -255,21 +311,71 @@ function goAttendance(): void { ...@@ -255,21 +311,71 @@ function goAttendance(): void {
} }
.name { .name {
margin-left: 12px; font-size: 19px;
font-size: 20px;
font-weight: 600; font-weight: 600;
color: #1a2433; color: #1a2433;
line-height: 24px; line-height: 24px;
} }
.meta { .meta {
margin-top: 4px; margin-top: 2px;
font-size: 13px; font-size: 12px;
color: #808b9c; color: #7b8ba3;
} }
.scene-tag { .scene-tag {
height: 26px;
padding: 0 10px;
background: #eaf2ff;
border: 1px solid #cfe0f8;
border-radius: 999px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.scene-tag-text {
font-size: 11px;
font-weight: 600;
color: #2a5ac7;
}
.profile-divider {
height: 1px;
background-color: #e6edf8;
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px;
} }
.profile-shop-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.profile-shop-label {
font-size: 12px;
color: #8091aa;
}
.profile-shop-value {
flex: 1;
margin-left: 10px;
text-align: right;
font-size: 13px;
font-weight: 500;
color: #334155;
}
.section-shell {
width: 100%;
background-color: #ffffff;
border: 1px solid #e5edf8;
border-radius: 16px;
box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
padding: 2px;
box-sizing: border-box;
}
</style> </style>
...@@ -42,18 +42,18 @@ const rootClass = computed((): string => { ...@@ -42,18 +42,18 @@ const rootClass = computed((): string => {
<style scoped lang="scss"> <style scoped lang="scss">
.card-container { .card-container {
background-color: rgba(255, 255, 255, 0.7); background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.6);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
border-radius: 16px; border-radius: 20px;
flex-direction: column; flex-direction: column;
} }
.card-container--padded { .card-container--padded {
padding: 24px; padding: 12px 16px;
} }
.card-container--funnel-gap { .card-container--funnel-gap {
margin-bottom: 10px; margin-bottom: 16px;
} }
</style> </style>
...@@ -102,31 +102,32 @@ const contactRateMasked = computed((): string => { ...@@ -102,31 +102,32 @@ const contactRateMasked = computed((): string => {
.title-text { .title-text {
color: #333333; color: #333333;
font-size: 28rpx; font-size: 14px;
font-weight: 500; font-weight: 600;
} }
.funnel-container { .funnel-container {
background-color: rgba(255, 255, 255, 0.4); background-color: rgba(255, 255, 255, 0.6);
border-radius: 16px; border-radius: 12px;
padding: 16px; padding: 12px 16px 12px 16px;
padding-right: 90px; padding-right: 90px;
margin-top: 10px;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
border: 1px solid rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.8);
overflow: visible; overflow: visible;
} }
.funnel-title { .funnel-title {
font-size: 24rpx; font-size: 12px;
font-weight: bold; font-weight: 500;
color: #475569; color: #64748b;
margin-bottom: 24px; margin-bottom: 12px;
} }
.funnel-chart-box { .funnel-chart-box {
width: 192px; width: 172px;
height: 128px; height: 100px;
flex-direction: row; flex-direction: row;
position: relative; position: relative;
align-items: center; align-items: center;
...@@ -138,11 +139,12 @@ const contactRateMasked = computed((): string => { ...@@ -138,11 +139,12 @@ const contactRateMasked = computed((): string => {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
border-radius: 8px; border-radius: 10px;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
overflow: hidden; overflow: hidden;
box-shadow: 0 4px 10px rgba(22, 119, 255, 0.15);
} }
.funnel-bg-layer { .funnel-bg-layer {
...@@ -151,9 +153,8 @@ const contactRateMasked = computed((): string => { ...@@ -151,9 +153,8 @@ const contactRateMasked = computed((): string => {
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: #3b82f6; background-image: linear-gradient(to right bottom, #1677ff, #469cff);
background-image: linear-gradient(to bottom, #3b82f6, #60a5fa); border-radius: 10px;
border-radius: 8px;
} }
.funnel-content { .funnel-content {
...@@ -164,31 +165,31 @@ const contactRateMasked = computed((): string => { ...@@ -164,31 +165,31 @@ const contactRateMasked = computed((): string => {
} }
.funnel-text-sm { .funnel-text-sm {
font-size: 20rpx; font-size: 11px;
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
} }
.funnel-text-lg { .funnel-text-lg {
font-size: 36rpx; font-size: 16px;
font-weight: bold; font-weight: bold;
color: #ffffff; color: #ffffff;
} }
.funnel-divider { .funnel-divider {
width: 126px; width: 110px;
height: 1px; height: 1px;
background-color: rgba(255, 255, 255, 0.3); background-color: rgba(255, 255, 255, 0.3);
margin-top: 8px; margin-top: 4px;
margin-bottom: 8px; margin-bottom: 4px;
} }
.funnel-bracket { .funnel-bracket {
position: absolute; position: absolute;
right: -40px; right: -40px;
top: 50%; top: 50%;
margin-top: -20px; margin-top: -16px;
width: 32px; width: 32px;
height: 40px; height: 32px;
border-left-width: 2px; border-left-width: 2px;
border-left-style: solid; border-left-style: solid;
border-left-color: #60a5fa; border-left-color: #60a5fa;
...@@ -201,18 +202,18 @@ const contactRateMasked = computed((): string => { ...@@ -201,18 +202,18 @@ const contactRateMasked = computed((): string => {
position: absolute; position: absolute;
right: -75px; right: -75px;
top: 50%; top: 50%;
margin-top: -20px; margin-top: -16px;
flex-direction: column; flex-direction: column;
} }
.side-text-sm { .side-text-sm {
font-size: 20rpx; font-size: 11px;
color: #2563eb; color: #1677ff;
} }
.side-text-lg { .side-text-lg {
font-size: 28rpx; font-size: 14px;
font-weight: bold; font-weight: bold;
color: #2563eb; color: #1677ff;
} }
</style> </style>
<template> <template>
<card-container> <card-container>
<view class="title-box"> <view class="title-box">
<text class="title-text">本月产值</text> <text class="title-text">本月业绩</text>
</view> </view>
<view class="output-summary"> <view class="output-summary">
<!-- 左侧数值 -->
<view class="summary-left"> <view class="summary-left">
<text class="summary-label">{{ summary.summaryLabel }}</text> <text class="summary-label">本月预估总产值</text>
<view class="summary-value-box"> <view class="summary-value-box">
<text class="summary-value-num">{{ summaryNumDisplay }}</text> <text class="summary-value-num">{{ summaryNumDisplay }}</text>
<text class="summary-value-unit">{{ summaryUnitDisplay }}</text> <text class="summary-value-unit">{{ summaryUnitDisplay }}</text>
</view> </view>
<view class="summary-personal"> <view class="summary-personal">
<text class="personal-label">{{ summary.personalLabel }}</text> <text class="personal-label">个人产值占比:</text>
<text class="personal-value">{{ personalValueDisplay }}</text> <text class="personal-value">{{ personalValueDisplay }}</text>
</view> </view>
</view> </view>
<!-- 右侧环形图 -->
<view class="summary-right"> <view class="summary-right">
<view class="ring-chart-wrap"> <view class="ring-chart-wrap">
<!-- 底部灰色环 -->
<view class="ring-bg"></view> <view class="ring-bg"></view>
<view class="ring-progress-wrap">
<!-- 进度半圆 -->
<view v-if="metricsVisible" class="ring-progress-wrap">
<view class="ring-half ring-half-left"> <view class="ring-half ring-half-left">
<view class="ring-half-inner" :style="ringLeftStyle"></view> <view class="ring-half-inner" :style="ringLeftStyle"></view>
</view> </view>
...@@ -26,22 +33,25 @@ ...@@ -26,22 +33,25 @@
<view class="ring-half-inner" :style="ringRightStyle"></view> <view class="ring-half-inner" :style="ringRightStyle"></view>
</view> </view>
</view> </view>
<view class="ring-center">
<text class="ring-percent">{{ ringPercentDisplay }}</text> <!-- 中间文本 -->
<text class="ring-label">{{ summary.ringLabel }}</text> <view class="ring-inner-text">
<text class="ring-value">{{ ringPercentDisplay }}</text>
<text class="ring-label">个人业绩占比</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="target-count-box">
<view class="left-count-box"> <!-- 底部指标 -->
<text class="left-count-text">目标</text> <view class="month-target-box">
<text class="left-count-value">{{ targetValueDisplay }}</text> <view class="target-item">
<text class="target-label">本月目标产值</text>
<text class="target-value">{{ targetValueDisplay }}</text>
</view> </view>
<view class="target-count-divider"></view> <view class="target-item">
<view class="right-count-box"> <text class="target-label">本月达成</text>
<text class="right-count-text">达成比例</text> <text class="target-value">{{ achievementValueDisplay }}</text>
<text class="right-count-value">{{ achievementValueDisplay }}</text>
</view> </view>
</view> </view>
</card-container> </card-container>
...@@ -50,7 +60,7 @@ ...@@ -50,7 +60,7 @@
<script setup lang="uts"> <script setup lang="uts">
import { computed } from 'vue' import { computed } from 'vue'
import CardContainer from './CardContainer.uvue' import CardContainer from './CardContainer.uvue'
import type { OutputSummary } from './reception-output-types.uts' import type { OutputSummary } from '../types/reception-output-types.uts'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
...@@ -143,15 +153,15 @@ const ringRightStyle = computed(() => { ...@@ -143,15 +153,15 @@ const ringRightStyle = computed(() => {
.title-text { .title-text {
color: #333333; color: #333333;
font-size: 28rpx; font-size: 14px;
font-weight: 500; font-weight: 600;
} }
.output-summary { .output-summary {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 40px; margin-top: 24px;
} }
.summary-left { .summary-left {
...@@ -159,40 +169,46 @@ const ringRightStyle = computed(() => { ...@@ -159,40 +169,46 @@ const ringRightStyle = computed(() => {
} }
.summary-label { .summary-label {
font-size: 24rpx; font-size: 12px;
color: #94a3b8; color: #64748b;
margin-bottom: 4px; margin-bottom: 6px;
} }
.summary-value-box { .summary-value-box {
flex-direction: row; flex-direction: row;
align-items: flex-end; align-items: baseline;
} }
.summary-value-num { .summary-value-num {
font-size: 48rpx; font-size: 28px;
font-weight: bold; font-weight: bold;
color: #2563eb; color: #1677ff;
} }
.summary-value-unit { .summary-value-unit {
font-size: 28rpx; font-size: 14px;
color: #2563eb; color: #1677ff;
margin-left: 2px;
} }
.summary-personal { .summary-personal {
flex-direction: row; flex-direction: row;
margin-top: 4px; margin-top: 8px;
background-color: rgba(22, 119, 255, 0.05);
padding: 4px 8px;
border-radius: 4px;
} }
.personal-label { .personal-label {
font-size: 20rpx; font-size: 11px;
color: #94a3b8; color: #64748b;
} }
.personal-value { .personal-value {
font-size: 20rpx; font-size: 11px;
color: #3b82f6; font-weight: 600;
color: #1677ff;
margin-left: 4px;
} }
.summary-right { .summary-right {
...@@ -203,20 +219,20 @@ const ringRightStyle = computed(() => { ...@@ -203,20 +219,20 @@ const ringRightStyle = computed(() => {
.ring-chart-wrap { .ring-chart-wrap {
position: relative; position: relative;
width: 96px; width: 90px;
height: 96px; height: 90px;
} }
.ring-bg { .ring-bg {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 96px; width: 90px;
height: 96px; height: 90px;
border-radius: 48px; border-radius: 45px;
border-width: 8px; border-width: 6px;
border-style: solid; border-style: solid;
border-color: #e2e8f0; border-color: rgba(22, 119, 255, 0.08);
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -224,15 +240,15 @@ const ringRightStyle = computed(() => { ...@@ -224,15 +240,15 @@ const ringRightStyle = computed(() => {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 96px; width: 90px;
height: 96px; height: 90px;
} }
.ring-half { .ring-half {
position: absolute; position: absolute;
top: 0; top: 0;
width: 48px; width: 45px;
height: 96px; height: 90px;
overflow: hidden; overflow: hidden;
} }
...@@ -241,98 +257,79 @@ const ringRightStyle = computed(() => { ...@@ -241,98 +257,79 @@ const ringRightStyle = computed(() => {
} }
.ring-half-right { .ring-half-right {
left: 48px; left: 45px;
} }
.ring-half-inner { .ring-half-inner {
position: absolute; position: absolute;
width: 96px; width: 90px;
height: 96px; height: 90px;
border-radius: 48px; border-radius: 45px;
border-width: 8px; border-width: 6px;
border-style: solid; border-style: solid;
border-color: #3b82f6; border-color: #1677ff;
box-sizing: border-box; box-sizing: border-box;
transform-origin: 48px 48px; transform-origin: 45px 45px;
} }
.ring-half-left .ring-half-inner { .ring-half-left .ring-half-inner {
left: 0; left: 0;
top: 0; border-right-color: transparent;
border-bottom-color: transparent;
} }
.ring-half-right .ring-half-inner { .ring-half-right .ring-half-inner {
left: -48px; left: -45px;
top: 0; border-left-color: transparent;
border-bottom-color: transparent;
} }
.ring-center { .ring-inner-text {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 96px; right: 0;
height: 96px; bottom: 0;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 2;
} }
.ring-percent { .ring-value {
font-size: 24rpx; font-size: 16px;
font-weight: bold; font-weight: bold;
color: #1e293b; color: #1e293b;
} }
.ring-label { .ring-label {
font-size: 16rpx; font-size: 10px;
color: #94a3b8; color: #64748b;
margin-top: 2px;
} }
.target-count-box { .month-target-box {
flex-direction: row; flex-direction: row;
align-items: center; justify-content: space-between;
width: 100%; margin-top: 24px;
height: 29px; padding-top: 16px;
border-radius: 225px; border-top-width: 1px;
opacity: 1; border-top-style: solid;
background-color: #4673ff0d; border-top-color: rgba(0, 0, 0, 0.04);
margin-top: 10px;
}
.left-count-text,
.right-count-text {
color: #333333;
}
.left-count-value,
.right-count-value {
color: #4673ff;
margin-left: 4px;
} }
.left-count-text, .target-item {
.left-count-value, flex-direction: column;
.right-count-text,
.right-count-value {
font-size: 24rpx;
font-weight: 700;
} }
.left-count-box, .target-label {
.right-count-box { font-size: 12px;
flex: 1; color: #64748b;
flex-direction: row;
align-items: center;
justify-content: center;
min-width: 0;
height: 100%;
} }
.target-count-divider { .target-value {
width: 1px; font-size: 14px;
height: 14px; font-weight: 600;
flex-shrink: 0; color: #1e293b;
background-color: rgba(70, 115, 255, 0.2); margin-top: 4px;
} }
</style> </style>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<script setup lang="uts"> <script setup lang="uts">
import CardContainer from './CardContainer.uvue' import CardContainer from './CardContainer.uvue'
import type { CompareRow } from './reception-output-types.uts' import type { CompareRow } from '../types/reception-output-types.uts'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
...@@ -68,7 +68,7 @@ const onSegmentedTabIndex = (v: number): void => { ...@@ -68,7 +68,7 @@ const onSegmentedTabIndex = (v: number): void => {
.tabs-box { .tabs-box {
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
margin-bottom: 32rpx; margin-bottom: 24px;
} }
.compare-section { .compare-section {
...@@ -78,7 +78,7 @@ const onSegmentedTabIndex = (v: number): void => { ...@@ -78,7 +78,7 @@ const onSegmentedTabIndex = (v: number): void => {
.compare-row { .compare-row {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
margin-bottom: 24rpx; margin-bottom: 16px;
} }
.compare-row-last { .compare-row-last {
...@@ -86,39 +86,39 @@ const onSegmentedTabIndex = (v: number): void => { ...@@ -86,39 +86,39 @@ const onSegmentedTabIndex = (v: number): void => {
} }
.compare-label { .compare-label {
font-size: 24rpx; font-size: 13px;
color: #64748b; color: #64748b;
width: 150rpx; width: 90px;
} }
.compare-bar-bg { .compare-bar-bg {
flex: 1; flex: 1;
height: 8rpx; height: 6px;
background-color: #f1f5f9; background-color: rgba(22, 119, 255, 0.08);
border-radius: 999rpx; border-radius: 4px;
margin-right: 16rpx; margin-right: 12px;
overflow: hidden; overflow: hidden;
flex-direction: row; flex-direction: row;
} }
.compare-bar-fill { .compare-bar-fill {
height: 100%; height: 100%;
border-radius: 999rpx; border-radius: 4px;
} }
.bg-blue-500 { .bg-blue-500 {
background-color: #3b82f6; background-image: linear-gradient(to right, #1677ff, #469cff);
} }
.bg-blue-400 { .bg-blue-400 {
background-color: #60a5fa; background-image: linear-gradient(to right, #60a5fa, #93c5fd);
} }
.compare-value { .compare-value {
font-size: 24rpx; font-size: 13px;
font-weight: bold; font-weight: 600;
color: #1e293b; color: #1e293b;
width: 96rpx; width: 60px;
text-align: right; text-align: right;
} }
</style> </style>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
if (wh != null) { if (wh != null) {
const h = wh as number const h = wh as number
if (h > 0) { if (h > 0) {
sheetPanelHeightPx.value = Math.floor(h / 2) sheetPanelHeightPx.value = Math.floor(h * 0.85)
return return
} }
} }
...@@ -617,34 +617,45 @@ ...@@ -617,34 +617,45 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-start;
} }
.tag-item { .tag-item {
padding-left: 16px; padding-left: 12px;
padding-right: 16px; padding-right: 12px;
padding-top: 8px; padding-top: 6px;
padding-bottom: 8px; padding-bottom: 6px;
margin-right: 12px; margin-right: 10px;
margin-bottom: 12px; margin-bottom: 10px;
border-width: 1px; border-width: 1px;
border-style: solid; border-style: solid;
border-color: #dce0e6; border-color: rgba(0, 0, 0, 0.05);
border-radius: 16px; border-radius: 14px;
background-color: #ffffff; background-color: #f8f9fa;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
transition: all 0.2s ease;
max-width: 100%;
} }
.tag-item.checked { .tag-item.checked {
border-color: #292d33; border-color: rgba(22, 119, 255, 0.3);
background-color: #f5f6f7; background-color: rgba(22, 119, 255, 0.05);
} }
.tag-text { .tag-text {
font-size: 15px; font-size: 13px;
color: #333333; color: #495057;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
/* 处理过长文本换行或省略 */
lines: 2;
text-overflow: ellipsis;
}
.tag-item.checked .tag-text {
color: #1677FF;
font-weight: 500;
} }
</style> </style>
<template>
<view
v-if="listSubTabIndex == 0"
class="filter-group filter-group-compact filter-group-entry-segmented filter-group-entry-segmented--half glass-card"
>
<view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented
type="card"
bg-color="rgba(241, 245, 249, 0.5)"
:height="40"
active-color="#000000"
:model-value="entryFilterIndex"
@update:model-value="emit('switchEntryFilterTab', $event)"
>
<un-segmented-item text="今日到店"></un-segmented-item>
<un-segmented-item text="全部客户"></un-segmented-item>
</un-segmented>
</view>
</view>
<view
v-if="listSubTabIndex == 1"
class="filter-group filter-group-compact filter-group-entry-segmented filter-group-entry-segmented--half glass-card"
>
<view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented
shape="circle"
type="card"
:height="40"
bg-color="rgba(241, 245, 249, 0.5)"
active-color="#000000"
:model-value="filterTabIndex"
@update:model-value="emit('switchFilterTab', $event)"
>
<un-segmented-item text="已提交"></un-segmented-item>
<un-segmented-item text="未提交"></un-segmented-item>
</un-segmented>
</view>
</view>
<view v-if="listSubTabIndex == 0" class="filter-actions">
<view class="pre-entry-btn" @click="emit('customerEntryClick')">
<view class="pre-entry-btn-icon-wrap">
<un-icon name="plus" color="#64748b" size="11"></un-icon>
</view>
<text class="pre-entry-btn-text">预录信息</text>
</view>
</view>
</template>
<script setup lang="uts">
const props = defineProps<{
listSubTabIndex: number
entryFilterIndex: number
filterTabIndex: number
}>()
const emit = defineEmits<{
switchEntryFilterTab: [number]
switchFilterTab: [number]
customerEntryClick: []
}>()
</script>
<style>
@import "../styles/reception-filter-shared.css";
.filter-group-compact.filter-group-entry-segmented {
flex: 1 1 0;
min-width: 120px;
}
.filter-group-compact.filter-group-entry-segmented.filter-group-entry-segmented--half {
flex-grow: 0;
flex-shrink: 0;
flex-basis: 50%;
width: 50%;
max-width: 50%;
min-width: 0;
}
.pre-entry-btn {
height: 40px;
padding-left: 14px;
padding-right: 14px;
border-radius: 8px;
background-color: #ffffff;
border: 1px solid #dbe3ee;
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
min-width: 96px;
}
.pre-entry-btn-icon-wrap {
width: 16px;
height: 16px;
border-radius: 999px;
background-color: #f1f5f9;
border: 1px solid #dbe3ee;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.pre-entry-btn-text {
margin-left: 6px;
color: #475569;
font-size: 13px;
font-weight: 600;
line-height: 1;
}
.pre-entry-btn .pre-entry-btn-text {
color: #475569;
}
</style>
<template>
<view class="filter-actions filter-actions--review" v-if="listSubTabIndex == 1">
<view
v-if="filterTabIndex == 0"
class="filter-group filter-group-compact glass-card review-tabs-wrap review-tabs-wrap-wide"
>
<view class="filter-tabs-row entry-filter-segmented-wrap filter-dropdown-row">
<view class="tag-box tag-box--filter" @click="emit('openSubmittedResultPicker')">
<text class="tag-text">{{ submittedResultLabel }}</text>
<image class="tag-arrow-icon" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" />
</view>
</view>
</view>
<view
v-if="filterTabIndex == 0"
class="filter-group filter-group-compact glass-card review-tabs-wrap review-tabs-wrap-wide"
>
<view class="filter-tabs-row entry-filter-segmented-wrap filter-dropdown-row">
<view class="tag-box tag-box--filter" @click="emit('openReviewPicker')">
<text class="tag-text">{{ reviewTabLabel }}</text>
<image class="tag-arrow-icon" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" />
</view>
</view>
</view>
<view
v-if="filterTabIndex == 1"
class="filter-group filter-group-compact glass-card review-tabs-wrap review-tabs-wrap-wide"
>
<view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented
type="card"
:height="40"
bg-color="rgba(241, 245, 249, 0.5)"
active-color="#000000"
:model-value="unsubmittedPendingTabIndex"
@update:model-value="emit('switchUnsubmittedPendingTab', $event)"
>
<un-segmented-item text="待上传"></un-segmented-item>
<un-segmented-item text="待提交"></un-segmented-item>
</un-segmented>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { computed } from 'vue'
const props = defineProps<{
listSubTabIndex: number
filterTabIndex: number
submittedResultTabIndex: number
reviewTabIndex: number
unsubmittedPendingTabIndex: number
}>()
const emit = defineEmits<{
openSubmittedResultPicker: []
openReviewPicker: []
switchUnsubmittedPendingTab: [number]
}>()
const submittedResultLabel = computed((): string => {
return props.submittedResultTabIndex == 0 ? '战败' : '成交'
})
const reviewTabLabel = computed((): string => {
return props.reviewTabIndex == 0 ? '已复盘' : '未复盘'
})
</script>
<style>
@import "../styles/reception-filter-shared.css";
.filter-actions.filter-actions--review {
flex: 2 1 0;
min-width: 0;
margin-left: 8px;
}
.filter-actions--review .review-tabs-wrap {
flex: 1 1 0;
min-width: 0;
background: #f3f7fd;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 2px;
box-sizing: border-box;
}
.filter-actions--review .review-tabs-wrap:not(:first-child) {
margin-left: 6px;
}
.filter-dropdown-row {
align-items: stretch;
width: 100%;
height: 100%;
}
.tag-box {
background-color: rgba(255, 255, 255, 0.5);
padding: 4px 12px;
border-radius: 999px;
border: 1px solid rgba(226, 232, 240, 1);
flex-direction: row;
align-items: center;
}
.tag-box--filter {
flex: 1;
width: 100%;
height: 100%;
min-height: 42px;
padding: 0 14px;
justify-content: space-between;
border-radius: 10px;
background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
border: 1px solid #dbe6f5;
box-shadow: 0 1px 3px rgba(30, 41, 59, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
box-sizing: border-box;
}
.tag-text {
font-size: 12px;
color: #333333;
}
.tag-box--filter .tag-text {
font-size: 13px;
font-weight: 600;
color: #334155;
}
.tag-arrow-icon {
width: 18px;
height: 18px;
margin-left: 4px;
}
.tag-box--filter .tag-arrow-icon {
width: 14px;
height: 14px;
margin-left: 8px;
opacity: 0.8;
}
</style>
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
:style="tagScrollStyle" :style="tagScrollStyle"
> >
<list-item class="tag-list-item" :type="0"> <list-item class="tag-list-item" :type="0">
<view class="tag-box"> <view class="view-content">
<template v-for="(item, index) in sceneList" :key="index"> <template v-for="(item, index) in sceneList" :key="index">
<view <view
class="tag-item" class="select-item"
:class="{ checked: isRowChecked(item as UTSJSONObject) }" :class="{ 'is-active': isRowChecked(item as UTSJSONObject) }"
@click="onTapRow(item as UTSJSONObject)" @click="onTapRow(item as UTSJSONObject)"
> >
<text class="tag-text">{{ (item as UTSJSONObject)['label'] }}</text> <text class="select-item-text" :class="{ 'is-active-text': isRowChecked(item as UTSJSONObject) }">{{ (item as UTSJSONObject)['label'] }}</text>
</view> </view>
</template> </template>
</view> </view>
...@@ -254,38 +254,50 @@ ...@@ -254,38 +254,50 @@
flex-shrink: 0; flex-shrink: 0;
} }
.tag-box { .view-content {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between;
width: 100%;
padding: 0 16px;
box-sizing: border-box;
} }
.tag-item { .select-item {
padding-left: 16px; width: 48%;
padding-right: 16px;
padding-top: 8px;
padding-bottom: 8px;
margin-right: 12px;
margin-bottom: 12px; margin-bottom: 12px;
border-width: 1px; height: 44px;
border-style: solid; background-color: #f8f9fa;
border-color: #dce0e6; border-radius: 8px;
border-radius: 16px; display: flex;
background-color: #ffffff;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border: 1px solid transparent;
transition-property: background-color, border-color;
transition-duration: 0.2s;
} }
.tag-item.checked { .select-item:active {
border-color: #292d33; background-color: #f1f3f5;
background-color: #f5f6f7;
} }
.tag-text { .is-active {
font-size: 15px; background-color: rgba(22, 119, 255, 0.05);
color: #333333; border: 1px solid rgba(22, 119, 255, 0.3);
}
.select-item-text {
text-align: center; text-align: center;
font-weight: 400; color: #495057;
font-size: 15px;
line-height: 20px;
font-weight: 500;
}
.is-active-text {
color: #1677FF;
font-weight: 600;
} }
</style> </style>
...@@ -4,20 +4,19 @@ ...@@ -4,20 +4,19 @@
<view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view> <view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view>
<view class="form-detail-top-bar"> <view class="form-detail-top-bar">
<view class="form-detail-back-btn" @click="handleClose"> <view class="form-detail-back-btn" @click="handleClose">
<un-icon name="arrow-left"></un-icon> <un-icon name="arrow-left" size="20"></un-icon>
</view> </view>
</view> </view>
<view class="form-detail-wrap" :style="formDetailWrapStyle"> <view class="form-detail-wrap">
<view class="form-detail-header"> <view class="form-detail-header">
<text class="form-detail-title">客户档案</text> <text class="form-detail-title">客户档案</text>
</view> </view>
<!-- 商品区:单个 list-item,内部按行循环;行间间距由 goods-row-wrap / goods-row-last 控制 --> <!-- 使用 flex: 1 自动撑满剩余空间,避免底部留白 -->
<list-view <list-view
class="form-detail-scroll" class="form-detail-scroll"
direction="vertical" direction="vertical"
:bounces="false" :bounces="false"
:show-scrollbar="false" :show-scrollbar="false"
:style="scrollViewStyle"
> >
<list-item class="form-detail-li form-detail-li--head" :type="0"> <list-item class="form-detail-li form-detail-li--head" :type="0">
<view class="form-detail-body"> <view class="form-detail-body">
...@@ -138,78 +137,33 @@ const props = withDefaults( ...@@ -138,78 +137,33 @@ const props = withDefaults(
{ show: false, detail: null } { show: false, detail: null }
) )
/** 弹窗打开后:先等于 props.detail,接口成功则替换为详情 data */ function syncReceptionSafeTopSpacer(): void {
const resolvedDetail = ref<UTSJSONObject | null>(null)
/** getMaterialResponsePage 成功后的卡片数据;关闭弹窗时清空 */
const materialGoodsCards = ref<GoodsCardItem[]>([])
/** 仅在接口成功返回业务 data 后为 true,失败或未请求时回退 parseGoodsListFromDetail */
const materialGoodsFromApi = ref(false)
/** 弹层内父级常无法把 height:100% 传到子节点;list-view 需明确 px 高度才能纵向滚动 */
const wrapHeightPx = ref(667)
const scrollAreaHeightPx = ref(400)
/** 上下 padding 24+24、标题区(含 margin)约 56,略留余量给关闭按钮与行高差异 */
const FORM_DETAIL_VERTICAL_RESERVE = 120
function updateLayoutHeights(): void {
const info = uni.getWindowInfo() const info = uni.getWindowInfo()
const wh = info.windowHeight > 0 ? info.windowHeight : info.screenHeight receptionPageInsetTopPx.value = calcReceptionSafeTopInsetPx(info)
const fullH = wh > 0 ? wh : 667 }
// 全屏覆盖层内:内容区 = 窗口高度 − 顶部安全区 − 顶部返回栏
const topInset = calcReceptionSafeTopInsetPx(info)
receptionPageInsetTopPx.value = topInset
const contentH = fullH - FORM_DETAIL_TOP_BAR_PX - topInset
wrapHeightPx.value = contentH > 200 ? contentH : 200
const scrollH = wrapHeightPx.value - FORM_DETAIL_VERTICAL_RESERVE
scrollAreaHeightPx.value = scrollH > 160 ? scrollH : 160
}
const formDetailWrapStyle = computed((): UTSJSONObject => {
return {
height: `${wrapHeightPx.value}px`
} as UTSJSONObject
})
const scrollViewStyle = computed((): UTSJSONObject => {
return {
height: `${scrollAreaHeightPx.value}px`
} as UTSJSONObject
})
// uview-unix 在部分端/旋转时安全区会变化;用轮询兜底刷新布局
const FORM_DETAIL_LAYOUT_POLL_MS = 400
let formDetailLayoutPollId: number | null = null let formDetailLayoutPollId: number | null = null
onMounted(() => { onMounted(() => {
updateLayoutHeights() syncReceptionSafeTopSpacer()
formDetailLayoutPollId = setInterval(() => { formDetailLayoutPollId = setInterval(syncReceptionSafeTopSpacer, 400)
updateLayoutHeights()
}, FORM_DETAIL_LAYOUT_POLL_MS)
})
/** UTS 无法为 toRef(props,'show') 推断泛型;用显式 boolean 的 computed 再 watch(同 CustomPopup) */
const showForLayout = computed((): boolean => {
return props.show === true
})
watch(showForLayout, (visible: boolean) => {
if (visible) {
updateLayoutHeights()
nextTick(() => {
updateLayoutHeights()
})
}
}) })
onUnmounted(() => { onUnmounted(() => {
const tid = formDetailLayoutPollId if (formDetailLayoutPollId != null) {
if (tid != null) { clearInterval(formDetailLayoutPollId as number)
clearInterval(tid)
formDetailLayoutPollId = null formDetailLayoutPollId = null
} }
}) })
/** 弹窗打开后:先等于 props.detail,接口成功则替换为详情 data */
const resolvedDetail = ref<UTSJSONObject | null>(null)
/** getMaterialResponsePage 成功后的卡片数据;关闭弹窗时清空 */
const materialGoodsCards = ref<GoodsCardItem[]>([])
/** 仅在接口成功返回业务 data 后为 true,失败或未请求时回退 parseGoodsListFromDetail */
const materialGoodsFromApi = ref(false)
function fieldStr(data: UTSJSONObject, key: string): string { function fieldStr(data: UTSJSONObject, key: string): string {
const v = data[key] const v = data[key]
if (v == null) { if (v == null) {
...@@ -322,9 +276,9 @@ watch( ...@@ -322,9 +276,9 @@ watch(
materialGoodsFromApi.value = false materialGoodsFromApi.value = false
return return
} }
updateLayoutHeights() syncReceptionSafeTopSpacer()
nextTick(() => { nextTick(() => {
updateLayoutHeights() syncReceptionSafeTopSpacer()
}) })
const r = props.detail const r = props.detail
if (r == null) { if (r == null) {
...@@ -739,7 +693,11 @@ function handleClose(): void { ...@@ -739,7 +693,11 @@ function handleClose(): void {
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 0; position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
background-color: #ffffff; background-color: #ffffff;
...@@ -775,11 +733,10 @@ function handleClose(): void { ...@@ -775,11 +733,10 @@ function handleClose(): void {
flex-direction: column; flex-direction: column;
align-items: stretch; align-items: stretch;
width: 100%; width: 100%;
/* 高度由内联 wrapHeightPx 绑定,避免弹层 slot 未传递高度导致 100% 失效 */ flex: 1;
min-height: 0; min-height: 0;
padding: 24px 0 0; padding: 8px 0 0;
padding-bottom: 24px; padding-bottom: 24px;
/* Android:勿对滚动父级用 overflow:hidden,易导致子 list-view 手势/裁剪异常 */
overflow: visible; overflow: visible;
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -799,9 +756,8 @@ function handleClose(): void { ...@@ -799,9 +756,8 @@ function handleClose(): void {
.form-detail-scroll { .form-detail-scroll {
width: 100%; width: 100%;
align-self: stretch; flex: 1;
box-sizing: border-box; box-sizing: border-box;
flex-shrink: 0;
padding-bottom: 24px; padding-bottom: 24px;
} }
......
...@@ -207,17 +207,17 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -207,17 +207,17 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
} }
.glass-card { .glass-card {
background-color: rgba(255, 255, 255, 0.7); background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.6);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
border-radius: 16px; border-radius: 16px;
flex-direction: column; flex-direction: column;
} }
.list-card { .list-card {
padding: 20px; padding: 16px;
border-radius: 24px; border-radius: 16px;
margin-bottom: 16px; margin-bottom: 12px;
} }
.list-card-entry { .list-card-entry {
...@@ -231,7 +231,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -231,7 +231,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
border-radius: 24px; border-radius: 16px;
background-color: rgba(15, 23, 42, 0.78); background-color: rgba(15, 23, 42, 0.78);
flex-direction: column; flex-direction: column;
z-index: 10; z-index: 10;
...@@ -282,6 +282,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -282,6 +282,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
margin-bottom: 16px; margin-bottom: 16px;
align-items: flex-start;
} }
.card-title-box { .card-title-box {
...@@ -289,35 +290,48 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -289,35 +290,48 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
} }
.card-name { .card-name {
font-size: 36rpx; font-size: 18px;
font-weight: bold; font-weight: 600;
color: #1e293b; color: #1e293b;
} }
.card-car { .card-car {
font-size: 28rpx; font-size: 14px;
font-weight: bold; font-weight: 600;
color: #0055ff; color: #1677ff;
margin-top: 4px; margin-top: 6px;
} }
.card-info-list { .card-info-list {
flex-direction: column; flex-direction: column;
/* 移除内层块的背景色,让信息与外卡片完全融为一体,不产生框中框的割裂感 */
background-color: transparent;
padding: 0;
margin-top: 12px;
} }
.info-row { .info-row {
flex-direction: row; flex-direction: row;
/* 使用 space-between 让 Label 靠左,Value 靠右 */
justify-content: space-between; justify-content: space-between;
margin-bottom: 10px; margin-bottom: 10px;
} }
.info-row:last-child {
margin-bottom: 0;
}
.info-label { .info-label {
font-size: 24rpx; font-size: 13px;
color: #64748b; color: #64748b;
flex-shrink: 0;
} }
.info-value { .info-value {
font-size: 24rpx; font-size: 13px;
color: #334155; color: #334155;
font-weight: 500;
text-align: right;
flex: 1;
} }
</style> </style>
...@@ -188,23 +188,24 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -188,23 +188,24 @@ function onCardClick(item: UTSJSONObject): void {
} }
.glass-card { .glass-card {
background-color: rgba(255, 255, 255, 0.7); background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.6);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
border-radius: 16px; border-radius: 16px;
flex-direction: column; flex-direction: column;
} }
.list-card { .list-card {
padding: 20px; padding: 16px;
border-radius: 24px; border-radius: 16px;
margin-bottom: 16px; margin-bottom: 12px;
} }
.card-header-row { .card-header-row {
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
margin-bottom: 16px; margin-bottom: 16px;
align-items: flex-start;
} }
.card-title-box { .card-title-box {
...@@ -212,16 +213,16 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -212,16 +213,16 @@ function onCardClick(item: UTSJSONObject): void {
} }
.card-name { .card-name {
font-size: 36rpx; font-size: 18px;
font-weight: bold; font-weight: 600;
color: #1e293b; color: #1e293b;
} }
.card-car { .card-car {
font-size: 28rpx; font-size: 14px;
font-weight: bold; font-weight: 600;
color: #0055ff; color: #1677ff;
margin-top: 4px; margin-top: 6px;
} }
.card-status-box { .card-status-box {
...@@ -230,12 +231,12 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -230,12 +231,12 @@ function onCardClick(item: UTSJSONObject): void {
} }
.status-badge { .status-badge {
padding-top: 2px; padding-top: 4px;
padding-bottom: 2px; padding-bottom: 4px;
padding-left: 6px; padding-left: 8px;
padding-right: 6px; padding-right: 8px;
border-radius: 4px; border-radius: 6px;
margin-left: 4px; margin-left: 6px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
...@@ -251,7 +252,8 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -251,7 +252,8 @@ function onCardClick(item: UTSJSONObject): void {
background-color: #f0fdf4; background-color: #f0fdf4;
} }
.status-text { .status-text {
font-size: 20rpx; font-size: 11px;
font-weight: 500;
} }
.text-slate-400 { .text-slate-400 {
color: #94a3b8; color: #94a3b8;
...@@ -265,6 +267,10 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -265,6 +267,10 @@ function onCardClick(item: UTSJSONObject): void {
.card-info-list { .card-info-list {
flex-direction: column; flex-direction: column;
/* 移除内层块的背景色和 padding,使得内容与大标题对齐 */
background-color: transparent;
padding: 0;
margin-top: 12px;
} }
.info-row { .info-row {
...@@ -278,12 +284,16 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -278,12 +284,16 @@ function onCardClick(item: UTSJSONObject): void {
} }
.info-label { .info-label {
font-size: 24rpx; font-size: 13px;
color: #64748b; color: #64748b;
flex-shrink: 0;
} }
.info-value { .info-value {
font-size: 24rpx; font-size: 13px;
color: #334155; color: #334155;
font-weight: 500;
text-align: right;
flex: 1;
} }
</style> </style>
<template>
<view class="customer-list-panel">
<!-- 筛选区 -->
<view class="filter-bar">
<un-segmented
type="card"
bg-color="rgba(241, 245, 249, 0.5)"
:height="40"
active-color="#000000"
:model-value="entryFilterIndex"
@update:model-value="$emit('switchEntryFilter', $event)"
>
<un-segmented-item text="今日到店"></un-segmented-item>
<un-segmented-item text="全部客户"></un-segmented-item>
</un-segmented>
<un-button
text="预录信息"
icon="plus"
type="primary"
size="small"
@click="$emit('customerEntryClick')"
/>
</view>
<!-- 列表区域 -->
<scroll-view class="list-scroll" scroll-y @scrolltolower="onScrollToLower">
<view v-if="showEmpty" class="empty-wrap">
<CustomEmpty type="base" title="暂无客户记录" />
</view>
<view v-if="!showEmpty" class="list-container">
<ListCustomer
:customer-list="customerList"
:entry-filter-index="entryFilterIndex"
@entry-click="(item) => $emit('entryClick', item)"
@entry-edit="(item) => $emit('entryEdit', item)"
@entry-delete="(item) => $emit('entryDelete', item)"
/>
</view>
<!-- 加载更多 -->
<view class="list-footer">
<text v-if="loadingMore" class="footer-text">加载中...</text>
<text v-else-if="!hasMore && customerList.length > 0" class="footer-text">- 已经到底了 -</text>
</view>
</scroll-view>
</view>
</template>
<script setup lang="uts">
import CustomEmpty from '@/components/CustomEmpty/index.uvue'
const props = defineProps<{
customerList: UTSJSONObject[]
entryFilterIndex: number
showEmpty: boolean
loadingMore: boolean
hasMore: boolean
}>()
defineEmits<{
entryClick: [item: UTSJSONObject]
entryEdit: [item: UTSJSONObject]
entryDelete: [item: UTSJSONObject]
switchEntryFilter: [index: number]
customerEntryClick: []
}>()
function onScrollToLower(): void {
if (props.hasMore && !props.loadingMore) {
console.log('[CustomerListPanel] 触底加载更多')
// 由父组件处理加载逻辑
}
}
</script>
<style lang="scss" scoped>
.customer-list-panel {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.filter-bar {
padding: 12px 16px;
background-color: #ffffff;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e2e8f0;
}
.list-scroll {
flex: 1;
width: 100%;
}
.empty-wrap {
padding: 80px 24px;
}
.list-container {
padding: 12px;
}
.list-footer {
padding: 16px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.footer-text {
font-size: 12px;
color: #94A3B8;
}
</style>
<template>
<view class="dashboard-panel">
<scroll-view class="dashboard-scroll" scroll-y>
<!-- 头部控制区 -->
<view class="dashboard-header">
<view class="header-row">
<view class="title-box">
<text class="dashboard-title">业绩看板</text>
<view class="eye-btn" @click="$emit('toggleMetrics')">
<un-icon v-if="metricsVisible" name="eye" color="#333333" size="24"></un-icon>
<un-icon v-if="!metricsVisible" name="eye-off" color="#2979ff" size="24"></un-icon>
</view>
</view>
<view class="brand-tag" @click="$emit('brandSelect')">
<text class="brand-text">{{ selectedBrand }}</text>
<image class="arrow-icon" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" />
</view>
</view>
<!-- 时间进度条 -->
<view class="progress-section">
<text class="progress-label">时间进度</text>
<view class="progress-bar-bg">
<view class="progress-bar-fill" :style="{ width: timeProgressPercent + '%' }"></view>
</view>
<text class="progress-value">{{ metricsVisible ? timeProgressPercent + '%' : '**' }}</text>
</view>
</view>
<!-- 业务流卡片 -->
<CardFlow :performance-data="performanceData" :metrics-visible="metricsVisible" />
<!-- 产值卡片 -->
<CardOutputValue v-model:tab-index="outputTabIndex" :compare-rows="compareRows" :metrics-visible="metricsVisible" />
<!-- 本月产值卡片 -->
<CardMonthValue
:summary="summary"
:target-value-text="monthValueTargetText"
:achievement-value-text="monthValueAchievementText"
:metrics-visible="metricsVisible"
/>
</scroll-view>
</view>
</template>
<script setup lang="uts">
import { ref, computed } from 'vue'
import CardFlow from '../cards/CardFlow.uvue'
import CardOutputValue from '../cards/CardOutputValue.uvue'
import CardMonthValue from '../cards/CardMonthValue.uvue'
defineProps<{
performanceData: UTSJSONObject
metricsVisible: boolean
selectedBrand: string
selectedBrandValue: number
}>()
defineEmits<{
brandSelect: []
toggleMetrics: []
brandChange: [brand: string, brandValue: number]
}>()
const outputTabIndex = ref(0)
// 时间进度计算
const timeProgress = ref<number>(new Date().getDate())
const timeProgressPercent = computed((): number => {
const now = new Date()
const monthDays = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate()
const percent = monthDays > 0 ? Math.round(timeProgress.value / monthDays * 100) : 0
return percent < 0 ? 0 : (percent > 100 ? 100 : percent)
})
// 产值卡片数据
const compareRows = computed(() => {
const d = props.performanceData
const idx = outputTabIndex.value
if (idx == 0) {
// 转化率 Tab
return [
{ label: '优秀门店均值', barWidthPercent: `${Math.min(100, getNum(d, 'excellentStoreAvgDealRate'))}%`, barClass: 'bg-blue-500', value: getNum(d, 'excellentStoreAvgDealRate').toFixed(1) + '%' },
{ label: '本门店', barWidthPercent: `${Math.min(100, getNum(d, 'thisStoreDealRate'))}%`, barClass: 'bg-blue-400', value: getNum(d, 'thisStoreDealRate').toFixed(1) + '%' },
{ label: '个人', barWidthPercent: `${Math.min(100, getNum(d, 'personalDealRate'))}%`, barClass: 'bg-blue-400', value: getNum(d, 'personalDealRate').toFixed(1) + '%' }
]
} else {
// 客单价 Tab
const eAvg = getNum(d, 'excellentStoreAvgDeal')
const thisVal = getNum(d, 'thisStoreKdj')
const perVal = getNum(d, 'personalKdj')
const maxDeal = Math.max(eAvg, thisVal, perVal)
return [
{ label: '优秀门店均值', barWidthPercent: `${maxDeal > 0 ? (eAvg / maxDeal * 100) : 0}%`, barClass: 'bg-blue-500', value: '¥' + Math.round(eAvg) },
{ label: '本门店', barWidthPercent: `${maxDeal > 0 ? (thisVal / maxDeal * 100) : 0}%`, barClass: 'bg-blue-400', value: '¥' + Math.round(thisVal) },
{ label: '个人', barWidthPercent: `${maxDeal > 0 ? (perVal / maxDeal * 100) : 0}%`, barClass: 'bg-blue-400', value: '¥' + Math.round(perVal) }
]
}
})
const summary = computed(() => {
const d = props.performanceData
return {
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 monthValueTargetText = computed(() => {
const d = props.performanceData
const v = getNum(d, 'targetProduction')
return v > 0 ? v.toFixed(0) + '万' : '-'
})
const monthValueAchievementText = computed(() => {
const d = props.performanceData
const v = getNum(d, 'productionContribution')
return v > 0 ? v.toFixed(0) + '%' : '-'
})
function getNum(data: UTSJSONObject, key: string): number {
const v = data[key]
if (v == null) return 0
if (typeof v == 'number') return v
const n = parseFloat(`${v}`)
return isNaN(n) ? 0 : n
}
</script>
<style lang="scss" scoped>
.dashboard-panel {
width: 100%;
height: 100%;
}
.dashboard-scroll {
width: 100%;
height: 100%;
}
.dashboard-header {
padding: 16px;
background-color: #ffffff;
margin-bottom: 12px;
}
.header-row {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.title-box {
display: flex;
flex-direction: row;
align-items: center;
}
.dashboard-title {
font-size: 18px;
font-weight: bold;
color: #1E293B;
}
.eye-btn {
margin-left: 8px;
padding: 4px;
}
.brand-tag {
background-color: rgba(255, 255, 255, 0.5);
padding: 6px 12px;
border-radius: 999px;
border: 1px solid rgba(226, 232, 240, 1);
display: flex;
flex-direction: row;
align-items: center;
}
.brand-text {
font-size: 13px;
color: #333333;
}
.arrow-icon {
width: 16px;
height: 16px;
margin-left: 4px;
}
.progress-section {
display: flex;
flex-direction: row;
align-items: center;
}
.progress-label {
font-size: 12px;
color: #94A3B8;
margin-right: 8px;
}
.progress-bar-bg {
flex: 1;
height: 6px;
background-color: rgba(255, 255, 255, 0.5);
border-radius: 999px;
overflow: hidden;
}
.progress-bar-fill {
height: 100%;
background-color: #3B82F6;
border-radius: 999px;
transition: width 0.3s ease;
}
.progress-value {
font-size: 12px;
color: #94A3B8;
margin-left: 8px;
min-width: 40px;
text-align: right;
}
</style>
.glass-card {
background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(226, 232, 240, 1);
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
border-radius: 10px;
flex-direction: column;
}
.filter-group {
min-width: 0;
padding: 3px;
border-radius: 8px;
}
.filter-group-compact {
padding: 2px;
border-radius: 6px;
}
.filter-tabs-row {
flex-direction: row;
flex: 1;
width: 100%;
height: 40px;
min-height: 40px;
}
.entry-filter-segmented-wrap {
align-items: stretch;
}
.entry-filter-segmented-wrap .un-segmented {
flex: 1;
width: 100%;
border-width: 0;
background-color: rgba(0, 0, 0, 0.04);
border-radius: 10px;
padding: 2px;
}
.entry-filter-segmented-wrap .un-segmented__item {
border-width: 0;
border-radius: 10px;
}
.entry-filter-segmented-wrap .un-segmented__item .un-segmented__item__text {
color: #64748b;
font-size: 14px;
}
.entry-filter-segmented-wrap .un-segmented__item--active {
background-color: #ffffff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.entry-filter-segmented-wrap .un-segmented__item--active .un-segmented__item__text {
color: #1677ff;
font-weight: 600;
}
.filter-actions {
flex-direction: row;
flex-wrap: nowrap;
flex-grow: 0;
flex-shrink: 0;
margin-left: auto;
}
<template>
<view class="list-content-wrapper">
<scroll-view
class="list-scroll-view"
:scroll-y="true"
:lower-threshold="120"
@scrolltolower="emit('scrollLower')"
>
<view class="sub-tabs-row">
<view class="sub-tabs-shell">
<view
class="sub-tab-item"
:class="{ 'sub-tab-active': listSubTabIndex == 0 }"
@click="emit('switchListSubTab', 0)"
>
<text class="sub-tab-title" :class="{ 'sub-tab-title-active': listSubTabIndex == 0 }">客户录入</text>
<text class="sub-tab-caption" :class="{ 'sub-tab-caption-active': listSubTabIndex == 0 }">线索跟进</text>
</view>
<view
class="sub-tab-item"
:class="{ 'sub-tab-active': listSubTabIndex == 1 }"
@click="emit('switchListSubTab', 1)"
>
<text class="sub-tab-title" :class="{ 'sub-tab-title-active': listSubTabIndex == 1 }">接待复盘</text>
<text class="sub-tab-caption" :class="{ 'sub-tab-caption-active': listSubTabIndex == 1 }">流程闭环</text>
</view>
</view>
</view>
<view class="filter-section" :class="{ 'filter-section--wrap': receptionFilterNarrowMode }">
<ReceptionListPrimaryFilter
:list-sub-tab-index="listSubTabIndex"
:entry-filter-index="entryFilterIndex"
:filter-tab-index="filterTabIndex"
@switch-entry-filter-tab="emit('switchEntryFilterTab', $event)"
@switch-filter-tab="emit('switchFilterTab', $event)"
@customer-entry-click="emit('customerEntryClick')"
/>
<ReceptionListSecondaryFilter
:list-sub-tab-index="listSubTabIndex"
:filter-tab-index="filterTabIndex"
:submitted-result-tab-index="submittedResultTabIndex"
:review-tab-index="reviewTabIndex"
:unsubmitted-pending-tab-index="unsubmittedPendingTabIndex"
@open-submitted-result-picker="emit('openSubmittedResultPicker')"
@open-review-picker="emit('openReviewPicker')"
@switch-unsubmitted-pending-tab="emit('switchUnsubmittedPendingTab', $event)"
/>
</view>
<view class="list-container">
<view v-if="listSubTabIndex == 0" class="right-tab-list-panel">
<CustomEmpty v-if="showCustomerEmpty" type="base" title="暂无客户记录" />
<ListCustomer
v-if="showCustomerEmpty != true"
:customer-list="customerList"
:entry-filter-index="entryFilterIndex"
@entry-click="emit('entryClick', $event)"
@entry-edit="emit('entryEdit', $event)"
@entry-delete="emit('entryDelete', $event)"
/>
</view>
<view v-if="listSubTabIndex == 1" class="right-tab-list-panel">
<CustomEmpty v-if="showReceptionEmpty" type="base" title="暂无接待记录" />
<ListReception
v-if="showReceptionEmpty != true"
:reception-record-list="receptionRecordList"
@reception-click="emit('receptionClick', $event)"
/>
</view>
<view v-if="listSubTabIndex == 0" class="list-footer">
<text v-if="customerListLoadingMore == true" class="list-footer-text">加载中...</text>
<text v-else-if="customerListHasMore != true && customerList.length > 0" class="list-footer-text">- 已经到底了 -</text>
</view>
<view v-if="listSubTabIndex == 1" class="list-footer">
<text v-if="receptionListLoadingMore == true" class="list-footer-text">加载中...</text>
<text v-else-if="receptionListHasMore != true && receptionRecordList.length > 0" class="list-footer-text">- 已经到底了 -</text>
</view>
</view>
</scroll-view>
</view>
</template>
<script setup lang="uts">
import { computed } from 'vue'
import ListCustomer from '../lists/ListCustomer.uvue'
import ListReception from '../lists/ListReception.uvue'
import CustomEmpty from '@/components/CustomEmpty/index.uvue'
import ReceptionListPrimaryFilter from '../filters/ReceptionListPrimaryFilter.uvue'
import ReceptionListSecondaryFilter from '../filters/ReceptionListSecondaryFilter.uvue'
const props = defineProps<{
listSubTabIndex: number
receptionFilterNarrowMode: boolean
entryFilterIndex: number
filterTabIndex: number
submittedResultTabIndex: number
reviewTabIndex: number
unsubmittedPendingTabIndex: number
customerList: UTSJSONObject[]
receptionRecordList: UTSJSONObject[]
customerListLoadingMore: boolean
customerListHasMore: boolean
receptionListLoadingMore: boolean
receptionListHasMore: boolean
}>()
const emit = defineEmits<{
scrollLower: []
switchListSubTab: [number]
switchEntryFilterTab: [number]
switchFilterTab: [number]
openSubmittedResultPicker: []
openReviewPicker: []
switchUnsubmittedPendingTab: [number]
customerEntryClick: []
entryClick: [UTSJSONObject]
entryEdit: [UTSJSONObject]
entryDelete: [UTSJSONObject]
receptionClick: [UTSJSONObject]
}>()
const showCustomerEmpty = computed((): boolean => {
return props.customerList.length == 0 && props.customerListHasMore != true && props.customerListLoadingMore != true
})
const showReceptionEmpty = computed((): boolean => {
return props.receptionRecordList.length == 0 && props.receptionListHasMore != true && props.receptionListLoadingMore != true
})
</script>
<style>
.list-content-wrapper {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}
.list-scroll-view {
flex: 1;
min-height: 0;
width: 100%;
height: auto;
}
.sub-tabs-row {
padding: 12px 16px 6px;
background-color: #ffffff;
margin-bottom: 8px;
}
.sub-tabs-shell {
display: flex;
flex-direction: row;
width: 100%;
padding: 4px;
border-radius: 12px;
background-color: #f3f6fb;
border: 1px solid #e5edf7;
box-sizing: border-box;
}
.sub-tab-item {
flex: 1;
border-radius: 10px;
min-height: 52px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-sizing: border-box;
border: 1px solid transparent;
background-color: transparent;
}
.sub-tab-item + .sub-tab-item {
margin-left: 8px;
}
.sub-tab-active {
background-color: #ffffff;
border-color: #dbeafe;
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.10);
}
.sub-tab-title {
font-size: 15px;
font-weight: 600;
color: #64748b;
}
.sub-tab-title-active {
color: #2563eb;
}
.sub-tab-caption {
margin-top: 2px;
font-size: 12px;
font-weight: 500;
color: #94a3b8;
}
.sub-tab-caption-active {
color: #60a5fa;
}
.filter-section {
width: 100%;
padding-left: 12px;
padding-right: 12px;
box-sizing: border-box;
flex-direction: row;
flex-wrap: nowrap;
margin-top: 2px;
margin-bottom: 12px;
align-items: center;
overflow: hidden;
}
.filter-section--wrap .entry-filter-segmented-wrap .un-segmented {
min-width: 0;
}
.list-container {
flex-direction: column;
padding-left: 12px;
padding-right: 12px;
box-sizing: border-box;
}
.right-tab-list-panel {
flex-direction: column;
width: 100%;
}
.list-footer {
padding-top: 16px;
padding-bottom: 40px;
align-items: center;
justify-content: center;
flex-direction: row;
}
.list-footer-text {
font-size: 10px;
color: #94A3B8;
}
</style>
<template>
<scroll-view class="dashboard-scroll-view" :scroll-y="true">
<view class="dashboard-content">
<view class="card-header">
<view class="header-surface">
<view class="header-top-row">
<view class="header-title-group">
<text class="header-eyebrow">数据概览</text>
<text class="header-title">业绩看板</text>
</view>
<view class="header-control-pack">
<view class="header-eye-btn" @click="emit('toggleMetrics')">
<un-icon v-if="performanceMetricsVisible" name="eye" color="#334155" size="18"></un-icon>
<un-icon v-if="performanceMetricsVisible == false" name="eye-off" color="#1677ff" size="18"></un-icon>
</view>
<view class="tag-box" @click="emit('openBrandPicker')">
<view class="module-badge">
<text class="module-badge-text">模块</text>
</view>
<text class="tag-text">{{ selectedBrand }}</text>
<image class="tag-arrow-icon" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" />
</view>
</view>
</view>
<view class="progress-meta-row">
<text class="progress-label-text">时间进度</text>
<text class="progress-value-text">{{ performanceMetricsVisible ? (timeProgressPercent + '%') : '**' }}</text>
</view>
<view class="progress-bar-bg">
<view class="progress-bar-fill" :style="{ width: progressWidth }"></view>
</view>
</view>
</view>
<CardFlow :performance-data="performanceData" :metrics-visible="performanceMetricsVisible" />
<CardOutputValue
:tab-index="outputTabIndex"
:compare-rows="compareRows"
:metrics-visible="performanceMetricsVisible"
@update:tab-index="onUpdateOutputTabIndex"
/>
<CardMonthValue
style="margin-top: 10px;"
:summary="summary"
:target-value-text="targetValueText"
:achievement-value-text="achievementValueText"
:metrics-visible="performanceMetricsVisible"
/>
</view>
</scroll-view>
</template>
<script setup lang="uts">
import { computed } from 'vue'
import CardFlow from '../cards/CardFlow.uvue'
import CardOutputValue from '../cards/CardOutputValue.uvue'
import CardMonthValue from '../cards/CardMonthValue.uvue'
import type { CompareRow, OutputSummary } from '../types/reception-output-types.uts'
const props = defineProps<{
performanceData: UTSJSONObject
performanceMetricsVisible: boolean
selectedBrand: string
timeProgressPercent: number
compareRows: CompareRow[]
summary: OutputSummary
targetValueText: string
achievementValueText: string
outputTabIndex: number
}>()
const emit = defineEmits<{
toggleMetrics: []
openBrandPicker: []
'update:outputTabIndex': [number]
}>()
function onUpdateOutputTabIndex(index: number): void {
emit('update:outputTabIndex', index)
}
const progressWidth = computed((): string => {
const raw = props.timeProgressPercent
const pct = (typeof raw == 'number' && isNaN(raw) != true) ? raw : 0
const w = pct < 0 ? 0 : (pct > 100 ? 100 : pct)
const displayW = w > 0 && w < 4 ? 4 : w
return `${displayW}%`
})
</script>
<style>
.dashboard-scroll-view {
flex: 1;
min-height: 0;
width: 100%;
height: auto;
background-color: #f8f9fa;
}
.dashboard-content {
padding: 16px;
}
.card-header {
margin-bottom: 16px;
}
.header-surface {
background-color: #ffffff;
border: 1px solid #e6edf6;
border-radius: 14px;
padding: 12px;
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
flex-direction: column;
}
.header-top-row {
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.header-title-group {
flex-direction: column;
}
.header-control-pack {
flex-direction: row;
align-items: center;
}
.header-eyebrow {
font-size: 11px;
color: #94a3b8;
margin-bottom: 2px;
}
.header-eye-btn {
width: 30px;
height: 30px;
border-radius: 999px;
border: 1px solid #dbe7f5;
background-color: #f8fbff;
flex-direction: row;
align-items: center;
justify-content: center;
margin-right: 8px;
}
.header-title {
font-size: 17px;
font-weight: 700;
color: #1E293B;
}
.tag-box {
height: 36px;
min-width: 148px;
background-color: #f5f9ff;
padding: 0 10px;
border-radius: 10px;
border: 1px solid #cfe0f4;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.10);
}
.module-badge {
height: 22px;
padding: 0 8px;
border-radius: 999px;
background-color: #e5effd;
border: 1px solid #c9ddf7;
flex-direction: row;
align-items: center;
justify-content: center;
margin-right: 8px;
}
.module-badge-text {
font-size: 10px;
font-weight: 600;
color: #4f6b95;
}
.tag-text {
font-size: 13px;
font-weight: 700;
color: #1f3a5a;
}
.tag-arrow-icon {
width: 14px;
height: 14px;
margin-left: 6px;
opacity: 0.75;
}
.progress-meta-row {
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.progress-label-text {
font-size: 11px;
color: #94A3B8;
}
.progress-value-text {
font-size: 12px;
font-weight: 700;
color: #0f172a;
}
.progress-bar-bg {
height: 8px;
background-color: #cfdff3;
border-radius: 999px;
overflow: hidden;
flex-direction: row;
align-items: stretch;
position: relative;
}
.progress-bar-fill {
height: 100%;
background-color: #1677ff;
background-image: none;
border-radius: 999px;
box-shadow: none;
}
</style>
export function getStr(data: UTSJSONObject, key: string): string {
const v = data[key]
if (v == null) { return '' }
return `${v}`
}
export function getNum(data: UTSJSONObject, key: string): number {
const v = data[key]
if (v == null) { return 0 }
if (typeof v == 'number') { return v }
const n = parseFloat(`${v}`)
return isNaN(n) ? 0 : n
}
export function getTs(data: UTSJSONObject, key: string): number | null {
const v = data[key]
if (v == null) { return null }
if (typeof v == 'number') { return v }
const n = parseFloat(`${v}`)
return isNaN(n) ? null : n
}
export function readOptionalNonNegativeInt(obj: UTSJSONObject, key: string): number | null {
const v = obj[key]
if (v == null) { return null }
if (typeof v == 'number') {
if (isNaN(v) || 0 > v) { return null }
return Math.floor(v)
}
const n = parseFloat(`${v}`)
if (isNaN(n) || 0 > n) { return null }
return Math.floor(n)
}
export function resolveHasMore(
bizData: UTSJSONObject,
pageRowCount: number,
mergedListLength: number,
pageSize: number
): boolean {
const total = readOptionalNonNegativeInt(bizData, 'total')
if (total != null) { return total > mergedListLength }
const totalCount = readOptionalNonNegativeInt(bizData, 'totalCount')
if (totalCount != null) { return totalCount > mergedListLength }
const pages = readOptionalNonNegativeInt(bizData, 'pages')
const curPage = readOptionalNonNegativeInt(bizData, 'pageNum')
if (pages != null && curPage != null && pages > 0) { return pages > curPage }
const hasNext = bizData['hasNext']
if (hasNext != null) {
if (typeof hasNext == 'boolean') { return hasNext == true }
const s = `${hasNext}`
if (s == '1' || s == 'true' || s == 'True') { return true }
if (s == '0' || s == 'false' || s == 'False') { return false }
}
return pageRowCount >= pageSize
}
export function mergeByKey(existing: UTSJSONObject[], pageRows: UTSJSONObject[], key: string): UTSJSONObject[] {
const merged: UTSJSONObject[] = []
const seen: string[] = []
let i = 0
while (i < existing.length) {
const row = existing[i]
merged.push(row)
const idStr = getStr(row, key)
if (idStr != '') { seen.push(idStr) }
i++
}
let k = 0
while (k < pageRows.length) {
const row = pageRows[k]
const idStr = getStr(row, key)
let isDup = false
if (idStr != '') {
let t = 0
while (t < seen.length) {
if (seen[t] == idStr) {
isDup = true
break
}
t++
}
}
if (isDup != true) {
merged.push(row)
if (idStr != '') { seen.push(idStr) }
}
k++
}
return merged
}
export function formatDate(d: Date): string {
const y = d.getFullYear()
const m = (d.getMonth() + 1).toString().padStart(2, '0')
const day = d.getDate().toString().padStart(2, '0')
return `${y}-${m}-${day}`
}
export function getCurrentMonthRange(): UTSJSONObject {
const now = new Date()
const start = new Date(now.getFullYear(), now.getMonth(), 1)
const end = new Date(now.getFullYear(), now.getMonth() + 1, 0)
return {
startDate: formatDate(start),
endDate: formatDate(end),
} as UTSJSONObject
}
export function getTodayDayRangeStrings(): UTSJSONObject {
const now = new Date()
const y = now.getFullYear()
const m = (now.getMonth() + 1).toString().padStart(2, '0')
const day = now.getDate().toString().padStart(2, '0')
const dateStr = `${y}-${m}-${day}`
return {
startTime: `${dateStr} 00:00:00`,
endTime: `${dateStr} 23:59:59`,
} as UTSJSONObject
}
export function getMockPerformanceData(): UTSJSONObject {
return {
cumulativeDeliveryCount: 128,
actualContactCount: 96,
contactRate: 75,
achievementRatio: 85.5,
excellentStoreAvgDealRate: 42,
thisStoreDealRate: 38,
personalDealRate: 35,
actualProduction: 12.8,
personalProduction: 4.2,
excellentStoreAvgDeal: 12500,
thisStoreKdj: 10800,
personalKdj: 9500,
targetProduction: 199,
productionContribution: 100,
} as UTSJSONObject
}
export function isPerformanceDataEmpty(data: UTSJSONObject | null): boolean {
if (data == null) { return true }
const c = data['cumulativeDeliveryCount']
const a = data['actualContactCount']
const p = data['actualProduction']
const rate = data['contactRate']
const hasCount = (typeof c == 'number' && c > 0) || (typeof a == 'number' && a > 0) || (typeof p == 'number' && p > 0)
const hasRate = rate != null && `${rate}` != ''
return !(hasCount || hasRate)
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!