Commit edc402f8 by Lin

refactor(components): 优化接待中心组件的弹层和列表展示

- 将多个 scroll-view 组件替换为 list-view 以提升性能和用户体验
- 统一底部弹层高度设置,确保与其他组件一致
- 调整样式以支持更灵活的布局,改善标签和场景选择的展示效果
- 增强代码可读性,简化属性绑定和样式管理
1 parent ca7ad30a
...@@ -6,21 +6,31 @@ ...@@ -6,21 +6,31 @@
position="bottom" position="bottom"
:isFooter="false" :isFooter="false"
title="选择品牌" title="选择品牌"
:popupH="sheetPanelHeightPx"
:maxHeight="sheetPanelHeightPx"
@close="onBrandSheetClose" @close="onBrandSheetClose"
> >
<scroll-view class="tag-scroll" scroll-y="true"> <list-view
<view class="tag-box"> class="tag-list-view"
<template v-for="(item, index) in brandList" :key="index"> direction="vertical"
<view :bounces="false"
class="tag-item" :show-scrollbar="true"
:class="{ checked: isBrandRowChecked(item as UTSJSONObject) }" :style="tagScrollStyle"
@click="onTapBrandRow(item as UTSJSONObject)" >
> <list-item class="tag-list-item" :type="0">
<text class="tag-text">{{ formatBrandTagLabel(item as UTSJSONObject) }}</text> <view class="tag-box">
</view> <template v-for="(item, index) in brandList" :key="index">
</template> <view
</view> class="tag-item"
</scroll-view> :class="{ checked: isBrandRowChecked(item as UTSJSONObject) }"
@click="onTapBrandRow(item as UTSJSONObject)"
>
<text class="tag-text">{{ formatBrandTagLabel(item as UTSJSONObject) }}</text>
</view>
</template>
</view>
</list-item>
</list-view>
</MessageBox> </MessageBox>
<!-- 第二步:底部弹框 — 根据所选品牌筛选的车型 tag --> <!-- 第二步:底部弹框 — 根据所选品牌筛选的车型 tag -->
<MessageBox <MessageBox
...@@ -28,23 +38,32 @@ ...@@ -28,23 +38,32 @@
position="bottom" position="bottom"
:isFooter="false" :isFooter="false"
title="选择车型" title="选择车型"
:maxHeight="1000" :popupH="sheetPanelHeightPx"
:maxHeight="sheetPanelHeightPx"
back back
@close="onModelSheetClose" @close="onModelSheetClose"
> >
<scroll-view class="tag-scroll" scroll-y="true"> <list-view
<view class="tag-box"> class="tag-list-view"
<template v-for="(item, index) in modelList" :key="index"> direction="vertical"
<view :bounces="false"
class="tag-item" :show-scrollbar="true"
:class="{ checked: isModelRowChecked(item as UTSJSONObject) }" :style="tagScrollStyle"
@click="onTapModelRow(item as UTSJSONObject)" >
> <list-item class="tag-list-item" :type="0">
<text class="tag-text">{{ (item as UTSJSONObject).name }}</text> <view class="tag-box">
</view> <template v-for="(item, index) in modelList" :key="index">
</template> <view
</view> class="tag-item"
</scroll-view> :class="{ checked: isModelRowChecked(item as UTSJSONObject) }"
@click="onTapModelRow(item as UTSJSONObject)"
>
<text class="tag-text">{{ (item as UTSJSONObject).name }}</text>
</view>
</template>
</view>
</list-item>
</list-view>
</MessageBox> </MessageBox>
</view> </view>
</template> </template>
...@@ -55,7 +74,7 @@ ...@@ -55,7 +74,7 @@
import { getMerchantCarBrandList, getCarBrandsListApi } from '@/api/common-api.uts' import { getMerchantCarBrandList, getCarBrandsListApi } from '@/api/common-api.uts'
import { dispatch } from '@/store/index.uts' import { dispatch } from '@/store/index.uts'
import { ComponentPublicInstance } from 'vue' import { ComponentPublicInstance } from 'vue'
import { nextTick } from 'vue' import { nextTick, computed } from 'vue'
import { import {
getMockFlatCarBrandRows, getMockFlatCarBrandRows,
getMockCarModelsList getMockCarModelsList
...@@ -85,6 +104,39 @@ ...@@ -85,6 +104,39 @@
const brandSheetRef = ref<ComponentPublicInstance | null>(null) const brandSheetRef = ref<ComponentPublicInstance | null>(null)
const modelSheetRef = ref<ComponentPublicInstance | null>(null) const modelSheetRef = ref<ComponentPublicInstance | null>(null)
/** 底部弹层高度:半屏 px,与 MessageBox popupH/maxHeight 一致以固定面板高度(同 CustomerTags) */
const sheetPanelHeightPx = ref(400)
/** list-view 需明确 px 高度;扣除 tips-content padding、标题区、列表区 margin(同 CustomerTags) */
const TAG_SCROLL_VERTICAL_RESERVE_PX = 120
const tagScrollStyle = computed((): UTSJSONObject => {
const panel = sheetPanelHeightPx.value
const h = panel - TAG_SCROLL_VERTICAL_RESERVE_PX
const finalH = h > 160 ? h : 160
const out = {} as UTSJSONObject
out['height'] = `${finalH}px`
out['width'] = '100%'
return out
})
function updateSheetPanelHeight(): void {
try {
const info = uni.getSystemInfoSync()
const wh = info.windowHeight
if (wh != null) {
const h = wh as number
if (h > 0) {
sheetPanelHeightPx.value = Math.floor(h / 2)
return
}
}
} catch (_e) {
// ignore
}
sheetPanelHeightPx.value = 400
}
const brandList = ref<Array<any>>([]) const brandList = ref<Array<any>>([])
const modelList = ref<Array<any>>([]) const modelList = ref<Array<any>>([])
/** 第一步选中的行(含 brandId、brandName、name、id 等,与 CarBrands selectCar 一致) */ /** 第一步选中的行(含 brandId、brandName、name、id 等,与 CarBrands selectCar 一致) */
...@@ -128,6 +180,7 @@ ...@@ -128,6 +180,7 @@
} }
function openModelSheet(): void { function openModelSheet(): void {
updateSheetPanelHeight()
const r = modelSheetRef.value const r = modelSheetRef.value
const inst = r != null ? (r as ComponentPublicInstance) : null const inst = r != null ? (r as ComponentPublicInstance) : null
if (inst != null) { if (inst != null) {
...@@ -381,6 +434,7 @@ ...@@ -381,6 +434,7 @@
/** 打开:mock 模式仅填充标签数据并弹出底部框,无请求/store/dispatch,避免异常进 catch */ /** 打开:mock 模式仅填充标签数据并弹出底部框,无请求/store/dispatch,避免异常进 catch */
function open(): void { function open(): void {
updateSheetPanelHeight()
if (USE_MOCK_CAR_BRAND_LIST) { if (USE_MOCK_CAR_BRAND_LIST) {
brandList.value = getMockFlatCarBrandRows() brandList.value = getMockFlatCarBrandRows()
nextTick(() => { nextTick(() => {
...@@ -455,15 +509,34 @@ ...@@ -455,15 +509,34 @@
<style scoped lang="scss"> <style scoped lang="scss">
.car-brand-select-root { .car-brand-select-root {
width: 100%;
display: flex;
flex-direction: column; flex-direction: column;
/* Android:避免父级 overflow:hidden 影响子 list-view 手势(同 CustomerTags / FormDetail) */
overflow: visible;
} }
.tag-scroll { .tag-list-view {
max-height: 400px; width: 100%;
max-width: 100%;
align-self: stretch;
box-sizing: border-box;
flex-shrink: 0;
margin-top: 8px; margin-top: 8px;
margin-bottom: 16px; margin-bottom: 16px;
} }
.tag-list-item {
width: 100%;
margin: 0;
box-sizing: border-box;
height: auto;
min-height: 0;
align-self: flex-start;
flex-grow: 0;
flex-shrink: 0;
}
.tag-box { .tag-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
......
...@@ -5,34 +5,44 @@ ...@@ -5,34 +5,44 @@
position="bottom" position="bottom"
:isFooter="false" :isFooter="false"
title="选择客户标签" title="选择客户标签"
:popupH="sheetPanelHeightPx"
:maxHeight="sheetPanelHeightPx"
@close="onSheetClose" @close="onSheetClose"
> >
<scroll-view class="tag-scroll" scroll-y="true" enable-flex> <list-view
<view class="tag-groups"> class="tag-list-view"
<template v-for="(group, gi) in tagGroups" :key="gi"> direction="vertical"
<view class="tag-section"> :bounces="false"
<text :show-scrollbar="true"
v-if="hasSectionTitle(group as UTSJSONObject)" :style="tagScrollStyle"
class="section-title" >
>{{ getCategoryTitle(group as UTSJSONObject) }}</text> <list-item class="tag-list-item" :type="0">
<view class="tag-box"> <view class="tag-groups">
<template <template v-for="(group, gi) in tagGroups" :key="gi">
v-for="(item, ti) in getGroupTags(group as UTSJSONObject)" <view class="tag-section">
:key="ti" <text
> v-if="hasSectionTitle(group as UTSJSONObject)"
<view class="section-title"
class="tag-item" >{{ getCategoryTitle(group as UTSJSONObject) }}</text>
:class="{ checked: isRowChecked(item as UTSJSONObject) }" <view class="tag-box">
@click="onTapRow(item as UTSJSONObject)" <template
v-for="(item, ti) in getGroupTags(group as UTSJSONObject)"
:key="ti"
> >
<text class="tag-text">{{ (item as UTSJSONObject)['label'] }}</text> <view
</view> class="tag-item"
</template> :class="{ checked: isRowChecked(item as UTSJSONObject) }"
@click="onTapRow(item as UTSJSONObject)"
>
<text class="tag-text">{{ (item as UTSJSONObject)['label'] }}</text>
</view>
</template>
</view>
</view> </view>
</view> </template>
</template> </view>
</view> </list-item>
</scroll-view> </list-view>
</MessageBox> </MessageBox>
</view> </view>
</template> </template>
...@@ -40,7 +50,7 @@ ...@@ -40,7 +50,7 @@
<script setup lang="uts"> <script setup lang="uts">
import MessageBox from '@/components/MessageBox.uvue' import MessageBox from '@/components/MessageBox.uvue'
import { findSenceTag } from '@/api/receiption.uts' import { findSenceTag } from '@/api/receiption.uts'
import { ref, nextTick } from 'vue' import { ref, nextTick, computed } from 'vue'
import { ComponentPublicInstance } from 'vue' import { ComponentPublicInstance } from 'vue'
/** 无接口或解析失败时的两级示例数据 */ /** 无接口或解析失败时的两级示例数据 */
...@@ -282,6 +292,41 @@ ...@@ -282,6 +292,41 @@
const sheetRef = ref<ComponentPublicInstance | null>(null) const sheetRef = ref<ComponentPublicInstance | null>(null)
const tagGroups = ref<Array<UTSJSONObject>>(buildMockTagGroups()) const tagGroups = ref<Array<UTSJSONObject>>(buildMockTagGroups())
/** 底部弹出层高度:屏幕高度的 50%(App 端不用 vh,用 windowHeight 换算为 px) */
const sheetPanelHeightPx = ref(400)
/**
* 弹层内用 list-view + 明确 px 高度纵向滚动(同 FormDetail);scroll-view 在 MessageBox/un-popup 内部分端仍不生效。
* 从面板高度扣除:MessageBox .tips-content 上下 padding 48、标题区约 36、本区 margin 8+16。
*/
const TAG_SCROLL_VERTICAL_RESERVE_PX = 120
const tagScrollStyle = computed((): UTSJSONObject => {
const panel = sheetPanelHeightPx.value
const h = panel - TAG_SCROLL_VERTICAL_RESERVE_PX
const finalH = h > 160 ? h : 160
const out = {} as UTSJSONObject
out['height'] = `${finalH}px`
out['width'] = '100%'
return out
})
function updateSheetPanelHeight(): void {
try {
const info = uni.getSystemInfoSync()
const wh = info.windowHeight
if (wh != null) {
const h = wh as number
if (h > 0) {
sheetPanelHeightPx.value = Math.floor(h / 2)
return
}
}
} catch (e) {
console.error('getSystemInfoSync 失败:', e)
}
sheetPanelHeightPx.value = 400
}
function getGroupTags(group: UTSJSONObject): Array<UTSJSONObject> { function getGroupTags(group: UTSJSONObject): Array<UTSJSONObject> {
const t = group['tags'] const t = group['tags']
...@@ -371,6 +416,7 @@ ...@@ -371,6 +416,7 @@
} }
async function open(): Promise<void> { async function open(): Promise<void> {
updateSheetPanelHeight()
await loadTagListFromApi() await loadTagListFromApi()
nextTick(() => { nextTick(() => {
nextTick(() => { nextTick(() => {
...@@ -394,18 +440,32 @@ ...@@ -394,18 +440,32 @@
width: 100%; width: 100%;
flex: 1; flex: 1;
min-height: 0; min-height: 0;
display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; /* Android:滚动父级勿用 overflow:hidden,易导致子 list-view 手势异常(FormDetail 同注) */
overflow: visible;
} }
/* 与 FormAdd 一致:scroll-view 需落在有界高度内;仅 max-height 在 App 端常无法触发纵向滚动 */ /* 高度由 tagScrollStyle 内联 px 指定 */
.tag-scroll { .tag-list-view {
flex: 1;
min-height: 0;
width: 100%; width: 100%;
max-width: 100%;
align-self: stretch;
box-sizing: border-box;
flex-shrink: 0;
margin-top: 8px; margin-top: 8px;
margin-bottom: 16px; margin-bottom: 16px;
overflow: hidden; }
.tag-list-item {
width: 100%;
margin: 0;
box-sizing: border-box;
height: auto;
min-height: 0;
align-self: flex-start;
flex-grow: 0;
flex-shrink: 0;
} }
.tag-groups { .tag-groups {
......
...@@ -5,21 +5,31 @@ ...@@ -5,21 +5,31 @@
position="bottom" position="bottom"
:isFooter="false" :isFooter="false"
title="选择接待场景" title="选择接待场景"
:popupH="sheetPanelHeightPx"
:maxHeight="sheetPanelHeightPx"
@close="onSheetClose" @close="onSheetClose"
> >
<scroll-view class="tag-scroll" scroll-y="true"> <list-view
<view class="tag-box"> class="tag-list-view"
<template v-for="(item, index) in sceneList" :key="index"> direction="vertical"
<view :bounces="false"
class="tag-item" :show-scrollbar="true"
:class="{ checked: isRowChecked(item as UTSJSONObject) }" :style="tagScrollStyle"
@click="onTapRow(item as UTSJSONObject)" >
> <list-item class="tag-list-item" :type="0">
<text class="tag-text">{{ (item as UTSJSONObject)['label'] }}</text> <view class="tag-box">
</view> <template v-for="(item, index) in sceneList" :key="index">
</template> <view
</view> class="tag-item"
</scroll-view> :class="{ checked: isRowChecked(item as UTSJSONObject) }"
@click="onTapRow(item as UTSJSONObject)"
>
<text class="tag-text">{{ (item as UTSJSONObject)['label'] }}</text>
</view>
</template>
</view>
</list-item>
</list-view>
</MessageBox> </MessageBox>
</view> </view>
</template> </template>
...@@ -27,7 +37,7 @@ ...@@ -27,7 +37,7 @@
<script setup lang="uts"> <script setup lang="uts">
import MessageBox from '@/components/MessageBox.uvue' import MessageBox from '@/components/MessageBox.uvue'
import { findAllSence } from '@/api/receiption.uts' import { findAllSence } from '@/api/receiption.uts'
import { ref, nextTick } from 'vue' import { ref, nextTick, computed } from 'vue'
import { ComponentPublicInstance } from 'vue' import { ComponentPublicInstance } from 'vue'
/** 接口失败或空列表时的兜底数据 */ /** 接口失败或空列表时的兜底数据 */
...@@ -116,6 +126,38 @@ ...@@ -116,6 +126,38 @@
const sheetRef = ref<ComponentPublicInstance | null>(null) const sheetRef = ref<ComponentPublicInstance | null>(null)
const sceneList = ref<Array<UTSJSONObject>>(buildMockSceneList()) const sceneList = ref<Array<UTSJSONObject>>(buildMockSceneList())
/** 底部弹层半屏高度,与 MessageBox popupH/maxHeight 一致(同 CustomerTags) */
const sheetPanelHeightPx = ref(400)
const TAG_SCROLL_VERTICAL_RESERVE_PX = 120
const tagScrollStyle = computed((): UTSJSONObject => {
const panel = sheetPanelHeightPx.value
const h = panel - TAG_SCROLL_VERTICAL_RESERVE_PX
const finalH = h > 160 ? h : 160
const out = {} as UTSJSONObject
out['height'] = `${finalH}px`
out['width'] = '100%'
return out
})
function updateSheetPanelHeight(): void {
try {
const info = uni.getSystemInfoSync()
const wh = info.windowHeight
if (wh != null) {
const h = wh as number
if (h > 0) {
sheetPanelHeightPx.value = Math.floor(h / 2)
return
}
}
} catch (_e) {
// ignore
}
sheetPanelHeightPx.value = 400
}
async function loadSceneListFromApi(): Promise<void> { async function loadSceneListFromApi(): Promise<void> {
try { try {
const params = { scene: 1 } as UTSJSONObject const params = { scene: 1 } as UTSJSONObject
...@@ -177,6 +219,7 @@ ...@@ -177,6 +219,7 @@
} }
async function open(): Promise<void> { async function open(): Promise<void> {
updateSheetPanelHeight()
await loadSceneListFromApi() await loadSceneListFromApi()
nextTick(() => { nextTick(() => {
nextTick(() => { nextTick(() => {
...@@ -197,15 +240,33 @@ ...@@ -197,15 +240,33 @@
<style scoped lang="scss"> <style scoped lang="scss">
.scene-select-root { .scene-select-root {
width: 100%;
display: flex;
flex-direction: column; flex-direction: column;
overflow: visible;
} }
.tag-scroll { .tag-list-view {
max-height: 400px; width: 100%;
max-width: 100%;
align-self: stretch;
box-sizing: border-box;
flex-shrink: 0;
margin-top: 8px; margin-top: 8px;
margin-bottom: 16px; margin-bottom: 16px;
} }
.tag-list-item {
width: 100%;
margin: 0;
box-sizing: border-box;
height: auto;
min-height: 0;
align-self: flex-start;
flex-grow: 0;
flex-shrink: 0;
}
.tag-box { .tag-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
......
...@@ -157,8 +157,9 @@ ...@@ -157,8 +157,9 @@
v-if="rightTabIndex == 0" v-if="rightTabIndex == 0"
v-for="(item, idx) in filteredEntryList" v-for="(item, idx) in filteredEntryList"
:key="getStr(item, 'id')" :key="getStr(item, 'id')"
class="list-card glass-card" class="list-card list-card-entry glass-card"
@click="onEntryCardClick(item)" @click="onEntryCardClick(item)"
@longpress="onEntryCardLongPress(item)"
> >
<view class="card-header-row"> <view class="card-header-row">
<view class="card-title-box"> <view class="card-title-box">
...@@ -172,38 +173,60 @@ ...@@ -172,38 +173,60 @@
<view class="info-row"><text class="info-label">客户标签</text><text class="info-value">{{ getStr(item, 'customerTags') }}</text></view> <view class="info-row"><text class="info-label">客户标签</text><text class="info-value">{{ getStr(item, 'customerTags') }}</text></view>
<view class="info-row info-row-last"><text class="info-label">到店时间</text><text class="info-value">{{ formatTimestamp(getTs(item, 'arrivalTime')) }}</text></view> <view class="info-row info-row-last"><text class="info-label">到店时间</text><text class="info-value">{{ formatTimestamp(getTs(item, 'arrivalTime')) }}</text></view>
</view> </view>
</view> <view
<!-- 接待复盘:原有展示 --> v-if="isEntryCardMaskVisible(item)"
<view class="entry-card-mask"
v-if="rightTabIndex == 1" @click.stop="onEntryCardMaskAbsorbTap"
v-for="(item, idx) in filteredCustomerList" >
:key="getStr(item, 'id')" <view class="entry-mask-header">
class="list-card glass-card" <view class="entry-mask-close-btn" @click.stop="closeEntryCardMask">
@click="onReceptionCardClick(item)" <un-icon name="close" color="#ffffff" size="22"></un-icon>
> </view>
<view class="card-header-row">
<view class="card-title-box">
<text class="card-name">{{ getStr(item, 'ownerName') }}</text>
<text class="card-car">{{ getStr(item, 'brandModel') }}</text>
</view> </view>
<view class="card-status-box"> <view class="entry-mask-actions-row">
<view class="status-badge bg-slate-100"> <view class="entry-mask-action" @click.stop="onEntryCardMaskEdit(item)">
<text class="status-text text-slate-400">{{ hasReceptionTime(item) ? '已复盘' : '未复盘' }}</text> <un-icon name="edit-pen" color="#ffffff" size="28"></un-icon>
<text class="entry-mask-action-text">编辑</text>
</view> </view>
<view <view class="entry-mask-action" @click.stop="onEntryCardMaskDelete(item)">
v-if="getStr(item, 'receptionResultName') != ''" <un-icon name="trash" color="#fecaca" size="28"></un-icon>
:class="getStr(item, 'receptionResultName').indexOf('成交') >= 0 ? 'status-badge bg-green-50' : 'status-badge bg-red-50'" <text class="entry-mask-action-text entry-mask-action-text-delete">删除</text>
>
<text :class="getStr(item, 'receptionResultName').indexOf('成交') >= 0 ? 'status-text text-green-400' : 'status-text text-red-400'">{{ getStr(item, 'receptionResultName') }}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="card-info-list"> </view>
<view class="info-row"><text class="info-label">客户电话</text><text class="info-value">{{ formatPhone(getStr(item, 'ownerPhone')) }}</text></view> <!-- 接待复盘:v-if 与 v-for 分节点,避免与 uvue/Vue 同节点优先级问题 -->
<view class="info-row"><text class="info-label">销售姓名</text><text class="info-value">{{ getStr(item, 'receptionist') }}</text></view> <view v-if="rightTabIndex == 1" class="reception-review-list">
<view class="info-row"><text class="info-label">接待时长</text><text class="info-value">{{ formatDuration(getTs(item, 'startTime'), getTs(item, 'endTime')) }}</text></view> <view
<view class="info-row"><text class="info-label">开始接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'startTime')) }}</text></view> v-for="(item, idx) in filteredCustomerList"
<view class="info-row info-row-last"><text class="info-label">结束接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'endTime')) }}</text></view> :key="getStr(item, 'id')"
class="list-card glass-card"
@click="onReceptionCardClick(item)"
>
<view class="card-header-row">
<view class="card-title-box">
<text class="card-name">{{ getStr(item, 'ownerName') }}</text>
<text class="card-car">{{ getStr(item, 'brandModel') }}</text>
</view>
<view class="card-status-box">
<view class="status-badge bg-slate-100">
<text class="status-text text-slate-400">{{ hasReceptionTime(item) ? '已复盘' : '未复盘' }}</text>
</view>
<view
v-if="getStr(item, 'receptionResultName') != ''"
:class="getStr(item, 'receptionResultName').indexOf('成交') >= 0 ? 'status-badge bg-green-50' : 'status-badge bg-red-50'"
>
<text :class="getStr(item, 'receptionResultName').indexOf('成交') >= 0 ? 'status-text text-green-400' : 'status-text text-red-400'">{{ getStr(item, 'receptionResultName') }}</text>
</view>
</view>
</view>
<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">{{ getStr(item, 'receptionist') }}</text></view>
<view class="info-row"><text class="info-label">接待时长</text><text class="info-value">{{ formatDuration(getTs(item, 'startTime'), getTs(item, 'endTime')) }}</text></view>
<view class="info-row"><text class="info-label">开始接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'startTime')) }}</text></view>
<view class="info-row info-row-last"><text class="info-label">结束接待</text><text class="info-value">{{ formatTimestamp(getTs(item, 'endTime')) }}</text></view>
</view>
</view> </view>
</view> </view>
...@@ -244,8 +267,8 @@ const filterTabIndex = ref(0); ...@@ -244,8 +267,8 @@ const filterTabIndex = ref(0);
// 客户录入筛选:0=今日到店,1=全部客户 // 客户录入筛选:0=今日到店,1=全部客户
const entryFilterIndex = ref(0); const entryFilterIndex = ref(0);
// 复盘 tabs:0=复盘,1=未复盘 // 复盘 tabs:0=复盘,1=未复盘(默认未复盘:客户档案接口数据通常无 startTime/endTime,默认「复盘」会把列表筛空)
const reviewTabIndex = ref(0); const reviewTabIndex = ref(1);
// 结果 tabs:0=战败,1=成交 // 结果 tabs:0=战败,1=成交
const resultTabIndex = ref(0); const resultTabIndex = ref(0);
...@@ -263,7 +286,16 @@ function getInitialReviewList(): UTSJSONObject[] { ...@@ -263,7 +286,16 @@ function getInitialReviewList(): UTSJSONObject[] {
{ id: 204, ownerName: '周芳', ownerPhone: '13644445555', brandModel: '问界 M9', receptionist: '张销售', receptionResultName: '战败', submitted: 0, startTime: h(14), endTime: h(14) + 30 * 60000 }, { id: 204, ownerName: '周芳', ownerPhone: '13644445555', brandModel: '问界 M9', receptionist: '张销售', receptionResultName: '战败', submitted: 0, startTime: h(14), endTime: h(14) + 30 * 60000 },
{ id: 205, ownerName: '吴磊', ownerPhone: '13555556666', brandModel: 'AITO M7', receptionist: '王销售', receptionResultName: '成交', submitted: 1 }, { id: 205, ownerName: '吴磊', ownerPhone: '13555556666', brandModel: 'AITO M7', receptionist: '王销售', receptionResultName: '成交', submitted: 1 },
{ id: 206, ownerName: '郑洁', ownerPhone: '13466667777', brandModel: '问界 M5', receptionist: '赵销售', receptionResultName: '成交', submitted: 0, startTime: h(16), endTime: h(16) + 50 * 60000 }, { id: 206, ownerName: '郑洁', ownerPhone: '13466667777', brandModel: '问界 M5', receptionist: '赵销售', receptionResultName: '成交', submitted: 0, startTime: h(16), endTime: h(16) + 50 * 60000 },
{ id: 207, ownerName: '冯洋', ownerPhone: '13377778888', brandModel: 'AITO M5', receptionist: '张销售', receptionResultName: '战败', submitted: 1, startTime: h(11), endTime: h(11) + 20 * 60000 } { id: 207, ownerName: '冯洋', ownerPhone: '13377778888', brandModel: 'AITO M5', receptionist: '张销售', receptionResultName: '战败', submitted: 1, startTime: h(11), endTime: h(11) + 20 * 60000 },
// 以下为补充模拟数据,覆盖「已提交/未提交 × 战败/成交 × 复盘/未复盘」各组合,便于列表与筛选联调
{ id: 208, ownerName: '陈静', ownerPhone: '13288889999', brandModel: '问界 M8', receptionist: '李销售', receptionResultName: '战败', submitted: 1, startTime: h(8) + 30 * 60000, endTime: h(8) + 55 * 60000 },
{ id: 209, ownerName: '林浩', ownerPhone: '13100001111', brandModel: 'AITO M5', receptionist: '王销售', receptionResultName: '成交', submitted: 1, startTime: h(13), endTime: h(13) + 40 * 60000 },
{ id: 210, ownerName: '黄蕾', ownerPhone: '13011112222', brandModel: '问界 M7', receptionist: '赵销售', receptionResultName: '战败', submitted: 1 },
{ id: 211, ownerName: '何斌', ownerPhone: '15922223333', brandModel: 'AITO M9', receptionist: '张销售', receptionResultName: '成交', submitted: 1 },
{ id: 212, ownerName: '罗敏', ownerPhone: '15833334444', brandModel: '问界 M5', receptionist: '李销售', receptionResultName: '战败', submitted: 0, startTime: h(15), endTime: h(15) + 25 * 60000 },
{ id: 213, ownerName: '邓凯', ownerPhone: '15744445555', brandModel: 'AITO M7', receptionist: '王销售', receptionResultName: '成交', submitted: 0 },
{ id: 214, ownerName: '蒋欣', ownerPhone: '15655556666', brandModel: '问界 M9', receptionist: '赵销售', receptionResultName: '战败', submitted: 0, startTime: h(17), endTime: h(17) + 35 * 60000 },
{ id: 215, ownerName: '谢宇', ownerPhone: '15566667777', brandModel: 'AITO M5', receptionist: '张销售', receptionResultName: '成交', submitted: 0, startTime: h(18), endTime: h(18) + 60 * 60000 }
] as UTSJSONObject[] ] as UTSJSONObject[]
} }
...@@ -300,6 +332,8 @@ const preEntryPopupVisible = ref(false) ...@@ -300,6 +332,8 @@ const preEntryPopupVisible = ref(false)
// 客户档案详情弹窗:客户录入卡片点击时展示 // 客户档案详情弹窗:客户录入卡片点击时展示
const showReceptionDetail = ref(false) const showReceptionDetail = ref(false)
const receptionDetailItem = ref<UTSJSONObject | null>(null) const receptionDetailItem = ref<UTSJSONObject | null>(null)
// 客户录入卡片操作遮罩:长按展开,空字符串表示未展示(按条目 id 字符串匹配)
const entryOverlayEntryId = ref('')
// 选中的品牌,默认问界 // 选中的品牌,默认问界
const selectedBrand = ref('问界') const selectedBrand = ref('问界')
// 对象字面量需显式断言为 UnPickerColumnItem,否则 UTS 会推断为 UTSJSONObject // 对象字面量需显式断言为 UnPickerColumnItem,否则 UTS 会推断为 UTSJSONObject
...@@ -329,6 +363,7 @@ function switchFilterTab(index: number): void { ...@@ -329,6 +363,7 @@ function switchFilterTab(index: number): void {
function switchEntryFilterTab(index: number): void { function switchEntryFilterTab(index: number): void {
entryFilterIndex.value = index entryFilterIndex.value = index
entryOverlayEntryId.value = ''
} }
function switchReviewTab(index: number): void { function switchReviewTab(index: number): void {
...@@ -341,6 +376,9 @@ function switchResultTab(index: number): void { ...@@ -341,6 +376,9 @@ function switchResultTab(index: number): void {
function switchRightTab(index: number): void { function switchRightTab(index: number): void {
rightTabIndex.value = index rightTabIndex.value = index
if (index != 0) {
entryOverlayEntryId.value = ''
}
} }
// 客户录入按钮点击:打开预录信息全屏弹出层(由右向左滑入) // 客户录入按钮点击:打开预录信息全屏弹出层(由右向左滑入)
...@@ -355,6 +393,7 @@ function onPreEntryClose(): void { ...@@ -355,6 +393,7 @@ function onPreEntryClose(): void {
// 客户录入卡片点击:打开 FormDetail 弹窗展示客户档案详情 // 客户录入卡片点击:打开 FormDetail 弹窗展示客户档案详情
function onEntryCardClick(item: UTSJSONObject): void { function onEntryCardClick(item: UTSJSONObject): void {
entryOverlayEntryId.value = ''
receptionDetailItem.value = item receptionDetailItem.value = item
showReceptionDetail.value = true showReceptionDetail.value = true
} }
...@@ -372,6 +411,47 @@ function getStr(data: UTSJSONObject, key: string): string { ...@@ -372,6 +411,47 @@ function getStr(data: UTSJSONObject, key: string): string {
return `${v}` return `${v}`
} }
// 客户录入卡片长按:展开操作遮罩
function onEntryCardLongPress(item: UTSJSONObject): void {
entryOverlayEntryId.value = getStr(item, 'id')
}
function closeEntryCardMask(): void {
entryOverlayEntryId.value = ''
}
// 遮罩层吸收点击,避免穿透触发卡片打开详情
function onEntryCardMaskAbsorbTap(): void {}
function isEntryCardMaskVisible(item: UTSJSONObject): boolean {
const idStr = getStr(item, 'id')
return entryOverlayEntryId.value != '' && idStr == entryOverlayEntryId.value
}
// 遮罩内「编辑」:关闭遮罩并打开详情(后续可接专用编辑表单)
function onEntryCardMaskEdit(item: UTSJSONObject): void {
closeEntryCardMask()
receptionDetailItem.value = item
showReceptionDetail.value = true
}
// 遮罩内「删除」:从录入列表移除当前项
function onEntryCardMaskDelete(item: UTSJSONObject): void {
const idStr = getStr(item, 'id')
const list = entryList.value
const next: UTSJSONObject[] = []
let i = 0
while (i < list.length) {
if (getStr(list[i], 'id') != idStr) {
next.push(list[i])
}
i++
}
entryList.value = next
closeEntryCardMask()
uni.showToast({ title: '已删除', icon: 'none' })
}
// 接待复盘卡片点击:若为成交则展示接待详情 // 接待复盘卡片点击:若为成交则展示接待详情
const emit = defineEmits<{ const emit = defineEmits<{
'show-reception-detail': [item: UTSJSONObject] 'show-reception-detail': [item: UTSJSONObject]
...@@ -379,9 +459,9 @@ const emit = defineEmits<{ ...@@ -379,9 +459,9 @@ const emit = defineEmits<{
function onReceptionCardClick(item: UTSJSONObject): void { function onReceptionCardClick(item: UTSJSONObject): void {
const resultName = getStr(item, 'receptionResultName') const resultName = getStr(item, 'receptionResultName')
if (resultName.indexOf('成交') >= 0) { // if (resultName.indexOf('成交') >= 0) {
// emit('show-reception-detail', item) emit('show-reception-detail', item)
} // }
} }
// Tab 数据结构 // Tab 数据结构
...@@ -1016,12 +1096,76 @@ onMounted(() => { ...@@ -1016,12 +1096,76 @@ onMounted(() => {
flex-direction: column; flex-direction: column;
} }
.reception-review-list {
flex-direction: column;
width: 100%;
}
.list-card { .list-card {
padding: 20px; padding: 20px;
border-radius: 24px; border-radius: 24px;
margin-bottom: 16px; margin-bottom: 16px;
} }
/* 客户录入卡片:承载长按操作遮罩 */
.list-card-entry {
position: relative;
overflow: hidden;
}
.entry-card-mask {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border-radius: 24px;
background-color: rgba(15, 23, 42, 0.78);
flex-direction: column;
z-index: 10;
}
.entry-mask-header {
flex-direction: row;
justify-content: flex-end;
padding-top: 4px;
padding-right: 4px;
padding-left: 8px;
}
.entry-mask-close-btn {
padding: 8px;
flex-direction: row;
align-items: center;
justify-content: center;
}
.entry-mask-actions-row {
flex: 1;
flex-direction: row;
align-items: center;
justify-content: center;
padding-bottom: 16px;
}
.entry-mask-action {
flex-direction: column;
align-items: center;
margin-left: 28px;
margin-right: 28px;
}
.entry-mask-action-text {
font-size: 13px;
color: #ffffff;
margin-top: 8px;
text-align: center;
}
.entry-mask-action-text-delete {
color: #fecaca;
}
.card-header-row { .card-header-row {
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
......
...@@ -112,11 +112,21 @@ ...@@ -112,11 +112,21 @@
const visible = ref<boolean>(false) const visible = ref<boolean>(false)
const popupRef= ref(null) const popupRef= ref(null)
const popupStyle = computed(() => { const popupStyle = computed(() => {
return { const w = props.popupW != null && props.popupW > 0 ? (props.popupW ?? 0) + 'px' : '100%'
width: props.popupW != null && props.popupW > 0 ? (props.popupW ?? 0) + 'px' : '100%', const minH = props.popupH != null && props.popupH > 0 ? (props.popupH ?? 0) + 'px' : '100%'
minHeight: props.popupH != null && props.popupH > 0 ? (props.popupH ?? 0) + 'px' : '100%', const maxH = props.maxHeight != null && props.maxHeight > 0 ? (props.maxHeight ?? 0) + 'px' : '100%'
maxHeight: props.maxHeight != null && props.maxHeight > 0 ? (props.maxHeight ?? 0) + 'px' : '100%' const style = {
width: w,
minHeight: minH,
maxHeight: maxH
} as UTSJSONObject
// 底部弹层且 min/max 为同一像素值时(如半屏高),固定 height,避免 App 端仅靠 max-height 时外层随内容增高、scroll-view 无法滚动
const ph = props.popupH != null ? props.popupH as number : 0
const mh = props.maxHeight != null ? props.maxHeight as number : 0
if (props.position === 'bottom' && ph > 0 && mh > 0 && ph === mh) {
style['height'] = mh + 'px'
} }
return style
}) })
function onClose(): void { function onClose(): void {
emit('close') emit('close')
...@@ -161,14 +171,18 @@ ...@@ -161,14 +171,18 @@
background: #ffffff; background: #ffffff;
border-radius: 10px; border-radius: 10px;
height: 100%; height: 100%;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column; flex-direction: column;
.tips-content { .tips-content {
width: 100%; width: 100%;
padding: 24px; padding: 24px;
box-sizing: border-box; box-sizing: border-box;
height: calc(100% - 50px); flex: 1;
min-height: 0;
position: relative; position: relative;
display: flex;
flex-direction: column; flex-direction: column;
.icon-close-box { .icon-close-box {
position: absolute; position: absolute;
...@@ -184,6 +198,7 @@ ...@@ -184,6 +198,7 @@
.tips-title { .tips-title {
position: relative; position: relative;
width: 100%; width: 100%;
flex-shrink: 0;
font-weight: 500; font-weight: 500;
font-size: 18px; font-size: 18px;
color: #292d33; color: #292d33;
...@@ -200,6 +215,7 @@ ...@@ -200,6 +215,7 @@
.tips-text { .tips-text {
display: block; display: block;
flex-shrink: 0;
font-size: 15px; font-size: 15px;
color: #5a5e66; color: #5a5e66;
letter-spacing: 0.5px; letter-spacing: 0.5px;
...@@ -213,6 +229,7 @@ ...@@ -213,6 +229,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 50px; height: 50px;
flex-shrink: 0;
border-top: 1px solid #e8e8e8; border-top: 1px solid #e8e8e8;
flex-direction: row; flex-direction: row;
.close { .close {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!