Commit fe62a028 by Lin

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

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