Commit 99fa49ed by Lin

feat(reception): 为接待中心添加分辨率适配样式配置

- 在 CardContainer 组件中新增 rootStyle 属性以支持内联样式覆盖
- 为 CardFlow、CardMonthValue、CardOutputValue 等卡片组件添加动态样式计算,基于 portrait.uts 配置
- 在 center.uvue 中为主 Tab 添加分辨率相关的样式配置,包括高度、字体大小、内边距等
- 为 ListCustomer 和 ListReception 列表组件添加文本样式适配,支持双列布局和字体大小调整
- 将 CustomerListPanel 和 ReceptionCustomerListTab 中的滚动容器从 scroll-view 替换为 list-view 以优化 App 端滚动体验
- 在 portrait.uts 中扩展配置类型,包括主 Tab、看板、列表文本等,并添加相应的获取函数
- 更新 launch.json 中的 playground 配置为 custom
1 parent 3b2d2699
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"version" : "1.0", "version" : "1.0",
"configurations" : [ "configurations" : [
{ {
"playground" : "standard", "playground" : "custom",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
} }
] ]
......
<template> <template>
<view :class="rootClass"> <view :class="rootClass" :style="containerRootStyle">
<slot /> <slot />
</view> </view>
</template> </template>
...@@ -18,13 +18,24 @@ const props = withDefaults( ...@@ -18,13 +18,24 @@ const props = withDefaults(
variant?: 'plain' | 'output' | 'funnel' variant?: 'plain' | 'output' | 'funnel'
/** 追加在根节点上的 class,空格分隔,便于业务侧扩展布局或覆盖 */ /** 追加在根节点上的 class,空格分隔,便于业务侧扩展布局或覆盖 */
extraClass?: string extraClass?: string
/** 分辨率适配等场景下覆盖 padding / 圆角 / 外边距(与 class 叠加,内联优先) */
rootStyle?: UTSJSONObject | null
}>(), }>(),
{ {
variant: 'output', variant: 'output',
extraClass: '' extraClass: '',
rootStyle: null
} }
) )
const containerRootStyle = computed((): UTSJSONObject => {
const s = props.rootStyle
if (s != null) {
return s
}
return {} as UTSJSONObject
})
const rootClass = computed((): string => { const rootClass = computed((): string => {
let s = 'card-container' let s = 'card-container'
if (props.variant == 'output' || props.variant == 'funnel') { if (props.variant == 'output' || props.variant == 'funnel') {
......
<template> <template>
<card-container variant="funnel"> <card-container variant="funnel" :root-style="flowCardRootStyle">
<view class="title-box"> <view class="title-box">
<text class="title-text">门店客流情况</text> <text class="title-text" :style="flowTitleTextStyle">门店客流情况</text>
</view> </view>
<view class="funnel-container"> <view class="funnel-container" :style="funnelContainerStyle">
<view class="flow-layout"> <view class="flow-layout" :style="flowLayoutStyle">
<view class="funnel-main"> <view class="funnel-main" :style="funnelMainStyle">
<view class="metric-card"> <view class="metric-card" :style="metricCardStyle">
<text class="metric-label">累计交付数</text> <text class="metric-label" :style="metricLabelTextStyle">累计交付数</text>
<text class="metric-value">{{ funnelCountDisplay1 }}</text> <text class="metric-value" :style="metricValueTextStyle">{{ funnelCountDisplay1 }}</text>
</view> </view>
<view class="metric-card metric-card-secondary"> <view class="metric-card metric-card-secondary" :style="metricCardSecondaryStyle">
<text class="metric-label">实际触客数</text> <text class="metric-label" :style="metricLabelTextStyle">实际触客数</text>
<text class="metric-value">{{ funnelCountDisplay2 }}</text> <text class="metric-value" :style="metricValueTextStyle">{{ funnelCountDisplay2 }}</text>
</view> </view>
</view> </view>
<view class="rate-badge"> <view class="rate-badge" :style="rateBadgeStyle">
<text class="rate-caption">触客率</text> <text class="rate-caption" :style="rateCaptionTextStyle">触客率</text>
<text class="rate-value">{{ contactRateMasked }}%</text> <text class="rate-value" :style="rateValueTextStyle">{{ contactRateMasked }}%</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -27,6 +27,11 @@ ...@@ -27,6 +27,11 @@
<script setup lang="uts"> <script setup lang="uts">
import { computed } from 'vue' import { computed } from 'vue'
import CardContainer from './CardContainer.uvue' import CardContainer from './CardContainer.uvue'
import { cssClassRef } from '@/services/adapter'
import {
getReceptionPortraitDashboardConfig,
type ReceptionPortraitDashboardConfig
} from '../styles/portrait.uts'
/** 业绩看板聚合数据,与 center 中 performanceData 同源 */ /** 业绩看板聚合数据,与 center 中 performanceData 同源 */
const props = withDefaults( const props = withDefaults(
...@@ -90,6 +95,116 @@ const contactRateMasked = computed((): string => { ...@@ -90,6 +95,116 @@ const contactRateMasked = computed((): string => {
} }
return contactRateDisplay.value return contactRateDisplay.value
}) })
const portraitDash = computed((): ReceptionPortraitDashboardConfig | null => {
return getReceptionPortraitDashboardConfig(cssClassRef.value)
})
function flowPick(mapper: (c: ReceptionPortraitDashboardConfig) => UTSJSONObject): UTSJSONObject {
const c = portraitDash.value
if (c == null) {
return {} as UTSJSONObject
}
return mapper(c)
}
const flowCardRootStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return {
padding: c.dashCardPadding,
borderRadius: c.dashCardBorderRadius,
boxShadow: c.dashCardBoxShadow,
marginBottom: c.dashCardFunnelMarginBottom
} as UTSJSONObject
})
})
const flowTitleTextStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return { fontSize: c.dashFlowTitleFontSize } as UTSJSONObject
})
})
const funnelContainerStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return {
borderRadius: c.dashFunnelContainerBorderRadius,
padding: c.dashFunnelContainerPadding,
marginTop: c.dashFunnelContainerMarginTop
} as UTSJSONObject
})
})
const flowLayoutStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return { minHeight: c.dashFlowLayoutMinHeight } as UTSJSONObject
})
})
const funnelMainStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return {
minHeight: c.dashFunnelMainMinHeight,
paddingRight: c.dashFunnelMainPaddingRight
} as UTSJSONObject
})
})
const metricCardStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return {
minHeight: c.dashMetricCardMinHeight,
borderRadius: c.dashMetricCardBorderRadius,
padding: c.dashMetricCardPadding
} as UTSJSONObject
})
})
const metricCardSecondaryStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return { marginTop: c.dashMetricCardSecondaryMarginTop } as UTSJSONObject
})
})
const metricLabelTextStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return { fontSize: c.dashMetricLabelFontSize } as UTSJSONObject
})
})
const metricValueTextStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return {
fontSize: c.dashMetricValueFontSize,
marginTop: c.dashMetricValueMarginTop
} as UTSJSONObject
})
})
const rateBadgeStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return {
width: c.dashRateBadgeWidth,
height: c.dashRateBadgeHeight,
borderRadius: c.dashRateBadgeBorderRadius
} as UTSJSONObject
})
})
const rateCaptionTextStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return { fontSize: c.dashRateCaptionFontSize } as UTSJSONObject
})
})
const rateValueTextStyle = computed((): UTSJSONObject => {
return flowPick((c) => {
return {
fontSize: c.dashRateValueFontSize,
marginTop: c.dashRateValueMarginTop
} as UTSJSONObject
})
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
<template> <template>
<card-container> <card-container :root-style="monthCardRootStyle">
<view class="title-box"> <view class="title-box">
<text class="title-text">本月业绩</text> <text class="title-text" :style="monthTitleTextStyle">本月业绩</text>
</view> </view>
<view class="output-summary"> <view class="output-summary" :style="outputSummaryStyle">
<!-- 左侧数值 --> <!-- 左侧数值 -->
<view class="summary-left"> <view class="summary-left">
<text class="summary-label">本月预估总产值</text> <text class="summary-label" :style="summaryLabelTextStyle">本月预估总产值</text>
<view class="summary-value-box"> <view class="summary-value-box">
<text class="summary-value-num">{{ summaryNumDisplay }}</text> <text class="summary-value-num" :style="summaryValueNumStyle">{{ summaryNumDisplay }}</text>
<text class="summary-value-unit">{{ summaryUnitDisplay }}</text> <text class="summary-value-unit" :style="summaryValueUnitStyle">{{ summaryUnitDisplay }}</text>
</view> </view>
<view class="summary-personal"> <view class="summary-personal" :style="summaryPersonalStyle">
<text class="personal-label">个人产值占比:</text> <text class="personal-label" :style="personalLabelTextStyle">个人产值占比:</text>
<text class="personal-value">{{ personalValueDisplay }}</text> <text class="personal-value" :style="personalValueTextStyle">{{ personalValueDisplay }}</text>
</view> </view>
</view> </view>
<!-- 右侧环形图 --> <!-- 右侧环形图 -->
<view class="summary-right"> <view class="summary-right">
<view class="ring-chart-wrap"> <view class="ring-chart-wrap" :style="ringChartWrapStyle">
<!-- 底部灰色环 --> <!-- 底部灰色环 -->
<view class="ring-bg"></view> <view class="ring-bg" :style="ringBgStyle"></view>
<!-- 进度半圆 --> <!-- 进度半圆 -->
<view v-if="metricsVisible" class="ring-progress-wrap"> <view v-if="metricsVisible" class="ring-progress-wrap" :style="ringProgressWrapStyle">
<view class="ring-half ring-half-left"> <view class="ring-half ring-half-left" :style="ringHalfOuterLeftStyle">
<view class="ring-half-inner" :style="ringLeftStyle"></view> <view class="ring-half-inner" :style="ringHalfInnerLeftStyle"></view>
</view> </view>
<view class="ring-half ring-half-right"> <view class="ring-half ring-half-right" :style="ringHalfOuterRightStyle">
<view class="ring-half-inner" :style="ringRightStyle"></view> <view class="ring-half-inner" :style="ringHalfInnerRightStyle"></view>
</view> </view>
</view> </view>
<!-- 中间文本 --> <!-- 中间文本 -->
<view class="ring-inner-text"> <view class="ring-inner-text">
<text class="ring-value">{{ ringPercentDisplay }}</text> <text class="ring-value" :style="ringValueTextStyle">{{ ringPercentDisplay }}</text>
<text class="ring-label">个人业绩占比</text> <text class="ring-label" :style="ringLabelTextStyle">个人业绩占比</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 底部指标 --> <!-- 底部指标 -->
<view class="month-target-box"> <view class="month-target-box" :style="monthTargetBoxStyle">
<view class="target-item"> <view class="target-item">
<text class="target-label">本月目标产值</text> <text class="target-label" :style="targetLabelTextStyle">本月目标产值</text>
<text class="target-value">{{ targetValueDisplay }}</text> <text class="target-value" :style="targetValueTextStyle">{{ targetValueDisplay }}</text>
</view> </view>
<view class="target-item"> <view class="target-item">
<text class="target-label">本月达成</text> <text class="target-label" :style="targetLabelTextStyle">本月达成</text>
<text class="target-value">{{ achievementValueDisplay }}</text> <text class="target-value" :style="targetValueTextStyle">{{ achievementValueDisplay }}</text>
</view> </view>
</view> </view>
</card-container> </card-container>
...@@ -61,6 +61,11 @@ ...@@ -61,6 +61,11 @@
import { computed } from 'vue' import { computed } from 'vue'
import CardContainer from './CardContainer.uvue' import CardContainer from './CardContainer.uvue'
import type { OutputSummary } from '../types/reception-output-types.uts' import type { OutputSummary } from '../types/reception-output-types.uts'
import { cssClassRef } from '@/services/adapter'
import {
getReceptionPortraitDashboardConfig,
type ReceptionPortraitDashboardConfig
} from '../styles/portrait.uts'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
...@@ -142,6 +147,216 @@ const ringRightStyle = computed(() => { ...@@ -142,6 +147,216 @@ const ringRightStyle = computed(() => {
const deg = p01 > 0.5 ? (p01 - 0.5) * 360 : 0 const deg = p01 > 0.5 ? (p01 - 0.5) * 360 : 0
return { transform: `rotate(${deg}deg)` } return { transform: `rotate(${deg}deg)` }
}) })
const portraitDash = computed((): ReceptionPortraitDashboardConfig | null => {
return getReceptionPortraitDashboardConfig(cssClassRef.value)
})
function monthPick(mapper: (c: ReceptionPortraitDashboardConfig) => UTSJSONObject): UTSJSONObject {
const c = portraitDash.value
if (c == null) {
return {} as UTSJSONObject
}
return mapper(c)
}
const monthCardRootStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
padding: c.dashCardPadding,
borderRadius: c.dashCardBorderRadius,
boxShadow: c.dashCardBoxShadow
} as UTSJSONObject
})
})
const monthTitleTextStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return { fontSize: c.dashMonthTitleFontSize } as UTSJSONObject
})
})
const outputSummaryStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return { marginTop: c.dashOutputSummaryMarginTop } as UTSJSONObject
})
})
const summaryLabelTextStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
fontSize: c.dashSummaryLabelFontSize,
marginBottom: c.dashSummaryLabelMarginBottom
} as UTSJSONObject
})
})
const summaryValueNumStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return { fontSize: c.dashSummaryValueNumFontSize } as UTSJSONObject
})
})
const summaryValueUnitStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
fontSize: c.dashSummaryValueUnitFontSize,
marginLeft: c.dashSummaryValueUnitMarginLeft,
paddingBottom: c.dashSummaryValueUnitPaddingBottom
} as UTSJSONObject
})
})
const summaryPersonalStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
marginTop: c.dashSummaryPersonalMarginTop,
padding: c.dashSummaryPersonalPadding,
borderRadius: c.dashSummaryPersonalBorderRadius
} as UTSJSONObject
})
})
const personalLabelTextStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return { fontSize: c.dashPersonalLabelFontSize } as UTSJSONObject
})
})
const personalValueTextStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
fontSize: c.dashPersonalValueFontSize,
marginLeft: c.dashPersonalValueMarginLeft
} as UTSJSONObject
})
})
const monthTargetBoxStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
marginTop: c.dashMonthTargetBoxMarginTop,
paddingTop: c.dashMonthTargetBoxPaddingTop
} as UTSJSONObject
})
})
const targetLabelTextStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return { fontSize: c.dashTargetLabelFontSize } as UTSJSONObject
})
})
const targetValueTextStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
fontSize: c.dashTargetValueFontSize,
marginTop: c.dashTargetValueMarginTop,
fontWeight: '700'
} as UTSJSONObject
})
})
const ringChartWrapStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
width: c.dashRingChartSize,
height: c.dashRingChartSize
} as UTSJSONObject
})
})
const ringBgStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
width: c.dashRingChartSize,
height: c.dashRingChartSize,
borderRadius: c.dashRingBgBorderRadius,
borderWidth: c.dashRingBorderWidth
} as UTSJSONObject
})
})
const ringProgressWrapStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
width: c.dashRingChartSize,
height: c.dashRingChartSize
} as UTSJSONObject
})
})
const ringHalfOuterLeftStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
width: c.dashRingHalfWidth,
height: c.dashRingChartSize
} as UTSJSONObject
})
})
const ringHalfOuterRightStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
width: c.dashRingHalfWidth,
height: c.dashRingChartSize,
left: c.dashRingHalfWidth
} as UTSJSONObject
})
})
const ringHalfInnerLeftStyle = computed((): UTSJSONObject => {
const rot = ringLeftStyle.value as UTSJSONObject
const c = portraitDash.value
if (c == null) {
return rot
}
const tr = rot['transform']
const trStr = tr != null ? `${tr}` : 'rotate(0deg)'
return {
width: c.dashRingChartSize,
height: c.dashRingChartSize,
borderRadius: c.dashRingProgressInnerBorderRadius,
borderWidth: c.dashRingBorderWidth,
transformOrigin: c.dashRingTransformOrigin,
left: '0px',
transform: trStr
} as UTSJSONObject
})
const ringHalfInnerRightStyle = computed((): UTSJSONObject => {
const rot = ringRightStyle.value as UTSJSONObject
const c = portraitDash.value
if (c == null) {
return rot
}
const tr = rot['transform']
const trStr = tr != null ? `${tr}` : 'rotate(0deg)'
return {
width: c.dashRingChartSize,
height: c.dashRingChartSize,
borderRadius: c.dashRingProgressInnerBorderRadius,
borderWidth: c.dashRingBorderWidth,
transformOrigin: c.dashRingTransformOrigin,
left: c.dashRingHalfInnerLeftOffset,
transform: trStr
} as UTSJSONObject
})
const ringValueTextStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return { fontSize: c.dashRingValueFontSize } as UTSJSONObject
})
})
const ringLabelTextStyle = computed((): UTSJSONObject => {
return monthPick((c) => {
return {
fontSize: c.dashRingLabelFontSize,
marginTop: c.dashRingLabelMarginTop
} as UTSJSONObject
})
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
<template> <template>
<card-container> <card-container :root-style="outputCardRootStyle">
<view class="tabs-box"> <view class="tabs-box" :style="outputTabsBoxStyle">
<un-segmented <un-segmented
shape="circle" shape="circle"
type="card" type="card"
:font-size="14" :font-size="segmentedFontSize"
:model-value="tabIndex" :model-value="tabIndex"
active-color="#000000" active-color="#000000"
@update:model-value="onSegmentedTabIndex" @update:model-value="onSegmentedTabIndex"
...@@ -20,24 +20,31 @@ ...@@ -20,24 +20,31 @@
:key="idx" :key="idx"
class="compare-row" class="compare-row"
:class="{ 'compare-row-last': idx == compareRows.length - 1 }" :class="{ 'compare-row-last': idx == compareRows.length - 1 }"
:style="compareRowStyle(idx)"
> >
<text class="compare-label">{{ row.label }}</text> <text class="compare-label" :style="compareLabelTextStyle">{{ row.label }}</text>
<view class="compare-bar-bg"> <view class="compare-bar-bg" :style="compareBarBgStyle">
<view <view
class="compare-bar-fill" class="compare-bar-fill"
:class="row.barClass" :class="row.barClass"
:style="{ width: row.barWidthPercent }" :style="compareBarFillStyle(row)"
></view> ></view>
</view> </view>
<text class="compare-value">{{ metricsVisible ? row.value : '****' }}</text> <text class="compare-value" :style="compareValueTextStyle">{{ metricsVisible ? row.value : '****' }}</text>
</view> </view>
</view> </view>
</card-container> </card-container>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed } from 'vue'
import CardContainer from './CardContainer.uvue' import CardContainer from './CardContainer.uvue'
import type { CompareRow } from '../types/reception-output-types.uts' import type { CompareRow } from '../types/reception-output-types.uts'
import { cssClassRef } from '@/services/adapter'
import {
getReceptionPortraitDashboardConfig,
type ReceptionPortraitDashboardConfig
} from '../styles/portrait.uts'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
...@@ -62,6 +69,96 @@ const emit = defineEmits<{ ...@@ -62,6 +69,96 @@ const emit = defineEmits<{
const onSegmentedTabIndex = (v: number): void => { const onSegmentedTabIndex = (v: number): void => {
emit('update:tabIndex', v) emit('update:tabIndex', v)
} }
const portraitDash = computed((): ReceptionPortraitDashboardConfig | null => {
return getReceptionPortraitDashboardConfig(cssClassRef.value)
})
function outPick(mapper: (c: ReceptionPortraitDashboardConfig) => UTSJSONObject): UTSJSONObject {
const c = portraitDash.value
if (c == null) {
return {} as UTSJSONObject
}
return mapper(c)
}
const outputCardRootStyle = computed((): UTSJSONObject => {
return outPick((c) => {
return {
padding: c.dashCardPadding,
borderRadius: c.dashCardBorderRadius,
boxShadow: c.dashCardBoxShadow
} as UTSJSONObject
})
})
const outputTabsBoxStyle = computed((): UTSJSONObject => {
return outPick((c) => {
return { marginBottom: c.dashOutputTabsMarginBottom } as UTSJSONObject
})
})
const segmentedFontSize = computed((): number => {
const c = portraitDash.value
if (c != null) {
return c.dashSegmentedFontSize
}
return 14
})
const compareLabelTextStyle = computed((): UTSJSONObject => {
return outPick((c) => {
return {
fontSize: c.dashCompareLabelFontSize,
width: c.dashCompareLabelWidth
} as UTSJSONObject
})
})
const compareBarBgStyle = computed((): UTSJSONObject => {
return outPick((c) => {
return {
height: c.dashCompareBarHeight,
borderRadius: c.dashCompareBarBorderRadius,
marginRight: c.dashCompareBarBgMarginRight
} as UTSJSONObject
})
})
function compareBarFillStyle(row: CompareRow): UTSJSONObject {
const base = { width: row.barWidthPercent } as UTSJSONObject
const c = portraitDash.value
if (c == null) {
return base
}
return {
width: row.barWidthPercent,
height: c.dashCompareBarHeight,
borderRadius: c.dashCompareBarBorderRadius
} as UTSJSONObject
}
const compareValueTextStyle = computed((): UTSJSONObject => {
return outPick((c) => {
return {
fontSize: c.dashCompareValueFontSize,
width: c.dashCompareValueWidth,
fontWeight: '700'
} as UTSJSONObject
})
})
function compareRowStyle(idx: number): UTSJSONObject {
const c = portraitDash.value
if (c == null) {
return {} as UTSJSONObject
}
const last = idx == props.compareRows.length - 1
if (last) {
return {} as UTSJSONObject
}
return { marginBottom: c.dashCompareRowMarginBottom } as UTSJSONObject
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -12,18 +12,19 @@ ...@@ -12,18 +12,19 @@
<!-- <view class="reception-navbar-spacer"></view> --> <!-- <view class="reception-navbar-spacer"></view> -->
<!-- Tab 切换 --> <!-- Tab 切换 -->
<view v-if="isLandscape != true" class="reception-tabs-container"> <view v-if="isLandscape != true" class="reception-tabs-container" :style="receptionTabsContainerStyle">
<un-tabs <un-tabs
class="reception-main-tabs" class="reception-main-tabs"
:style="receptionMainTabsShellStyle"
:value="mainTabIndex" :value="mainTabIndex"
:list="mainTabs" :list="mainTabs"
:height="52" :height="mainTabBarHeight"
:lineWidth="42" :lineWidth="mainTabLineWidth"
:lineHeight="4" :lineHeight="mainTabLineHeight"
lineColor="#1677ff" lineColor="#1677ff"
:activeStyle="{ color: '#1677ff', fontWeight: 700, fontSize: '17px' }" :activeStyle="mainTabActiveStyle"
:inactiveStyle="{ color: '#94a3b8', fontWeight: 500, fontSize: '15px' }" :inactiveStyle="mainTabInactiveStyle"
:itemStyle="{ paddingLeft: '18px', paddingRight: '18px' }" :itemStyle="mainTabItemStyle"
@change="onMainTabChange" @change="onMainTabChange"
></un-tabs> ></un-tabs>
</view> </view>
...@@ -184,7 +185,11 @@ import { resolutionState } from '@/services/adapter/index.uts' ...@@ -184,7 +185,11 @@ import { resolutionState } from '@/services/adapter/index.uts'
import { cssClassRef } from "@/services/adapter"; import { cssClassRef } from "@/services/adapter";
// 导入样式变量 // 导入样式变量
import { getLandscapeConfig } from "./styles/landscape.uts"; import { getLandscapeConfig } from "./styles/landscape.uts";
import { getPortraitConfig } from "./styles/portrait.uts"; import {
getPortraitConfig,
getReceptionPortraitMainTabsConfig,
type ReceptionPortraitMainTabsConfig
} from "./styles/portrait.uts";
// ========== Tab 管理 ========== // ========== Tab 管理 ==========
// ========== Tab 管理 ========== // ========== Tab 管理 ==========
/** 主 Tab:0=业绩看板,1=客户列表 */ /** 主 Tab:0=业绩看板,1=客户列表 */
...@@ -201,36 +206,109 @@ const dynamicModuleBoxStyle = computed((): any => { ...@@ -201,36 +206,109 @@ const dynamicModuleBoxStyle = computed((): any => {
const adapterCls = cssClassRef.value; const adapterCls = cssClassRef.value;
// // 横屏配置
// const landscapeConfig = getLandscapeConfig(adapterCls);
// console.log('[receptionCenter] landscapeConfig', landscapeConfig);
// // 竖屏配置
// const portraitConfig = getPortraitConfig(adapterCls);
if (adapterCls.indexOf('layout-landscape-1174x768') >= 0) { if (adapterCls.indexOf('layout-landscape-1174x768') >= 0) {
const cfg = getLandscapeConfig(adapterCls) const cfg = getLandscapeConfig(adapterCls)
// 注意:getLandscapeConfig 返回模块级常量对象(同引用),computed 可能判定“值未变”从而不触发视图更新
// 这里返回一个新对象引用,确保 :style 能更新
return cfg != null ? ({ ...cfg } as UTSJSONObject) : ({} as UTSJSONObject); return cfg != null ? ({ ...cfg } as UTSJSONObject) : ({} as UTSJSONObject);
// return {
// backgroundColor: '#134aff',
// height: '300px'
// };
} }
if (adapterCls.indexOf('layout-portrait-768x1174') >= 0) { if (adapterCls.indexOf('layout-portrait-768x1174') >= 0) {
const cfg = getPortraitConfig(adapterCls) const cfg = getPortraitConfig(adapterCls)
return cfg != null ? ({ ...cfg } as UTSJSONObject) : ({} as UTSJSONObject); return cfg != null ? ({ ...cfg } as UTSJSONObject) : ({} as UTSJSONObject);
// return {
// backgroundColor: '#886efc',
// height: '60px'
// };
} }
// computed 返回值不能为 null(UTS 中 Any? -> Any 会触发类型不匹配) // computed 返回值不能为 null(UTS 中 Any? -> Any 会触发类型不匹配)
return {} as UTSJSONObject; return {} as UTSJSONObject;
}); });
/** 仅 layout-portrait-768x1174 有值;其它分辨率为 null,主 Tab 保持模板 + scss 原样式 */
const receptionPortraitMainTabsOverride = computed((): null | ReceptionPortraitMainTabsConfig => {
return getReceptionPortraitMainTabsConfig(cssClassRef.value)
})
const receptionTabsContainerStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {} as UTSJSONObject
}
return {
padding: c.containerPadding
} as UTSJSONObject
})
const receptionMainTabsShellStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {} as UTSJSONObject
}
return {
padding: c.mainTabsPadding,
borderRadius: c.mainTabsBorderRadius,
boxShadow: c.mainTabsBoxShadow
} as UTSJSONObject
})
const mainTabBarHeight = computed((): number => {
const c = receptionPortraitMainTabsOverride.value
return c != null ? c.height : 52
})
const mainTabLineWidth = computed((): number => {
const c = receptionPortraitMainTabsOverride.value
return c != null ? c.lineWidth : 42
})
const mainTabLineHeight = computed((): number => {
const c = receptionPortraitMainTabsOverride.value
return c != null ? c.lineHeight : 4
})
const mainTabActiveStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {
color: '#1677ff',
fontWeight: 700,
fontSize: '17px'
} as UTSJSONObject
}
return {
color: '#1677ff',
fontWeight: 700,
fontSize: c.activeFontSize
} as UTSJSONObject
})
const mainTabInactiveStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {
color: '#94a3b8',
fontWeight: 500,
fontSize: '15px'
} as UTSJSONObject
}
return {
color: '#94a3b8',
fontWeight: 400,
fontSize: c.inactiveFontSize
} as UTSJSONObject
})
const mainTabItemStyle = computed((): UTSJSONObject => {
const c = receptionPortraitMainTabsOverride.value
if (c == null) {
return {
paddingLeft: '18px',
paddingRight: '18px'
} as UTSJSONObject
}
return {
paddingLeft: c.itemPaddingLeft,
paddingRight: c.itemPaddingRight
} as UTSJSONObject
})
/** 客户列表下的二级 Tab:0=客户录入,1=接待复盘(原 rightTabIndex) */ /** 客户列表下的二级 Tab:0=客户录入,1=接待复盘(原 rightTabIndex) */
const listSubTabIndex = ref(0) const listSubTabIndex = ref(0)
......
<template> <template>
<!-- 客户录入列表:与 customervisits.customerInfoPage 字段对齐(ownerPhone / brandModel / customerTagName / arrivalDate / ownerName) --> <!-- 客户录入列表:与 customervisits.customerInfoPage 字段对齐(ownerPhone / brandModel / customerTagName / arrivalDate / ownerName) -->
<view :class="['customer-entry-list', isLandscape ? 'customer-entry-list-landscape' : '']"> <view :class="['customer-entry-list', isListDualColumn ? 'customer-entry-list-landscape' : '']">
<!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 --> <!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 -->
<view <view
v-if="loading && (props.customerList == null || props.customerList.length == 0)" v-if="loading && (props.customerList == null || props.customerList.length == 0)"
v-for="i in skeletonCardCount" v-for="i in skeletonCardCount"
:key="'entry-skeleton-' + i" :key="'entry-skeleton-' + i"
:class="['list-card', 'list-card-entry', 'glass-card', isLandscape ? 'list-card-entry-landscape' : '']" :class="['list-card', 'list-card-entry', 'glass-card', isListDualColumn ? 'list-card-entry-landscape' : '']"
> >
<un-skeleton rows="3" title loading></un-skeleton> <un-skeleton rows="4" title loading></un-skeleton>
</view> </view>
<view <view
v-else v-else
v-for="item in props.customerList" v-for="item in props.customerList"
:key="getStr(item, 'id')" :key="getStr(item, 'id')"
:class="['list-card', 'list-card-entry', 'glass-card', isLandscape ? 'list-card-entry-landscape' : '']" :class="['list-card', 'list-card-entry', 'glass-card', isListDualColumn ? 'list-card-entry-landscape' : '']"
@click="onEntryCardClick(item)" @click="onEntryCardClick(item)"
@longpress="onEntryCardLongPress(item)" @longpress="onEntryCardLongPress(item)"
> >
<un-skeleton :rows="3" title :loading="loading"> <un-skeleton :rows="3" title :loading="loading">
<view class="card-header-row"> <view class="card-header-row">
<view class="card-title-box"> <view class="card-title-box">
<text class="card-name">{{ getStr(item, 'ownerName') }}</text> <text class="card-name" :style="listCardNameTextStyle">{{ getStr(item, 'ownerName') }}</text>
<text class="card-car">{{ getStr(item, 'brandModel') }}</text> <text class="card-car" :style="listCardCarTextStyle">{{ 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" :style="listInfoLabelTextStyle">车主电话</text><text class="info-value" :style="listInfoValueTextStyle">{{ 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" :style="listInfoLabelTextStyle">品牌车型</text><text class="info-value" :style="listInfoValueTextStyle">{{ 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" :style="listInfoLabelTextStyle">客户标签</text><text class="info-value" :style="listInfoValueTextStyle">{{ 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" :style="listInfoLabelTextStyle">到店日期</text><text class="info-value" :style="listInfoValueTextStyle">{{ formatArrivalDateOnly(getArrivalTsForEntry(item)) }}</text></view>
</view> </view>
</un-skeleton> </un-skeleton>
<view <view
...@@ -45,11 +45,11 @@ ...@@ -45,11 +45,11 @@
<view class="entry-mask-actions-row"> <view class="entry-mask-actions-row">
<view class="entry-mask-action" @click.stop="onEntryCardMaskEdit(item)"> <view class="entry-mask-action" @click.stop="onEntryCardMaskEdit(item)">
<un-icon name="edit-pen" color="#ffffff" size="28"></un-icon> <un-icon name="edit-pen" color="#ffffff" size="28"></un-icon>
<text class="entry-mask-action-text">编辑</text> <text class="entry-mask-action-text" :style="listEntryMaskActionTextStyle">编辑</text>
</view> </view>
<view class="entry-mask-action" @click.stop="onEntryCardMaskDelete(item)"> <view class="entry-mask-action" @click.stop="onEntryCardMaskDelete(item)">
<un-icon name="trash" color="#fecaca" size="28"></un-icon> <un-icon name="trash" color="#fecaca" size="28"></un-icon>
<text class="entry-mask-action-text entry-mask-action-text-delete">删除</text> <text class="entry-mask-action-text entry-mask-action-text-delete" :style="listEntryMaskActionTextStyle">删除</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -59,6 +59,12 @@ ...@@ -59,6 +59,12 @@
<script setup lang="uts"> <script setup lang="uts">
import { computed, onMounted, onUnmounted, ref, watch } from 'vue' import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import { cssClassRef } from '@/services/adapter'
import {
getReceptionPortraitListTextConfig,
isLayoutPortrait768x1174,
type ReceptionPortraitListTextConfig
} from '../styles/portrait.uts'
const props = defineProps<{ const props = defineProps<{
/** 客户档案列表(由父级拉取并传入) */ /** 客户档案列表(由父级拉取并传入) */
...@@ -97,6 +103,59 @@ function syncOrientation(): void { ...@@ -97,6 +103,59 @@ function syncOrientation(): void {
} }
} }
/** 横屏或 768×1174 竖屏:列表双列(与 scss 中 *-landscape / *-entry-landscape 一致) */
const isListDualColumn = computed((): boolean => {
if (isLandscape.value) {
return true
}
return isLayoutPortrait768x1174(cssClassRef.value)
})
const portraitListText = computed((): ReceptionPortraitListTextConfig | null => {
return getReceptionPortraitListTextConfig(cssClassRef.value)
})
function listTextPick(mapper: (c: ReceptionPortraitListTextConfig) => UTSJSONObject): UTSJSONObject {
const c = portraitListText.value
if (c == null) {
return {} as UTSJSONObject
}
return mapper(c)
}
const listCardNameTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return { fontSize: c.listCardNameFontSize } as UTSJSONObject
})
})
const listCardCarTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return {
fontSize: c.listCardCarFontSize,
marginTop: c.listCardCarMarginTop
} as UTSJSONObject
})
})
const listInfoLabelTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return { fontSize: c.listInfoLabelFontSize } as UTSJSONObject
})
})
const listInfoValueTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return { fontSize: c.listInfoValueFontSize } as UTSJSONObject
})
})
const listEntryMaskActionTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return { fontSize: c.listEntryMaskActionFontSize } as UTSJSONObject
})
})
const emit = defineEmits<{ const emit = defineEmits<{
/** 点击卡片:打开客户档案详情 */ /** 点击卡片:打开客户档案详情 */
'entry-click': [item: UTSJSONObject] 'entry-click': [item: UTSJSONObject]
......
<template> <template>
<!-- 接待复盘记录列表:与接待接口字段对齐,数据由父级拉取后传入 --> <!-- 接待复盘记录列表:与接待接口字段对齐,数据由父级拉取后传入 -->
<view :class="['reception-record-list', isLandscape ? 'reception-record-list-landscape' : '']"> <view :class="['reception-record-list', isListDualColumn ? 'reception-record-list-landscape' : '']">
<!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 --> <!-- 首次加载:列表为空时,用骨架卡片占位,避免空白 -->
<view <view
v-if="!loading && (props.receptionRecordList == null || props.receptionRecordList.length == 0)" v-if="!loading && (props.receptionRecordList == null || props.receptionRecordList.length == 0)"
v-for="i in skeletonCardCount" v-for="i in skeletonCardCount"
:key="'reception-skeleton-' + i" :key="'reception-skeleton-' + i"
:class="['list-card', 'glass-card', isLandscape ? 'list-card-landscape' : '']" :class="['list-card', 'glass-card', isListDualColumn ? 'list-card-landscape' : '']"
> >
<un-skeleton rows="3" title loading></un-skeleton> <un-skeleton rows="4" title loading></un-skeleton>
</view> </view>
<view <view
v-else v-else
v-for="(item, idx) in props.receptionRecordList" 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', isLandscape ? 'list-card-landscape' : '']" :class="['list-card', 'glass-card', isListDualColumn ? 'list-card-landscape' : '']"
@click="onCardClick(item)" @click="onCardClick(item)"
> >
<un-skeleton :rows="3" title :loading="loading"> <un-skeleton :rows="3" title :loading="loading">
<view class="card-header-row"> <view class="card-header-row">
<view class="card-title-box"> <view class="card-title-box">
<text class="card-name">{{ getStr(item, 'customerName') }}</text> <text class="card-name" :style="listCardNameTextStyle">{{ getStr(item, 'customerName') }}</text>
<text class="card-car">{{ getStr(item, 'carBrand') }}</text> <text class="card-car" :style="listCardCarTextStyle">{{ getStr(item, 'carBrand') }}</text>
</view> </view>
<view class="card-status-box"> <view class="card-status-box">
<view class="status-badge bg-slate-100"> <view class="status-badge bg-slate-100">
<text class="status-text text-slate-400">{{ getReviewFlagText(item) }}</text> <text class="status-text text-slate-400" :style="listStatusBadgeTextStyle">{{ getReviewFlagText(item) }}</text>
</view> </view>
<view <view
v-if="shouldShowOrderFinishBadge(item)" v-if="shouldShowOrderFinishBadge(item)"
:class="orderFinishFlagIsSuccess(item) ? 'status-badge bg-green-50' : 'status-badge bg-red-50'" :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> <text :class="orderFinishFlagIsSuccess(item) ? 'status-text text-green-400' : 'status-text text-red-400'" :style="listStatusBadgeTextStyle">{{ 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" :style="listInfoLabelTextStyle">客户电话</text><text class="info-value" :style="listInfoValueTextStyle">{{ 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" :style="listInfoLabelTextStyle">销售姓名</text><text class="info-value" :style="listInfoValueTextStyle">{{ 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" :style="listInfoLabelTextStyle">接待时长</text><text class="info-value" :style="listInfoValueTextStyle">{{ 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" :style="listInfoLabelTextStyle">开始接待</text><text class="info-value" :style="listInfoValueTextStyle">{{ 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" :style="listInfoLabelTextStyle">结束接待</text><text class="info-value" :style="listInfoValueTextStyle">{{ formatTimestamp(getTs(item, 'receptionEndTime')) }}</text></view>
</view> </view>
</un-skeleton> </un-skeleton>
</view> </view>
...@@ -49,6 +49,12 @@ ...@@ -49,6 +49,12 @@
<script setup lang="uts"> <script setup lang="uts">
import { computed, onMounted, onUnmounted, ref } from 'vue' import { computed, onMounted, onUnmounted, ref } from 'vue'
import { cssClassRef } from '@/services/adapter'
import {
getReceptionPortraitListTextConfig,
isLayoutPortrait768x1174,
type ReceptionPortraitListTextConfig
} from '../styles/portrait.uts'
const props = defineProps<{ const props = defineProps<{
/** 接待记录列表(由父级拉取并传入) */ /** 接待记录列表(由父级拉取并传入) */
...@@ -85,6 +91,59 @@ function syncOrientation(): void { ...@@ -85,6 +91,59 @@ function syncOrientation(): void {
} }
} }
/** 横屏或 768×1174 竖屏:列表双列 */
const isListDualColumn = computed((): boolean => {
if (isLandscape.value) {
return true
}
return isLayoutPortrait768x1174(cssClassRef.value)
})
const portraitListText = computed((): ReceptionPortraitListTextConfig | null => {
return getReceptionPortraitListTextConfig(cssClassRef.value)
})
function listTextPick(mapper: (c: ReceptionPortraitListTextConfig) => UTSJSONObject): UTSJSONObject {
const c = portraitListText.value
if (c == null) {
return {} as UTSJSONObject
}
return mapper(c)
}
const listCardNameTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return { fontSize: c.listCardNameFontSize } as UTSJSONObject
})
})
const listCardCarTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return {
fontSize: c.listCardCarFontSize,
marginTop: c.listCardCarMarginTop
} as UTSJSONObject
})
})
const listInfoLabelTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return { fontSize: c.listInfoLabelFontSize } as UTSJSONObject
})
})
const listInfoValueTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return { fontSize: c.listInfoValueFontSize } as UTSJSONObject
})
})
const listStatusBadgeTextStyle = computed((): UTSJSONObject => {
return listTextPick((c) => {
return { fontSize: c.listStatusBadgeFontSize } as UTSJSONObject
})
})
const emit = defineEmits<{ const emit = defineEmits<{
/** 点击卡片:父级根据 filterTabIndex 等处理详情或 toast */ /** 点击卡片:父级根据 filterTabIndex 等处理详情或 toast */
'reception-click': [item: UTSJSONObject] 'reception-click': [item: UTSJSONObject]
......
...@@ -23,8 +23,17 @@ ...@@ -23,8 +23,17 @@
/> />
</view> </view>
<!-- 列表区域 --> <!-- list-view:App 端隐藏滚动条比 scroll-view 更可靠(与 FormDetail 一致) -->
<scroll-view class="list-scroll" scroll-y @scrolltolower="onScrollToLower"> <list-view
class="list-scroll"
direction="vertical"
:bounces="true"
:show-scrollbar="false"
:lower-threshold="120"
@scrolltolower="onScrollToLower"
>
<list-item class="customer-panel-li" :type="0">
<view class="customer-panel-scroll-block">
<view v-if="showEmpty" class="empty-wrap"> <view v-if="showEmpty" class="empty-wrap">
<CustomEmpty type="base" title="暂无客户记录" /> <CustomEmpty type="base" title="暂无客户记录" />
</view> </view>
...@@ -39,17 +48,19 @@ ...@@ -39,17 +48,19 @@
/> />
</view> </view>
<!-- 加载更多 -->
<view class="list-footer"> <view class="list-footer">
<text v-if="loadingMore" class="footer-text">加载中...</text> <text v-if="loadingMore" class="footer-text">加载中...</text>
<text v-else-if="!hasMore && customerList.length > 0" class="footer-text">- 已经到底了 -</text> <text v-else-if="!hasMore && customerList.length > 0" class="footer-text">- 已经到底了 -</text>
</view> </view>
</scroll-view> </view>
</list-item>
</list-view>
</view> </view>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import CustomEmpty from '@/components/CustomEmpty/index.uvue' import CustomEmpty from '@/components/CustomEmpty/index.uvue'
import ListCustomer from '../lists/ListCustomer.uvue'
const props = defineProps<{ const props = defineProps<{
customerList: UTSJSONObject[] customerList: UTSJSONObject[]
...@@ -95,6 +106,23 @@ function onScrollToLower(): void { ...@@ -95,6 +106,23 @@ function onScrollToLower(): void {
.list-scroll { .list-scroll {
flex: 1; flex: 1;
min-height: 0;
width: 100%;
}
.customer-panel-li {
width: 100%;
margin: 0;
box-sizing: border-box;
height: auto;
min-height: 0;
align-self: flex-start;
flex-grow: 0;
flex-shrink: 0;
}
.customer-panel-scroll-block {
flex-direction: column;
width: 100%; width: 100%;
} }
......
...@@ -45,13 +45,21 @@ ...@@ -45,13 +45,21 @@
</view> </view>
</view> </view>
<scroll-view <!-- list-view + show-scrollbar=false:App 上比 scroll-view 更易彻底隐藏滚动条(与 FormDetail 一致) -->
<list-view
:class="['list-scroll-view', stickyHeader == true ? 'list-scroll-view--under-fixed-header' : 'list-scroll-view--full-height']" :class="['list-scroll-view', stickyHeader == true ? 'list-scroll-view--under-fixed-header' : 'list-scroll-view--full-height']"
:scroll-y="true" direction="vertical"
:bounces="true"
:show-scrollbar="false"
:lower-threshold="120" :lower-threshold="120"
@scrolltolower="emit('scrollLower')" @scrolltolower="emit('scrollLower')"
> >
<template v-if="stickyHeader != true"> <list-item
v-if="stickyHeader != true"
class="reception-list-li reception-list-li--header"
:type="0"
>
<view class="reception-list-header-block">
<view class="sub-tabs-row"> <view class="sub-tabs-row">
<view class="sub-tabs-shell"> <view class="sub-tabs-shell">
<view <view
...@@ -93,8 +101,10 @@ ...@@ -93,8 +101,10 @@
@switch-unsubmitted-pending-tab="emit('switchUnsubmittedPendingTab', $event)" @switch-unsubmitted-pending-tab="emit('switchUnsubmittedPendingTab', $event)"
/> />
</view> </view>
</template> </view>
</list-item>
<list-item class="reception-list-li reception-list-li--body" :type="1">
<view class="list-container"> <view class="list-container">
<view v-if="listSubTabIndex == 0" class="right-tab-list-panel"> <view v-if="listSubTabIndex == 0" class="right-tab-list-panel">
<CustomEmpty v-if="showCustomerEmpty" type="base" title="暂无客户记录" /> <CustomEmpty v-if="showCustomerEmpty" type="base" title="暂无客户记录" />
...@@ -126,7 +136,8 @@ ...@@ -126,7 +136,8 @@
<text v-else-if="receptionListHasMore != true && receptionRecordList.length > 0" class="list-footer-text">- 已经到底了 -</text> <text v-else-if="receptionListHasMore != true && receptionRecordList.length > 0" class="list-footer-text">- 已经到底了 -</text>
</view> </view>
</view> </view>
</scroll-view> </list-item>
</list-view>
</view> </view>
</template> </template>
...@@ -194,7 +205,7 @@ const showReceptionEmpty = computed((): boolean => { ...@@ -194,7 +205,7 @@ const showReceptionEmpty = computed((): boolean => {
width: 100%; width: 100%;
} }
/* 竖屏:单独占满父级,保证 scroll-view 有确定高度从而触发滚动与 scrolltolower */ /* 竖屏:单独占满父级,保证列表容器有确定高度从而触发滚动与 scrolltolower */
.list-scroll-view--full-height { .list-scroll-view--full-height {
height: 100%; height: 100%;
} }
...@@ -205,6 +216,34 @@ const showReceptionEmpty = computed((): boolean => { ...@@ -205,6 +216,34 @@ const showReceptionEmpty = computed((): boolean => {
min-height: 0; min-height: 0;
} }
/* list-item 在部分端默认不占满宽度,需与 FormDetail 同样拉满并由子内容撑开高度 */
.reception-list-li {
width: 100%;
margin: 0;
box-sizing: border-box;
height: auto;
min-height: 0;
}
.reception-list-li--header {
flex-grow: 0;
flex-shrink: 0;
align-self: flex-start;
}
.reception-list-li--body {
flex-grow: 0;
flex-shrink: 0;
align-self: flex-start;
height: auto;
min-height: 0;
}
.reception-list-header-block {
flex-direction: column;
width: 100%;
}
.list-header-fixed { .list-header-fixed {
flex-direction: column; flex-direction: column;
flex-shrink: 0; flex-shrink: 0;
......
<template> <template>
<scroll-view class="dashboard-scroll-view" :scroll-y="true"> <scroll-view class="dashboard-scroll-view" :scroll-y="true" :show-scrollbar="false">
<view class="dashboard-content"> <view class="dashboard-content" :style="dashboardContentStyle">
<view class="card-header"> <view class="card-header" :style="dashboardCardHeaderStyle">
<view class="header-surface"> <view class="header-surface" :style="dashboardHeaderSurfaceStyle">
<view class="header-top-row"> <view class="header-top-row" :style="dashboardHeaderTopRowStyle">
<view class="header-title-group" :style="dynamicModuleBoxStyle"> <view class="header-title-group">
<text class="header-eyebrow">数据概览</text> <text class="header-eyebrow" :style="dashboardEyebrowTextStyle">数据概览</text>
<text class="header-title">业绩看板</text> <text class="header-title" :style="dashboardTitleTextStyle">业绩看板</text>
</view> </view>
<view class="header-control-pack"> <view class="header-control-pack">
<view class="header-eye-btn" @click="emit('toggleMetrics')"> <view class="header-eye-btn" :style="dashboardEyeBtnStyle" @click="emit('toggleMetrics')">
<un-icon v-if="performanceMetricsVisible" name="eye" color="#334155" size="18"></un-icon> <un-icon v-if="performanceMetricsVisible" name="eye" color="#334155" :size="dashboardHeaderIconSize"></un-icon>
<un-icon v-if="performanceMetricsVisible == false" name="eye-off" color="#1677ff" size="18"></un-icon> <un-icon v-if="performanceMetricsVisible == false" name="eye-off" color="#1677ff" :size="dashboardHeaderIconSize"></un-icon>
</view> </view>
<view class="tag-box" @click="emit('openBrandPicker')"> <view class="tag-box" :style="dashboardTagBoxStyle" @click="emit('openBrandPicker')">
<view class="module-badge"> <view class="module-badge" :style="dashboardModuleBadgeStyle">
<text class="module-badge-text">模块</text> <text class="module-badge-text" :style="dashboardModuleBadgeTextStyle">模块</text>
</view> </view>
<text class="tag-text">{{ selectedBrand }}</text> <text class="tag-text" :style="dashboardTagTextStyle">{{ selectedBrand }}</text>
<image class="tag-arrow-icon" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" /> <image
class="tag-arrow-icon"
:style="dashboardTagArrowStyle"
src="/static/images/reception/icon-select-arrow.png"
mode="aspectFit"
/>
</view> </view>
</view> </view>
</view> </view>
<view class="progress-meta-row"> <view class="progress-meta-row" :style="dashboardProgressMetaRowStyle">
<text class="progress-label-text">时间进度</text> <text class="progress-label-text" :style="dashboardProgressLabelStyle">时间进度</text>
<text class="progress-value-text">{{ performanceMetricsVisible ? (timeProgressPercent + '%') : '**' }}</text> <text class="progress-value-text" :style="dashboardProgressValueStyle">{{ performanceMetricsVisible ? (timeProgressPercent + '%') : '**' }}</text>
</view> </view>
<view class="progress-bar-bg"> <view class="progress-bar-bg" :style="dashboardProgressBarBgStyle">
<view class="progress-bar-fill" :style="{ width: progressWidth }"></view> <view class="progress-bar-fill" :style="{ width: progressWidth }"></view>
</view> </view>
</view> </view>
...@@ -39,7 +44,7 @@ ...@@ -39,7 +44,7 @@
@update:tab-index="onUpdateOutputTabIndex" @update:tab-index="onUpdateOutputTabIndex"
/> />
<CardMonthValue <CardMonthValue
style="margin-top: 10px;" :style="dashboardCardMonthStyle"
:summary="summary" :summary="summary"
:target-value-text="targetValueText" :target-value-text="targetValueText"
:achievement-value-text="achievementValueText" :achievement-value-text="achievementValueText"
...@@ -57,8 +62,10 @@ import CardMonthValue from '../cards/CardMonthValue.uvue' ...@@ -57,8 +62,10 @@ import CardMonthValue from '../cards/CardMonthValue.uvue'
import type { CompareRow, OutputSummary } from '../types/reception-output-types.uts' import type { CompareRow, OutputSummary } from '../types/reception-output-types.uts'
import { cssClassRef } from "@/services/adapter"; import { cssClassRef } from "@/services/adapter";
// 导入样式变量 // 导入样式变量
import { getLandscapeConfig } from "../styles/landscape.uts"; import {
import { getPortraitConfig } from "../styles/portrait.uts"; getReceptionPortraitDashboardConfig,
type ReceptionPortraitDashboardConfig
} from "../styles/portrait.uts";
const props = defineProps<{ const props = defineProps<{
performanceData: UTSJSONObject performanceData: UTSJSONObject
...@@ -81,21 +88,152 @@ const emit = defineEmits<{ ...@@ -81,21 +88,152 @@ const emit = defineEmits<{
function onUpdateOutputTabIndex(index: number): void { function onUpdateOutputTabIndex(index: number): void {
emit('update:outputTabIndex', index) emit('update:outputTabIndex', index)
} }
const dynamicModuleBoxStyle = computed((): any => { /** 768x1174 竖屏看板专用配置;其它分辨率返回 null,保持 scss 默认 */
// 使用 cssClassRef.value 确保响应式 const portraitDashboardCfg = computed((): ReceptionPortraitDashboardConfig | null => {
const adapterCls = cssClassRef.value; return getReceptionPortraitDashboardConfig(cssClassRef.value)
// if (adapterCls.indexOf('layout-landscape-1174x768') >= 0) { })
// const cfg = getLandscapeConfig(adapterCls).headerTitleGroup
// // 注意:getLandscapeConfig 返回模块级常量对象(同引用),computed 可能判定“值未变”从而不触发视图更新 function dashStyle(mapper: (c: ReceptionPortraitDashboardConfig) => UTSJSONObject): UTSJSONObject {
// // 这里返回一个新对象引用,确保 :style 能更新 const c = portraitDashboardCfg.value
// return cfg != null ? ({ ...cfg } as UTSJSONObject) : ({} as UTSJSONObject); if (c == null) {
// } return {} as UTSJSONObject
if (adapterCls.indexOf('layout-portrait-768x1174') >= 0) {
const cfg = getPortraitConfig(adapterCls)?.headerTitleGroup
return cfg != null ? ({ ...cfg } as UTSJSONObject) : ({} as UTSJSONObject);
} }
return {} as UTSJSONObject; return mapper(c)
}); }
const dashboardContentStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { padding: c.contentPadding } as UTSJSONObject
})
})
const dashboardCardHeaderStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { marginBottom: c.cardHeaderMarginBottom } as UTSJSONObject
})
})
const dashboardHeaderSurfaceStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return {
padding: c.surfacePadding,
borderRadius: c.surfaceBorderRadius,
boxShadow: c.surfaceBoxShadow
} as UTSJSONObject
})
})
const dashboardHeaderTopRowStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { marginBottom: c.headerTopRowMarginBottom } as UTSJSONObject
})
})
const dashboardEyebrowTextStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { fontSize: c.eyebrowFontSize } as UTSJSONObject
})
})
const dashboardTitleTextStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { fontSize: c.titleFontSize } as UTSJSONObject
})
})
const dashboardHeaderIconSize = computed((): number => {
const c = portraitDashboardCfg.value
return c != null ? c.headerIconSize : 18
})
const dashboardEyeBtnStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return {
width: c.eyeBtnWidth,
height: c.eyeBtnHeight,
marginRight: c.eyeBtnMarginRight,
borderRadius: c.eyeBtnBorderRadius
} as UTSJSONObject
})
})
const dashboardTagBoxStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return {
height: c.tagBoxHeight,
minWidth: c.tagBoxMinWidth,
padding: c.tagBoxPadding,
borderRadius: c.tagBoxBorderRadius,
boxShadow: c.tagBoxBoxShadow
} as UTSJSONObject
})
})
const dashboardModuleBadgeStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return {
height: c.moduleBadgeHeight,
paddingLeft: c.moduleBadgePaddingLeft,
paddingRight: c.moduleBadgePaddingRight,
marginRight: c.moduleBadgeMarginRight,
borderRadius: c.moduleBadgeBorderRadius
} as UTSJSONObject
})
})
const dashboardModuleBadgeTextStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { fontSize: c.moduleBadgeTextFontSize } as UTSJSONObject
})
})
const dashboardTagTextStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { fontSize: c.tagTextFontSize } as UTSJSONObject
})
})
const dashboardTagArrowStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return {
width: c.tagArrowWidth,
height: c.tagArrowHeight,
marginLeft: c.tagArrowMarginLeft
} as UTSJSONObject
})
})
const dashboardProgressMetaRowStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { marginBottom: c.progressMetaMarginBottom } as UTSJSONObject
})
})
const dashboardProgressLabelStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { fontSize: c.progressLabelFontSize } as UTSJSONObject
})
})
const dashboardProgressValueStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { fontSize: c.progressValueFontSize } as UTSJSONObject
})
})
const dashboardProgressBarBgStyle = computed((): UTSJSONObject => {
return dashStyle((c) => {
return { height: c.progressBarHeight } as UTSJSONObject
})
})
const dashboardCardMonthStyle = computed((): UTSJSONObject => {
const c = portraitDashboardCfg.value
if (c == null) {
return { marginTop: '10px' } as UTSJSONObject
}
return { marginTop: c.cardMonthValueMarginTop } as UTSJSONObject
})
const progressWidth = computed((): string => { const progressWidth = computed((): string => {
const raw = props.timeProgressPercent const raw = props.timeProgressPercent
const pct = (typeof raw == 'number' && isNaN(raw) != true) ? raw : 0 const pct = (typeof raw == 'number' && isNaN(raw) != true) ? raw : 0
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!