Commit fe62a028 by Lin

feat(接待中心): 新增接待中心页面及重构相关组件

- 新增接待中心页面,整合客户录入与接待复盘功能
- 重构 FormAdd 和 FormDetail 组件,统一导航栏样式,避免内容被遮挡
- 优化接待详情展示逻辑,支持不同状态下的内容展示
- 调整样式以提升用户体验,确保在不同设备上的可读性
- 修复部分组件的状态管理和交互逻辑
1 parent 8eaee81a
<template>
<!-- 自定义导航页:按窗口安全区预留顶部,避免状态栏/刘海与首屏重叠 -->
<!-- <view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view> -->
<!-- <view class="form-add-top-bar">
<view class="form-add-back-btn" @click="handleClose">
<un-icon name="arrow-left" size="20"></un-icon>
</view>
<text class="form-add-title-text">客户档案</text>
<view style="width: 36px;"></view>
</view> -->
<view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view>
<un-navbar title="客户档案" @leftClick="handleClose" />
<view class="form-add-root">
<!-- 与接待中心 center.uvue 一致:安全区 + 固定导航占位,避免首屏表单被导航栏遮挡 -->
<view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view>
<un-navbar title="客户档案" @leftClick="handleClose" />
<view class="reception-navbar-spacer"></view>
<view class="form-add-wrap">
<view class="form-add-body">
<un-form :model="formData" labelWidth="80" borderBottom>
......@@ -19,7 +13,6 @@
border="none"
placeholder="请输入车主姓名"
:maxlength="50"
:style="{ textAlign: 'left' }"
></un-input>
</un-form-item>
......@@ -30,7 +23,6 @@
type="tel"
placeholder="请输入车主电话"
:maxlength="11"
:style="{ textAlign: 'left' }"
></un-input>
</un-form-item>
......@@ -39,6 +31,7 @@
:value="formData.brandModel !== '' ? formData.brandModel : '请选择品牌车型'"
isLink
:border="false"
size="large"
@click="brandCascaderShow = true"
:valueStyle="formData.brandModel !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'"
></un-cell>
......@@ -47,6 +40,7 @@
<un-cell
:value="formData.receptionSceneName !== '' ? formData.receptionSceneName : '请选择接待场景'"
isLink
size="large"
:border="false"
@click="sceneSelectShow = true"
:valueStyle="formData.receptionSceneName !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'"
......@@ -57,6 +51,7 @@
<un-cell
:value="formData.arrivalDate !== '' ? formData.arrivalDate : '请选择到店日期'"
isLink
size="large"
:border="false"
@click="onOpenDatePicker"
:valueStyle="formData.arrivalDate !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'"
......@@ -67,6 +62,7 @@
<un-cell
:value="formData.customerTagName !== '' ? formData.customerTagName : '请选择客户标签'"
isLink
size="large"
:border="false"
@click="customerTagsSelectShow = true"
:valueStyle="formData.customerTagName !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'"
......@@ -114,10 +110,11 @@
@cancel="datePickerShow = false"
@close="datePickerShow = false"
/>
</view>
</template>
<script setup lang="uts">
import { ref, watch, nextTick, computed, onMounted, onUnmounted } from 'vue'
import { ref, watch, nextTick, computed, onMounted } from 'vue'
import { ComponentPublicInstance } from 'vue'
import CarBrands from '@/components/CarBrands.uvue'
import SenceSelect from './filters/SenceSelect.uvue'
......@@ -609,10 +606,6 @@ onMounted(() => {
syncReceptionSafeTopSpacer()
})
onUnmounted(() => {
// 清理工作已在 syncReceptionSafeTopSpacer 中简化,无需定时器
})
onLoad((options: UTSJSONObject) => {
const recordStr = options['record']
if (recordStr != null && typeof recordStr === 'string' && recordStr !== '') {
......@@ -646,30 +639,10 @@ onLoad((options: UTSJSONObject) => {
flex-shrink: 0;
}
.form-add-top-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
/* un-navbar 固定定位时不占文档流高度,预留标题栏区域(与 center.uvue 一致) */
.reception-navbar-spacer {
height: 44px;
flex-shrink: 0;
box-sizing: border-box;
padding: 8px 16px;
background-color: #ffffff;
}
.form-add-title-text {
font-size: 18px;
font-weight: 600;
color: #1e293b;
}
.form-add-back-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 8px;
}
.form-add-wrap {
......@@ -691,14 +664,17 @@ onLoad((options: UTSJSONObject) => {
.form-add-footer {
display: flex;
flex-direction: row;
margin-top: 24px;
margin: 24px;
padding-top: 16px;
border-top: 1px solid #e2e8f0;
/* 禁止按钮被挤压 */
flex-shrink: 0;
background-color: #ffffff;
/* 底部安全区适配 */
padding-bottom: env(safe-area-inset-bottom);
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
.btn {
......
......@@ -175,8 +175,9 @@ const ringRightStyle = computed(() => {
}
.summary-value-box {
display: flex;
flex-direction: row;
align-items: baseline;
align-items: flex-end;
}
.summary-value-num {
......@@ -189,6 +190,7 @@ const ringRightStyle = computed(() => {
font-size: 14px;
color: #1677ff;
margin-left: 2px;
padding-bottom: 4px;
}
.summary-personal {
......
......@@ -2,11 +2,11 @@
<!-- 接待中心 Tab 聚合页 -->
<view class="reception-center-page">
<!-- 顶部安全区 -->
<view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view>
<un-navbar title="接待中心" left-icon="" />
<view class="reception-navbar-spacer"></view>
<!-- <view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view> -->
<!-- <un-navbar title="接待中心" left-icon="" /> -->
<!-- <view class="reception-navbar-spacer"></view> -->
<!-- Tab 切换 -->
<view class="reception-tabs-container">
<un-tabs
......@@ -91,12 +91,19 @@
<!-- 客户档案详情全屏层 -->
<view v-if="showReceptionDetail" class="form-detail-inner">
<!-- 客户录入列表 → 客户档案(FormDetail) -->
<view v-if="showCustomerFormDetail" class="form-detail-inner">
<FormDetail
:show="showReceptionDetail"
:detail="receptionDetailItem"
@close="onReceptionDetailClose"
:show="showCustomerFormDetail"
:detail="customerFormDetailItem"
@close="onCustomerFormDetailClose"
/>
</view>
<!-- 接待复盘列表 → 接待详情(receptionDetail) -->
<view v-if="showReceptionRecordDetail" class="form-detail-inner">
<ReceptionDetail :item="receptionRecordItem" @close="onReceptionRecordDetailClose" />
</view>
</view>
</template>
......@@ -105,6 +112,7 @@
import { ref, computed, onMounted, onUnmounted, watch } from 'vue'
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'
......@@ -305,9 +313,12 @@ function togglePerformanceMetricsVisibility(): void {
performanceMetricsVisible.value = !performanceMetricsVisible.value
}
// 客户档案详情弹窗:客户录入卡片点击时展示
const showReceptionDetail = ref(false)
const receptionDetailItem = ref<UTSJSONObject | null>(null)
// 客户档案详情(客户录入列表卡片)
const showCustomerFormDetail = ref(false)
const customerFormDetailItem = ref<UTSJSONObject | null>(null)
// 接待复盘详情(接待列表卡片 → receptionDetail.uvue)
const showReceptionRecordDetail = ref(false)
const receptionRecordItem = ref<UTSJSONObject>({})
// 是否使用鸿蒙/问界口径(true=问界/鸿蒙;false=延保/权益)
// channelType == 1 => 问界/鸿蒙
......@@ -399,15 +410,20 @@ function onListCustomerEntryEdit(item: UTSJSONObject): void {
})
}
// 客户档案详情弹窗关闭(FormDetail 组件 emit close 时调用)
function onReceptionDetailClose(): void {
showReceptionDetail.value = false
receptionDetailItem.value = null
function onCustomerFormDetailClose(): void {
showCustomerFormDetail.value = false
customerFormDetailItem.value = null
}
function onReceptionRecordDetailClose(): void {
showReceptionRecordDetail.value = false
receptionRecordItem.value = {}
}
function onListCustomerEntryClick(item: UTSJSONObject): void {
receptionDetailItem.value = item
showReceptionDetail.value = true
customerFormDetailItem.value = item
showCustomerFormDetail.value = true
showReceptionRecordDetail.value = false
}
function onListCustomerEntryDelete(item: UTSJSONObject): void {
......@@ -427,8 +443,9 @@ function onListCustomerEntryDelete(item: UTSJSONObject): void {
function onReceptionCardClick(item: UTSJSONObject): void {
if (filterTabIndex.value == 0) {
receptionDetailItem.value = item
showReceptionDetail.value = true
receptionRecordItem.value = item
showReceptionRecordDetail.value = true
showCustomerFormDetail.value = false
} else {
uni.showToast({ title: '该接待尚不支持复盘', icon: 'none' })
}
......@@ -646,9 +663,11 @@ getPerformanceDataImpl = async (): Promise<void> => {
try {
const res = await getMerchantPerformance(params)
console.log('获取业绩数据成功res:', res)
const resObj = res as UTSJSONObject
const bizData = resObj['data'] as UTSJSONObject | null
performanceData.value = isPerformanceDataEmpty(bizData) ? getMockPerformanceData() : (bizData as UTSJSONObject)
// performanceData.value = isPerformanceDataEmpty(bizData) ? getMockPerformanceData() : (bizData as UTSJSONObject)
performanceData.value = bizData as UTSJSONObject
console.log('获取业绩数据成功:', performanceData.value)
} catch (err) {
console.error('获取业绩数据失败:', err)
......
<template>
<view class="form-detail-root">
<!-- 自定义导航页:按窗口安全区预留顶部,避免状态栏/刘海与首屏重叠 -->
<!-- 与 FormAdd 一致:安全区 + 固定导航占位,避免首屏内容被导航栏遮挡 -->
<view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view>
<view class="form-detail-top-bar">
<view class="form-detail-back-btn" @click="handleClose">
<un-icon name="arrow-left" size="20"></un-icon>
</view>
</view>
<un-navbar title="客户档案" @leftClick="handleClose" />
<view class="reception-navbar-spacer"></view>
<view class="form-detail-wrap">
<view class="form-detail-header">
<text class="form-detail-title">客户档案</text>
</view>
<!-- 使用 flex: 1 自动撑满剩余空间,避免底部留白 -->
<list-view
class="form-detail-scroll"
......@@ -87,9 +81,6 @@ type GoodsCardItem = {
customerTag: string
}
/** 顶部返回栏占位(与 updateLayoutHeights 内扣减一致) */
const FORM_DETAIL_TOP_BAR_PX = 48
/** 顶部安全区占位(px):与系统状态栏/刘海对齐,随窗口信息刷新 */
const receptionPageInsetTopPx = ref(0)
......@@ -708,24 +699,10 @@ function handleClose(): void {
flex-shrink: 0;
}
.form-detail-top-bar {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 100%;
/* un-navbar 固定定位时不占文档流高度,预留标题栏区域(与 FormAdd / center 一致) */
.reception-navbar-spacer {
height: 44px;
flex-shrink: 0;
box-sizing: border-box;
padding-left: 8px;
padding-top: 5px;
}
.form-detail-back-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 8px;
}
.form-detail-wrap {
......@@ -741,19 +718,6 @@ function handleClose(): void {
box-sizing: border-box;
}
.form-detail-header {
width: 100%;
padding: 0 24px;
box-sizing: border-box;
margin-bottom: 26px;
}
.form-detail-title {
font-size: 18px;
font-weight: 700;
color: #1e293b;
}
.form-detail-scroll {
width: 100%;
flex: 1;
......
......@@ -2,12 +2,9 @@
<view class="detail-container">
<!-- 自定义导航页:按窗口安全区预留顶部,避免状态栏/刘海与首屏重叠 -->
<view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view>
<!-- 顶部返回按钮:用于关闭该详情组件(由父级处理 close 事件) -->
<view class="detail-header">
<view class="back-btn" @click="onBack">
<un-icon name="arrow-left"></un-icon>
</view>
</view>
<!-- 与 FormDetail 一致:固定导航 + 占位,避免首屏内容被导航栏遮挡 -->
<un-navbar title="接待详情" @leftClick="onBack" />
<view class="reception-navbar-spacer"></view>
<!-- 主内容区:可滚动 -->
<scroll-view class="main-scroll" scroll-y="true">
<!-- 客户卡片 -->
......@@ -1357,28 +1354,15 @@ defineExpose({
background-color: #F8FAFC;
}
.detail-header {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 100%;
box-sizing: border-box;
padding-left: 8px;
margin-top: 0;
}
.reception-safe-top-spacer {
width: 100%;
flex-shrink: 0;
}
.back-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 8px;
/* un-navbar 固定定位时不占文档流高度,预留标题栏区域(与 FormDetail 一致) */
.reception-navbar-spacer {
height: 44px;
flex-shrink: 0;
}
/* ── 主滚动区 ───────────────────────────────────────────────────────────────── */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!