Commit cc1177ba by liimin

Merge branch 'feature/rework' of http://192.168.3.233:8090/monorepo/venus into feature/rework

2 parents 64da3cdc 9fd0f18f
<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" labelAlign="left" borderBottom>
<un-form-item label="车主姓名" prop="ownerName"> <un-form-item label="车主姓名" prop="ownerName">
<un-input <un-input
v-model="formData['ownerName']" v-model="formData['ownerName']"
border="none" border="none"
inputAlign="right"
placeholder="请输入车主姓名" placeholder="请输入车主姓名"
:maxlength="50" :maxlength="50"
:style="{ textAlign: 'left' }"
></un-input> ></un-input>
</un-form-item> </un-form-item>
...@@ -28,50 +22,61 @@ ...@@ -28,50 +22,61 @@
v-model="formData['ownerPhone']" v-model="formData['ownerPhone']"
border="none" border="none"
type="tel" type="tel"
inputAlign="right"
placeholder="请输入车主电话" placeholder="请输入车主电话"
:maxlength="11" :maxlength="11"
:style="{ textAlign: 'left' }"
></un-input> ></un-input>
</un-form-item> </un-form-item>
<un-form-item label="品牌车型" prop="brandModel"> <un-form-item label="品牌车型" prop="brandModel">
<un-cell <view class="form-add-link-cell" @click="brandCascaderShow = true">
:value="formData.brandModel !== '' ? formData.brandModel : '请选择品牌车型'" <text
isLink class="form-add-link-cell__value"
:border="false" :style="getCellValueStyle(formData.brandModel !== '')"
@click="brandCascaderShow = true" >
:valueStyle="formData.brandModel !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'" {{ formData.brandModel !== '' ? formData.brandModel : '请选择品牌车型' }}
></un-cell> </text>
<un-icon name="arrow-right" color="#a1a1a1"></un-icon>
</view>
</un-form-item> </un-form-item>
<un-form-item label="接待场景" prop="receptionSceneName"> <un-form-item label="接待场景" prop="receptionSceneName">
<un-cell <view class="form-add-link-cell" @click="sceneSelectShow = true">
:value="formData.receptionSceneName !== '' ? formData.receptionSceneName : '请选择接待场景'" <text
isLink class="form-add-link-cell__value"
:border="false" :style="getCellValueStyle(formData.receptionSceneName !== '')"
@click="sceneSelectShow = true" >
:valueStyle="formData.receptionSceneName !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'" {{ formData.receptionSceneName !== '' ? formData.receptionSceneName : '请选择接待场景' }}
></un-cell> </text>
<un-icon name="arrow-right" color="#a1a1a1"></un-icon>
</view>
</un-form-item> </un-form-item>
<un-form-item label="到店日期" prop="arrivalDate"> <un-form-item label="到店日期" prop="arrivalDate">
<un-cell <view class="form-add-link-cell" @click="onOpenDatePicker">
:value="formData.arrivalDate !== '' ? formData.arrivalDate : '请选择到店日期'" <text
isLink class="form-add-link-cell__value"
:border="false" :style="getCellValueStyle(formData.arrivalDate !== '')"
@click="onOpenDatePicker" >
:valueStyle="formData.arrivalDate !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'" {{ formData.arrivalDate !== '' ? formData.arrivalDate : '请选择到店日期' }}
></un-cell> </text>
<un-icon name="arrow-right" color="#a1a1a1"></un-icon>
</view>
</un-form-item> </un-form-item>
<un-form-item label="客户标签" prop="customerTagName"> <un-form-item label="客户标签" prop="customerTagName">
<un-cell <view
:value="formData.customerTagName !== '' ? formData.customerTagName : '请选择客户标签'" class="form-add-link-cell"
isLink
:border="false"
@click="customerTagsSelectShow = true" @click="customerTagsSelectShow = true"
:valueStyle="formData.customerTagName !== '' ? 'color: #1e293b; font-size: 15px;' : 'color: #94a3b8; font-size: 15px;'"
:style="{ position: 'relative', zIndex: 10 }" :style="{ position: 'relative', zIndex: 10 }"
></un-cell> >
<text
class="form-add-link-cell__value"
:style="getCellValueStyle(formData.customerTagName !== '')"
>
{{ formData.customerTagName !== '' ? formData.customerTagName : '请选择客户标签' }}
</text>
<un-icon name="arrow-right" color="#a1a1a1"></un-icon>
</view>
</un-form-item> </un-form-item>
</un-form> </un-form>
</view> </view>
...@@ -114,10 +119,11 @@ ...@@ -114,10 +119,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'
...@@ -127,6 +133,13 @@ import { storage } from '@/utils/storage.uts' ...@@ -127,6 +133,13 @@ import { storage } from '@/utils/storage.uts'
const phoneRex = /^1[3-9]\d{9}$/ const phoneRex = /^1[3-9]\d{9}$/
function getCellValueStyle(hasValue: boolean): string {
// 统一控制:label 左、value 右(这里只管 value 的对齐与颜色)
return hasValue
? 'color: #1e293b; font-size: 14px; text-align: right;margin-right: 6px;'
: 'color:rgb(151, 150, 150); font-size: 14px; text-align: right;margin-right: 6px;'
}
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
show?: boolean show?: boolean
...@@ -567,17 +580,18 @@ async function handleSubmit(): Promise<void> { ...@@ -567,17 +580,18 @@ async function handleSubmit(): Promise<void> {
const body = res as UTSJSONObject const body = res as UTSJSONObject
const code = fieldStr(body, 'code') const code = fieldStr(body, 'code')
console.log('saveVisitsInfo 保存更新成功code', code)
if (code !== '0') { // 失败直接提示后结束
if (code != '0') {
const msg = fieldStr(body, 'message') const msg = fieldStr(body, 'message')
uni.showToast({ title: msg !== '' ? msg : '保存失败', icon: 'none' }) uni.showToast({ title: msg !== '' ? msg : '保存失败', icon: 'none' })
return return
} }
// 成功:处理重复记录提示(后端可能用 data 标记归类结果)
const flag = fieldStr(body, 'data') const flag = fieldStr(body, 'data')
if (flag === '2') { if (flag === '2') {
// 重复记录处理
await new Promise<void>((resolve) => { await new Promise<void>((resolve) => {
uni.showModal({ uni.showModal({
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待', content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
...@@ -591,11 +605,8 @@ async function handleSubmit(): Promise<void> { ...@@ -591,11 +605,8 @@ async function handleSubmit(): Promise<void> {
// 提父级刷新并关闭 // 提父级刷新并关闭
uni.showToast({ title: '提交成功', icon: 'success' }) uni.showToast({ title: '提交成功', icon: 'success' })
resetForm() handleClose();
emit('saved')
emit('close')
uni.$emit('refresh-reception-list') uni.$emit('refresh-reception-list')
uni.navigateBack()
} catch (_e) { } catch (_e) {
uni.showToast({ title: '网络异常,请重试', icon: 'none' }) uni.showToast({ title: '网络异常,请重试', icon: 'none' })
...@@ -609,10 +620,6 @@ onMounted(() => { ...@@ -609,10 +620,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 +653,10 @@ onLoad((options: UTSJSONObject) => { ...@@ -646,30 +653,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 +678,17 @@ onLoad((options: UTSJSONObject) => { ...@@ -691,14 +678,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 {
...@@ -732,4 +722,24 @@ onLoad((options: UTSJSONObject) => { ...@@ -732,4 +722,24 @@ onLoad((options: UTSJSONObject) => {
.submit-btn .btn-text { .submit-btn .btn-text {
color: #ffffff; color: #ffffff;
} }
.form-add-link-cell {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
}
.form-add-link-cell__value {
flex: 1;
}
.form-add-link-cell__arrow {
margin-left: 6px;
color: #cbd5e1;
font-size: 14px;
text-align: right;
}
</style> </style>
...@@ -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
...@@ -89,14 +89,18 @@ ...@@ -89,14 +89,18 @@
@confirm="onReviewPickerConfirm" @confirm="onReviewPickerConfirm"
/> />
<!-- 客户档案详情全屏层 --> <!-- 客户录入列表 → 客户档案(FormDetail) -->
<view v-if="showReceptionDetail" class="form-detail-inner"> <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 +109,7 @@ ...@@ -105,6 +109,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'
...@@ -231,6 +236,7 @@ function getPerformanceData(): Promise<void> { ...@@ -231,6 +236,7 @@ function getPerformanceData(): Promise<void> {
} }
function getCustomerList(append: boolean): Promise<void> { function getCustomerList(append: boolean): Promise<void> {
console.log('[ReceptionCenter] 获取客户列表触底加载', append)
return getCustomerListImpl(append) return getCustomerListImpl(append)
} }
...@@ -305,9 +311,12 @@ function togglePerformanceMetricsVisibility(): void { ...@@ -305,9 +311,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 +408,20 @@ function onListCustomerEntryEdit(item: UTSJSONObject): void { ...@@ -399,15 +408,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 +441,9 @@ function onListCustomerEntryDelete(item: UTSJSONObject): void { ...@@ -427,8 +441,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' })
} }
...@@ -611,7 +626,6 @@ function getDefaultReceptionListParams(): UTSJSONObject | null { ...@@ -611,7 +626,6 @@ function getDefaultReceptionListParams(): UTSJSONObject | null {
// 页面加载/模块切换时请求门店业绩数据 // 页面加载/模块切换时请求门店业绩数据
getPerformanceDataImpl = async (): Promise<void> => { getPerformanceDataImpl = async (): Promise<void> => {
const raw = storage.get('userInfo') as UTSJSONObject | null const raw = storage.get('userInfo') as UTSJSONObject | null
console.log('[getPerformanceData] userInfo:', raw)
if (raw == null) { if (raw == null) {
performanceData.value = getMockPerformanceData() performanceData.value = getMockPerformanceData()
return return
...@@ -648,7 +662,8 @@ getPerformanceDataImpl = async (): Promise<void> => { ...@@ -648,7 +662,8 @@ getPerformanceDataImpl = async (): Promise<void> => {
const res = await getMerchantPerformance(params) const res = await getMerchantPerformance(params)
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)
...@@ -671,11 +686,6 @@ getCustomerListImpl = async (append: boolean): Promise<void> => { ...@@ -671,11 +686,6 @@ getCustomerListImpl = async (append: boolean): Promise<void> => {
return return
} }
} }
const fileParams = getDefaultCustomerFileParams()
if (fileParams == null) {
console.warn('[getCustomerList] 无登录门店信息,跳过客户档案列表请求')
return
}
let pageBumped = false let pageBumped = false
if (append) { if (append) {
customerFilePageNum.value = customerFilePageNum.value + 1 customerFilePageNum.value = customerFilePageNum.value + 1
...@@ -684,8 +694,18 @@ getCustomerListImpl = async (append: boolean): Promise<void> => { ...@@ -684,8 +694,18 @@ getCustomerListImpl = async (append: boolean): Promise<void> => {
} else { } else {
customerListHasMore.value = true customerListHasMore.value = true
} }
const fileParams = getDefaultCustomerFileParams()
if (fileParams == null) {
console.warn('[getCustomerList] 无登录门店信息,跳过客户档案列表请求')
if (pageBumped) {
customerFilePageNum.value = customerFilePageNum.value - 1
customerListLoadingMore.value = false
}
return
}
try { try {
const res = await getCustomerFileList(fileParams) const res = await getCustomerFileList(fileParams)
console.log('[ReceptionCenter] 获取客户列表res', res)
const resObj = res as UTSJSONObject const resObj = res as UTSJSONObject
const codeRaw = resObj['code'] const codeRaw = resObj['code']
if (`${codeRaw}` != '0') { if (`${codeRaw}` != '0') {
...@@ -767,11 +787,6 @@ getReceptionRecordListImpl = async (append: boolean): Promise<void> => { ...@@ -767,11 +787,6 @@ getReceptionRecordListImpl = async (append: boolean): Promise<void> => {
return return
} }
} }
const receptionParams = getDefaultReceptionListParams()
if (receptionParams == null) {
console.warn('[getReceptionRecordList] 无登录门店信息,跳过接待复盘列表请求')
return
}
let pageBumped = false let pageBumped = false
if (append) { if (append) {
receptionPageNum.value = receptionPageNum.value + 1 receptionPageNum.value = receptionPageNum.value + 1
...@@ -780,6 +795,15 @@ getReceptionRecordListImpl = async (append: boolean): Promise<void> => { ...@@ -780,6 +795,15 @@ getReceptionRecordListImpl = async (append: boolean): Promise<void> => {
} else { } else {
receptionListHasMore.value = true receptionListHasMore.value = true
} }
const receptionParams = getDefaultReceptionListParams()
if (receptionParams == null) {
console.warn('[getReceptionRecordList] 无登录门店信息,跳过接待复盘列表请求')
if (pageBumped) {
receptionPageNum.value = receptionPageNum.value - 1
receptionListLoadingMore.value = false
}
return
}
console.log("receptionParams接待复盘参数",receptionParams); console.log("receptionParams接待复盘参数",receptionParams);
try { try {
const res = await getReceptionList(receptionParams) const res = await getReceptionList(receptionParams)
......
...@@ -561,10 +561,12 @@ ...@@ -561,10 +561,12 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
/* 仅作弹层容器:勿 flex:1,否则会与表单区(如 FormAdd 的 form-add-wrap)瓜分纵向空间并引发点击穿透/叠层问题 */
.customer-tags-root { .customer-tags-root {
width: 100%; width: 100%;
flex: 1; height: 0;
min-height: 0; flex-grow: 0;
flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* Android:滚动父级勿用 overflow:hidden,易导致子 list-view 手势异常(FormDetail 同注) */ /* Android:滚动父级勿用 overflow:hidden,易导致子 list-view 手势异常(FormDetail 同注) */
......
...@@ -24,10 +24,9 @@ ...@@ -24,10 +24,9 @@
> >
<view class="filter-tabs-row entry-filter-segmented-wrap"> <view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented <un-segmented
shape="circle"
type="card" type="card"
:height="40" :height="40"
bg-color="rgba(241, 245, 249, 0.5)" bg-color="#f1f5f9"
active-color="#000000" active-color="#000000"
:model-value="filterTabIndex" :model-value="filterTabIndex"
@update:model-value="emit('switchFilterTab', $event)" @update:model-value="emit('switchFilterTab', $event)"
......
...@@ -102,7 +102,6 @@ const reviewTabLabel = computed((): string => { ...@@ -102,7 +102,6 @@ const reviewTabLabel = computed((): string => {
background-color: rgba(255, 255, 255, 0.5); background-color: rgba(255, 255, 255, 0.5);
padding: 4px 12px; padding: 4px 12px;
border-radius: 999px; border-radius: 999px;
border: 1px solid rgba(226, 232, 240, 1);
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
} }
...@@ -116,8 +115,7 @@ const reviewTabLabel = computed((): string => { ...@@ -116,8 +115,7 @@ const reviewTabLabel = computed((): string => {
justify-content: space-between; justify-content: space-between;
border-radius: 10px; border-radius: 10px;
background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); 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 #ffffff;
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; box-sizing: border-box;
} }
...@@ -141,7 +139,7 @@ const reviewTabLabel = computed((): string => { ...@@ -141,7 +139,7 @@ const reviewTabLabel = computed((): string => {
.tag-box--filter .tag-arrow-icon { .tag-box--filter .tag-arrow-icon {
width: 14px; width: 14px;
height: 14px; height: 14px;
margin-left: 8px; margin-left: 6px;
opacity: 0.8; opacity: 0.8;
} }
</style> </style>
<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;
......
<template> <template>
<!-- 客户录入列表:与 customervisits.customerInfoPage 字段对齐(ownerPhone / brandModel / customerTagName / arrivalDate / ownerName) --> <!-- 客户录入列表:与 customervisits.customerInfoPage 字段对齐(ownerPhone / brandModel / customerTagName / arrivalDate / ownerName) -->
<view class="customer-entry-list"> <view class="customer-entry-list">
<!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 -->
<view <view
v-for="item in customerList" v-if="loading && (props.customerList == null || props.customerList.length == 0)"
v-for="i in skeletonCardCount"
:key="'entry-skeleton-' + i"
class="list-card list-card-entry glass-card"
>
<un-skeleton rows="3" title loading></un-skeleton>
</view>
<view
v-else
v-for="item in props.customerList"
:key="getStr(item, 'id')" :key="getStr(item, 'id')"
class="list-card list-card-entry glass-card" class="list-card list-card-entry glass-card"
@click="onEntryCardClick(item)" @click="onEntryCardClick(item)"
@longpress="onEntryCardLongPress(item)" @longpress="onEntryCardLongPress(item)"
> >
<view class="card-header-row"> <un-skeleton :rows="3" title :loading="loading">
<view class="card-title-box"> <view class="card-header-row">
<text class="card-name">{{ getStr(item, 'ownerName') }}</text> <view class="card-title-box">
<text class="card-car">{{ getStr(item, 'brandModel') }}</text> <text class="card-name">{{ getStr(item, 'ownerName') }}</text>
<text class="card-car">{{ getStr(item, 'brandModel') }}</text>
</view>
</view> </view>
</view> <view class="card-info-list">
<view class="card-info-list"> <view class="info-row"><text class="info-label">车主电话</text><text class="info-value">{{ formatPhone(getStr(item, 'ownerPhone')) }}</text></view>
<view class="info-row"><text class="info-label">车主电话</text><text class="info-value">{{ formatPhone(getStr(item, 'ownerPhone')) }}</text></view> <view class="info-row"><text class="info-label">品牌车型</text><text class="info-value">{{ getStr(item, 'brandModel') }}</text></view>
<view class="info-row"><text class="info-label">品牌车型</text><text class="info-value">{{ getStr(item, 'brandModel') }}</text></view> <view class="info-row"><text class="info-label">客户标签</text><text class="info-value">{{ getStr(item, 'customerTagName') }}</text></view>
<view class="info-row"><text class="info-label">客户标签</text><text class="info-value">{{ getStr(item, 'customerTagName') }}</text></view> <view class="info-row"><text class="info-label">到店日期</text><text class="info-value">{{ formatArrivalDateOnly(getArrivalTsForEntry(item)) }}</text></view>
<view class="info-row"><text class="info-label">到店日期</text><text class="info-value">{{ formatArrivalDateOnly(getArrivalTsForEntry(item)) }}</text></view> </view>
</view> </un-skeleton>
<view <view
v-if="isEntryCardMaskVisible(item)" v-if="!loading && isEntryCardMaskVisible(item)"
class="entry-card-mask" class="entry-card-mask"
@click.stop="onEntryCardMaskAbsorbTap" @click.stop="onEntryCardMaskAbsorbTap"
> >
...@@ -46,15 +58,20 @@ ...@@ -46,15 +58,20 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { ref, watch } from 'vue' import { computed, ref, watch } from 'vue'
const props = defineProps<{ const props = defineProps<{
/** 客户档案列表(由父级拉取并传入) */ /** 客户档案列表(由父级拉取并传入) */
customerList: UTSJSONObject[] customerList: UTSJSONObject[]
/** 与父级「今日到店 / 全部客户」分段器同步;切换时关闭长按遮罩 */ /** 与父级「今日到店 / 全部客户」分段器同步;切换时关闭长按遮罩 */
entryFilterIndex: number entryFilterIndex: number
/** 加载中:骨架屏覆盖卡片内容;列表为空时用骨架卡片占位 */
loading?: boolean
}>() }>()
const loading = computed<boolean>(() => props.loading === true)
const skeletonCardCount = 3
const emit = defineEmits<{ const emit = defineEmits<{
/** 点击卡片:打开客户档案详情 */ /** 点击卡片:打开客户档案详情 */
'entry-click': [item: UTSJSONObject] 'entry-click': [item: UTSJSONObject]
...@@ -170,11 +187,17 @@ function formatArrivalDateOnly(ts: number | null): string { ...@@ -170,11 +187,17 @@ function formatArrivalDateOnly(ts: number | null): string {
} }
function onEntryCardClick(item: UTSJSONObject): void { function onEntryCardClick(item: UTSJSONObject): void {
if (loading.value) {
return
}
entryOverlayEntryId.value = '' entryOverlayEntryId.value = ''
emit('entry-click', item) emit('entry-click', item)
} }
function onEntryCardLongPress(item: UTSJSONObject): void { function onEntryCardLongPress(item: UTSJSONObject): void {
if (loading.value) {
return
}
entryOverlayEntryId.value = getStr(item, 'id') entryOverlayEntryId.value = getStr(item, 'id')
} }
......
<template> <template>
<!-- 接待复盘记录列表:与接待接口字段对齐,数据由父级拉取后传入 --> <!-- 接待复盘记录列表:与接待接口字段对齐,数据由父级拉取后传入 -->
<view class="reception-record-list"> <view class="reception-record-list">
<!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 -->
<view <view
v-for="(item, idx) in receptionRecordList" v-if="!loading && (props.receptionRecordList == null || props.receptionRecordList.length == 0)"
v-for="i in skeletonCardCount"
:key="'reception-skeleton-' + i"
class="list-card glass-card"
>
<un-skeleton rows="3" title loading></un-skeleton>
</view>
<view
v-else
v-for="(item, idx) in props.receptionRecordList"
:key="getStr(item, 'batchId') != '' ? getStr(item, 'batchId') + '-' + idx : 'recv-' + idx" :key="getStr(item, 'batchId') != '' ? getStr(item, 'batchId') + '-' + idx : 'recv-' + idx"
class="list-card glass-card" class="list-card glass-card"
@click="onCardClick(item)" @click="onCardClick(item)"
> >
<view class="card-header-row"> <un-skeleton :rows="3" title :loading="loading">
<view class="card-title-box"> <view class="card-header-row">
<text class="card-name">{{ getStr(item, 'customerName') }}</text> <view class="card-title-box">
<text class="card-car">{{ getStr(item, 'carBrand') }}</text> <text class="card-name">{{ getStr(item, 'customerName') }}</text>
</view> <text class="card-car">{{ getStr(item, 'carBrand') }}</text>
<view class="card-status-box">
<view class="status-badge bg-slate-100">
<text class="status-text text-slate-400">{{ getReviewFlagText(item) }}</text>
</view> </view>
<view <view class="card-status-box">
v-if="shouldShowOrderFinishBadge(item)" <view class="status-badge bg-slate-100">
:class="orderFinishFlagIsSuccess(item) ? 'status-badge bg-green-50' : 'status-badge bg-red-50'" <text class="status-text text-slate-400">{{ getReviewFlagText(item) }}</text>
> </view>
<text :class="orderFinishFlagIsSuccess(item) ? 'status-text text-green-400' : 'status-text text-red-400'">{{ getOrderFinishResultLabel(item) }}</text> <view
v-if="shouldShowOrderFinishBadge(item)"
:class="orderFinishFlagIsSuccess(item) ? 'status-badge bg-green-50' : 'status-badge bg-red-50'"
>
<text :class="orderFinishFlagIsSuccess(item) ? 'status-text text-green-400' : 'status-text text-red-400'">{{ getOrderFinishResultLabel(item) }}</text>
</view>
</view> </view>
</view> </view>
</view> <view class="card-info-list">
<view class="card-info-list"> <view class="info-row"><text class="info-label">客户电话</text><text class="info-value">{{ formatPhone(getStr(item, 'phoneNumber')) }}</text></view>
<view class="info-row"><text class="info-label">客户电话</text><text class="info-value">{{ formatPhone(getStr(item, 'phoneNumber')) }}</text></view> <view class="info-row"><text class="info-label">销售姓名</text><text class="info-value">{{ getReceptionSalesDisplay(item) }}</text></view>
<view class="info-row"><text class="info-label">销售姓名</text><text class="info-value">{{ getReceptionSalesDisplay(item) }}</text></view> <view class="info-row"><text class="info-label">接待时长</text><text class="info-value">{{ formatReceptionDuration(item) }}</text></view>
<view class="info-row"><text class="info-label">接待时长</text><text class="info-value">{{ formatReceptionDuration(item) }}</text></view> <view class="info-row"><text class="info-label">开始接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'receptionStartTime')) }}</text></view>
<view class="info-row"><text class="info-label">开始接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'receptionStartTime')) }}</text></view> <view class="info-row info-row-last"><text class="info-label">结束接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'receptionEndTime')) }}</text></view>
<view class="info-row info-row-last"><text class="info-label">结束接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'receptionEndTime')) }}</text></view> </view>
</view> </un-skeleton>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
defineProps<{ import { computed } from 'vue'
const props = defineProps<{
/** 接待记录列表(由父级拉取并传入) */ /** 接待记录列表(由父级拉取并传入) */
receptionRecordList: UTSJSONObject[] receptionRecordList: UTSJSONObject[]
/** 加载中:骨架屏覆盖卡片内容;列表为空时用骨架卡片占位 */
loading?: boolean
}>() }>()
const loading = computed<boolean>(() => props.loading === true)
const skeletonCardCount = 3
const emit = defineEmits<{ const emit = defineEmits<{
/** 点击卡片:父级根据 filterTabIndex 等处理详情或 toast */ /** 点击卡片:父级根据 filterTabIndex 等处理详情或 toast */
'reception-click': [item: UTSJSONObject] 'reception-click': [item: UTSJSONObject]
...@@ -177,6 +196,9 @@ function formatReceptionDuration(item: UTSJSONObject): string { ...@@ -177,6 +196,9 @@ function formatReceptionDuration(item: UTSJSONObject): string {
} }
function onCardClick(item: UTSJSONObject): void { function onCardClick(item: UTSJSONObject): void {
if (loading.value) {
return
}
emit('reception-click', item) emit('reception-click', item)
} }
</script> </script>
......
...@@ -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!