Commit 08292f4c by liimin

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

2 parents 251d3f36 3176bc9a
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import ReceptionCenterMain from "@/pages/receptionCenter/ReceptionCenterMain.uvue"; import ReceptionCenterMain from "@/pages/receptionCenter/center.uvue";
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
<SceneShell ref="shellRef" <SceneShell ref="shellRef"
:active-tab-index="1"> :active-tab-index="1">
<template #default> <template #default>
<!-- <view class="test test-view">
<text class="test-orientation-text">hooks:{{ hookOrientation }} {{ hookOrientation=='landscape'?'横屏':'竖屏'}} {{ isLandscape }}</text>
</view> -->
<view class="reception-center-page"> <view class="reception-center-page">
<!-- Tab 切换 --> <!-- Tab 切换 -->
<view v-if="isLandscape != true" <view v-if="isLandscape != true"
...@@ -171,6 +168,7 @@ import { type UnPickerColumn, type UnPickerColumnItem, type UnPickerConfirmEvent ...@@ -171,6 +168,7 @@ import { type UnPickerColumn, type UnPickerColumnItem, type UnPickerConfirmEvent
import { getCustomerFileList, getMerchantPerformance, getReceptionList } from "@/api/receiption.uts"; import { getCustomerFileList, getMerchantPerformance, getReceptionList } from "@/api/receiption.uts";
import SceneShell from "@/components/HomeFrame/SceneShell.uvue"; import SceneShell from "@/components/HomeFrame/SceneShell.uvue";
import { updateOrientation, useOrientation } from "@/services/adapter/hooks/index.uts"; import { updateOrientation, useOrientation } from "@/services/adapter/hooks/index.uts";
import { DBRecord, recordService, type RecordData } from "@/services/recorder/index.uts";
import { storage } from "@/utils/storage.uts"; import { storage } from "@/utils/storage.uts";
import FormDetail from "./forms/FormDetail.uvue"; import FormDetail from "./forms/FormDetail.uvue";
import ReceptionDetail from "./receptionDetail.uvue"; import ReceptionDetail from "./receptionDetail.uvue";
...@@ -188,9 +186,6 @@ onShow(() => { ...@@ -188,9 +186,6 @@ onShow(() => {
} }
}); });
const receptionOrientationHook = useOrientation(); const receptionOrientationHook = useOrientation();
const hookOrientation = computed((): string => {
return (receptionOrientationHook.orientationKey as Ref<string>).value;
});
/** /**
* 固定页面可用高度,避免出现“整页上下滑 + 内部列表滚动”的双滚动/溢出问题。 * 固定页面可用高度,避免出现“整页上下滑 + 内部列表滚动”的双滚动/溢出问题。
* 说明: * 说明:
...@@ -224,8 +219,9 @@ const mainTabs: UnTabItem[] = [ ...@@ -224,8 +219,9 @@ const mainTabs: UnTabItem[] = [
const mainTabBarHeight = 52; const mainTabBarHeight = 52;
const mainTabLineWidth = 42; const mainTabLineWidth = 42;
const mainTabLineHeight = 4; const mainTabLineHeight = 4;
const mainTabActiveStyle = { color: "#1677ff", fontWeight: 700, fontSize: "17px" } as UTSJSONObject; const mainTabActiveStyle = { color: "#1677ff", fontWeight: 700, fontSize: "var(--reception-main-tabs-active-font-size, 17px)" } as UTSJSONObject;
const mainTabInactiveStyle = { color: "#94a3b8", fontWeight: 500, fontSize: "15px" } as UTSJSONObject; // uni-app x App 端 font-weight 建议仅用 400/700
const mainTabInactiveStyle = { color: "#94a3b8", fontWeight: 400, fontSize: "var(--reception-main-tabs-inactive-font-size, 15px)" } as UTSJSONObject;
const mainTabItemStyle = { paddingLeft: "18px", paddingRight: "18px" } as UTSJSONObject; const mainTabItemStyle = { paddingLeft: "18px", paddingRight: "18px" } as UTSJSONObject;
/** 客户列表下的二级 Tab:0=客户录入,1=接待复盘(原 rightTabIndex) */ /** 客户列表下的二级 Tab:0=客户录入,1=接待复盘(原 rightTabIndex) */
...@@ -381,7 +377,7 @@ const receptionFilterNarrowMode = ref(false); ...@@ -381,7 +377,7 @@ const receptionFilterNarrowMode = ref(false);
const receptionDashboardLayoutPollId: null | number = null; const receptionDashboardLayoutPollId: null | number = null;
const RECEPTION_LAYOUT_POLL_MS = 400; const RECEPTION_LAYOUT_POLL_MS = 400;
/** 是否横屏:与 orientationKey / hookOrientation 同源(useOrientation 的 isPortrait),保持 computed 随 updateOrientation 更新 */ /** 是否横屏:与 orientationKey 同源(useOrientation 的 isPortrait),保持 computed 随 updateOrientation 更新 */
const isLandscape = computed((): boolean => { const isLandscape = computed((): boolean => {
return (receptionOrientationHook.isPortrait as Ref<boolean>).value != true; return (receptionOrientationHook.isPortrait as Ref<boolean>).value != true;
}); });
...@@ -421,6 +417,42 @@ onResize((_res: any) => { ...@@ -421,6 +417,42 @@ onResize((_res: any) => {
syncReceptionDashboardLayout(); syncReceptionDashboardLayout();
}); });
function toReceptionListRowFromLocalRecord(rec: RecordData): UTSJSONObject {
// ListReception.uvue 使用 batchId 作为 key;本地记录只有 id,这里做一层兼容映射。
// 未提交列表不展示“战败/成交”,因此 orderFinishFlag 置空让角标隐藏。
return {
batchId: rec.id,
customerName: rec.customerName ?? "",
phoneNumber: rec.phoneNumber ?? "",
carBrand: rec.carBrand ?? "",
salesName: rec.salesName ?? "",
staffName: rec.staffName ?? "",
receptionStartTime: rec.receptionStartTime ?? "",
receptionEndTime: rec.receptionEndTime ?? "",
reviewFlag: 1,
orderFinishFlag: null,
submitted: 0,
} as UTSJSONObject;
}
async function getLocalUnsubmittedReceptionRecords(): Promise<UTSJSONObject[]> {
// 约定:
// - 未提交/待上传:已完成记录(recordStatus=1)
// - 未提交/待提交:临时记录(recordStatus=0)
const recorder = recordService.getRecorder();
const db = recorder != null ? recorder.db : DBRecord.getInstance();
const rows: RecordData[] = unsubmittedPendingTabIndex.value == 0
? (await db.getCompletedRecords())
: (await db.getTempRecords());
const list: UTSJSONObject[] = [];
let i = 0;
while (i < rows.length) {
list.push(toReceptionListRowFromLocalRecord(rows[i]));
i++;
}
return list;
}
function getPerformanceData(): Promise<void> { function getPerformanceData(): Promise<void> {
return getPerformanceDataImpl(); return getPerformanceDataImpl();
} }
...@@ -866,6 +898,28 @@ getCustomerListImpl = async (append: boolean): Promise<void> => { ...@@ -866,6 +898,28 @@ getCustomerListImpl = async (append: boolean): Promise<void> => {
/** append=false 重置页码后整表替换;append=true 触底下一页合并(与 getCustomerList 一致) */ /** append=false 重置页码后整表替换;append=true 触底下一页合并(与 getCustomerList 一致) */
getReceptionRecordListImpl = async (append: boolean): Promise<void> => { getReceptionRecordListImpl = async (append: boolean): Promise<void> => {
// 未提交:本地数据源,不支持分页追加
if (filterTabIndex.value == 1) {
if (append) {
receptionListHasMore.value = false;
return;
}
receptionListLoadingMore.value = true;
try {
const list = await getLocalUnsubmittedReceptionRecords();
receptionRecordList.value = list;
receptionListHasMore.value = false;
} catch (error) {
console.error("获取未提交本地接待列表失败:", error);
receptionRecordList.value = [];
receptionListHasMore.value = false;
uni.showToast({ title: "本地数据读取失败", icon: "none" });
} finally {
receptionListLoadingMore.value = false;
}
return;
}
if (append) { if (append) {
if (receptionListHasMore.value != true) { if (receptionListHasMore.value != true) {
return; return;
......
<template> <template>
<view <view
v-if="listSubTabIndex == 0" v-if="listSubTabIndex == 0"
class="filter-group filter-group-compact filter-group-entry-segmented filter-group-entry-segmented--half glass-card" class="rcf-half"
> >
<view class="filter-tabs-row entry-filter-segmented-wrap" :style="filterTabsRowStyle"> <view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented <un-segmented
type="card" type="card"
bg-color="rgba(241, 245, 249, 0.5)" bg-color="rgba(241, 245, 249, 0.5)"
:font-size="filterSegmentedFontSize" :font-size="'var(--reception-list-filters-segmented-font-size, 14px)'"
:height="filterSegmentedHeight" :custom-style="{ height: 'var(--reception-list-filters-segmented-height, 40px)' }"
active-color="#000000" active-color="#000000"
:model-value="entryFilterIndex" :model-value="entryFilterIndex"
@update:model-value="emit('switchEntryFilterTab', $event)" @update:model-value="emit('switchEntryFilterTab', $event)"
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
<view <view
v-if="listSubTabIndex == 1" v-if="listSubTabIndex == 1"
class="filter-group filter-group-compact filter-group-entry-segmented filter-group-entry-segmented--half glass-card" class="rcf-half"
> >
<view class="filter-tabs-row entry-filter-segmented-wrap" :style="filterTabsRowStyle"> <view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented <un-segmented
type="card" type="card"
:font-size="filterSegmentedFontSize" :font-size="'var(--reception-list-filters-segmented-font-size, 14px)'"
:height="filterSegmentedHeight" :custom-style="{ height: 'var(--reception-list-filters-segmented-height, 40px)' }"
bg-color="#f1f5f9" bg-color="#f1f5f9"
active-color="#000000" active-color="#000000"
:model-value="filterTabIndex" :model-value="filterTabIndex"
...@@ -39,22 +39,19 @@ ...@@ -39,22 +39,19 @@
</view> </view>
</view> </view>
<view v-if="listSubTabIndex == 0" class="filter-actions"> <view v-if="listSubTabIndex == 0" class="filter-actions">
<view class="pre-entry-btn" :style="preEntryBtnShellStyle" @click="emit('customerEntryClick')"> <view class="pre-entry-btn" @click="emit('customerEntryClick')">
<view class="pre-entry-btn-icon-wrap"> <view class="pre-entry-btn-icon-wrap">
<un-icon name="plus" color="#64748b" :size="preEntryIconSize"></un-icon> <un-icon name="plus" color="#64748b" :size="preEntryIconSize"></un-icon>
</view> </view>
<text class="pre-entry-btn-text" :style="preEntryBtnTextStyle">预录信息</text> <text class="pre-entry-btn-text">预录信息</text>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed } from 'vue' import { computed, type Ref } from 'vue'
import { cssClassRef } from '@/services/adapter' import { useScreenVars } from '@/services/adapter/hooks/index.uts'
import { import pageVars from '../styles/index.vars.uts'
getReceptionPortraitListFiltersConfig,
type ReceptionPortraitListFiltersConfig,
} from '../styles/portrait.uts'
const props = defineProps<{ const props = defineProps<{
listSubTabIndex: number listSubTabIndex: number
...@@ -68,84 +65,28 @@ const emit = defineEmits<{ ...@@ -68,84 +65,28 @@ const emit = defineEmits<{
customerEntryClick: [] customerEntryClick: []
}>() }>()
const portraitListFiltersCfg = computed((): ReceptionPortraitListFiltersConfig | null => { // 使用 index.vars.uts + common.scss 约定的 CSS 变量体系做自适应(方向/分辨率由 useScreenVars 内部决定)
return getReceptionPortraitListFiltersConfig(cssClassRef.value) const screenVarsHook = useScreenVars(pageVars as UTSJSONObject)
}) const pageStyleVars = computed((): Any => {
const sv = screenVarsHook.screenVars as Ref<UTSJSONObject>
const filterTabsRowStyle = computed((): UTSJSONObject => { return sv.value as Any
const c = portraitListFiltersCfg.value
if (c == null) {
return {} as UTSJSONObject
}
return {
height: c.filterTabsRowHeight,
minHeight: c.filterTabsRowHeight,
} as UTSJSONObject
})
const filterSegmentedFontSize = computed((): number => {
const c = portraitListFiltersCfg.value
if (c != null) {
return c.filterSegmentedFontSize
}
return 14
})
const filterSegmentedHeight = computed((): number => {
const c = portraitListFiltersCfg.value
if (c != null) {
return c.filterSegmentedHeight
}
return 40
})
const preEntryBtnShellStyle = computed((): UTSJSONObject => {
const c = portraitListFiltersCfg.value
if (c == null) {
return {} as UTSJSONObject
}
return { height: c.preEntryBtnHeight } as UTSJSONObject
})
const preEntryBtnTextStyle = computed((): UTSJSONObject => {
const c = portraitListFiltersCfg.value
if (c == null) {
return {} as UTSJSONObject
}
return {
fontSize: c.preEntryBtnTextFontSize,
lineHeight: c.preEntryBtnTextLineHeight,
} as UTSJSONObject
}) })
const preEntryIconSize = computed((): number => { const preEntryIconSize = computed((): number => {
const c = portraitListFiltersCfg.value const v = (pageStyleVars.value as UTSJSONObject)['--reception-list-filters-pre-entry-icon-size'] as string | null
if (c != null) { if (v == null || v == '') {
return c.preEntryIconSize
}
return 11 return 11
}
const n = parseInt(v.replace('px', ''), 10)
return isNaN(n) ? 11 : n
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "../styles/reception-filter-shared.scss"; @import "../styles/reception-filter-shared.scss";
.filter-group-compact.filter-group-entry-segmented {
flex: 1 1 0;
min-width: 120px;
}
.filter-group-compact.filter-group-entry-segmented.filter-group-entry-segmented--half {
flex-grow: 0;
flex-shrink: 0;
flex-basis: 50%;
width: 50%;
max-width: 50%;
min-width: 0;
}
.pre-entry-btn { .pre-entry-btn {
height: 40px; height: var(--reception-list-filters-pre-entry-btn-height, 40px);
padding-left: 14px; padding-left: 14px;
padding-right: 14px; padding-right: 14px;
border-radius: 8px; border-radius: 8px;
...@@ -189,9 +130,9 @@ const preEntryIconSize = computed((): number => { ...@@ -189,9 +130,9 @@ const preEntryIconSize = computed((): number => {
.pre-entry-btn-text { .pre-entry-btn-text {
margin-left: 6px; margin-left: 6px;
color: #475569; color: #475569;
font-size: 13px; font-size: var(--reception-list-filters-pre-entry-btn-text-font-size, 13px);
font-weight: 600; font-weight: 600;
line-height: 1.35; line-height: var(--reception-list-filters-pre-entry-btn-text-line-height, 1.35);
} }
.pre-entry-btn .pre-entry-btn-text { .pre-entry-btn .pre-entry-btn-text {
......
...@@ -2,36 +2,36 @@ ...@@ -2,36 +2,36 @@
<view class="filter-actions filter-actions--review" v-if="listSubTabIndex == 1"> <view class="filter-actions filter-actions--review" v-if="listSubTabIndex == 1">
<view <view
v-if="filterTabIndex == 0" v-if="filterTabIndex == 0"
class="filter-group filter-group-compact glass-card review-tabs-wrap review-tabs-wrap-wide" class="rcf-review-card review-tabs-wrap-wide"
> >
<view class="filter-tabs-row entry-filter-segmented-wrap filter-dropdown-row" :style="filterTabsRowStyle"> <view class="filter-tabs-row entry-filter-segmented-wrap filter-dropdown-row">
<view class="tag-box tag-box--filter" :style="reviewTagBoxShellStyle" @click="emit('openSubmittedResultPicker')"> <view class="tag-box tag-box--filter" @click="emit('openSubmittedResultPicker')">
<text class="tag-text" :style="reviewTagTextStyle">{{ submittedResultLabel }}</text> <text class="tag-text">{{ submittedResultLabel }}</text>
<image class="tag-arrow-icon" :style="reviewTagArrowStyle" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" /> <image class="tag-arrow-icon" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" />
</view> </view>
</view> </view>
</view> </view>
<view <view
v-if="filterTabIndex == 0" v-if="filterTabIndex == 0"
class="filter-group filter-group-compact glass-card review-tabs-wrap review-tabs-wrap-wide" class="rcf-review-card review-tabs-wrap-wide"
> >
<view class="filter-tabs-row entry-filter-segmented-wrap filter-dropdown-row" :style="filterTabsRowStyle"> <view class="filter-tabs-row entry-filter-segmented-wrap filter-dropdown-row">
<view class="tag-box tag-box--filter" :style="reviewTagBoxShellStyle" @click="emit('openReviewPicker')"> <view class="tag-box tag-box--filter" @click="emit('openReviewPicker')">
<text class="tag-text" :style="reviewTagTextStyle">{{ reviewTabLabel }}</text> <text class="tag-text">{{ reviewTabLabel }}</text>
<image class="tag-arrow-icon" :style="reviewTagArrowStyle" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" /> <image class="tag-arrow-icon" src="/static/images/reception/icon-select-arrow.png" mode="aspectFit" />
</view> </view>
</view> </view>
</view> </view>
<view <view
v-if="filterTabIndex == 1" v-if="filterTabIndex == 1"
class="filter-group filter-group-compact glass-card review-tabs-wrap review-tabs-wrap-wide" class="rcf-review-half review-tabs-wrap-wide"
> >
<view class="filter-tabs-row entry-filter-segmented-wrap" :style="filterTabsRowStyle"> <view class="filter-tabs-row entry-filter-segmented-wrap">
<un-segmented <un-segmented
type="card" type="card"
:font-size="filterSegmentedFontSize" :font-size="'var(--reception-list-filters-segmented-font-size, 14px)'"
:height="filterSegmentedHeight" :custom-style="{ height: 'var(--reception-list-filters-segmented-height, 40px)' }"
bg-color="rgba(241, 245, 249, 0.5)" bg-color="#f1f5f9"
active-color="#000000" active-color="#000000"
:model-value="unsubmittedPendingTabIndex" :model-value="unsubmittedPendingTabIndex"
@update:model-value="emit('switchUnsubmittedPendingTab', $event)" @update:model-value="emit('switchUnsubmittedPendingTab', $event)"
...@@ -46,11 +46,6 @@ ...@@ -46,11 +46,6 @@
<script setup lang="uts"> <script setup lang="uts">
import { computed } from 'vue' import { computed } from 'vue'
import { cssClassRef } from '@/services/adapter'
import {
getReceptionPortraitListFiltersConfig,
type ReceptionPortraitListFiltersConfig,
} from '../styles/portrait.uts'
const props = defineProps<{ const props = defineProps<{
listSubTabIndex: number listSubTabIndex: number
...@@ -73,64 +68,6 @@ const submittedResultLabel = computed((): string => { ...@@ -73,64 +68,6 @@ const submittedResultLabel = computed((): string => {
const reviewTabLabel = computed((): string => { const reviewTabLabel = computed((): string => {
return props.reviewTabIndex == 0 ? '未复盘' : '已复盘' return props.reviewTabIndex == 0 ? '未复盘' : '已复盘'
}) })
const portraitListFiltersCfg = computed((): ReceptionPortraitListFiltersConfig | null => {
return getReceptionPortraitListFiltersConfig(cssClassRef.value)
})
const filterTabsRowStyle = computed((): UTSJSONObject => {
const c = portraitListFiltersCfg.value
if (c == null) {
return {} as UTSJSONObject
}
return {
height: c.filterTabsRowHeight,
minHeight: c.filterTabsRowHeight,
} as UTSJSONObject
})
const filterSegmentedFontSize = computed((): number => {
const c = portraitListFiltersCfg.value
if (c != null) {
return c.filterSegmentedFontSize
}
return 14
})
const filterSegmentedHeight = computed((): number => {
const c = portraitListFiltersCfg.value
if (c != null) {
return c.filterSegmentedHeight
}
return 40
})
const reviewTagBoxShellStyle = computed((): UTSJSONObject => {
const c = portraitListFiltersCfg.value
if (c == null) {
return {} as UTSJSONObject
}
return { minHeight: c.reviewTagBoxMinHeight } as UTSJSONObject
})
const reviewTagTextStyle = computed((): UTSJSONObject => {
const c = portraitListFiltersCfg.value
if (c == null) {
return {} as UTSJSONObject
}
return { fontSize: c.reviewTagTextFontSize } as UTSJSONObject
})
const reviewTagArrowStyle = computed((): UTSJSONObject => {
const c = portraitListFiltersCfg.value
if (c == null) {
return {} as UTSJSONObject
}
return {
width: c.reviewTagArrowWidth,
height: c.reviewTagArrowHeight,
} as UTSJSONObject
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -162,6 +99,11 @@ const reviewTagArrowStyle = computed((): UTSJSONObject => { ...@@ -162,6 +99,11 @@ const reviewTagArrowStyle = computed((): UTSJSONObject => {
height: 100%; height: 100%;
} }
.filter-tabs-row.entry-filter-segmented-wrap {
height: var(--reception-list-filters-tabs-row-height, 40px);
min-height: var(--reception-list-filters-tabs-row-height, 40px);
}
.tag-box { .tag-box {
background-color: rgba(255, 255, 255, 0.5); background-color: rgba(255, 255, 255, 0.5);
padding: 4px 12px; padding: 4px 12px;
...@@ -174,7 +116,7 @@ const reviewTagArrowStyle = computed((): UTSJSONObject => { ...@@ -174,7 +116,7 @@ const reviewTagArrowStyle = computed((): UTSJSONObject => {
flex: 1; flex: 1;
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 42px; min-height: var(--reception-list-filters-review-tag-min-height, 42px);
padding: 0 14px; padding: 0 14px;
justify-content: space-between; justify-content: space-between;
border-radius: 10px; border-radius: 10px;
...@@ -189,8 +131,8 @@ const reviewTagArrowStyle = computed((): UTSJSONObject => { ...@@ -189,8 +131,8 @@ const reviewTagArrowStyle = computed((): UTSJSONObject => {
} }
.tag-box--filter .tag-text { .tag-box--filter .tag-text {
font-size: 13px; font-size: var(--reception-list-filters-review-tag-text-font-size, 13px);
font-weight: 600; font-weight: 700;
color: #334155; color: #334155;
} }
...@@ -201,8 +143,8 @@ const reviewTagArrowStyle = computed((): UTSJSONObject => { ...@@ -201,8 +143,8 @@ const reviewTagArrowStyle = computed((): UTSJSONObject => {
} }
.tag-box--filter .tag-arrow-icon { .tag-box--filter .tag-arrow-icon {
width: 14px; width: var(--reception-list-filters-review-tag-arrow-size, 14px);
height: 14px; height: var(--reception-list-filters-review-tag-arrow-size, 14px);
margin-left: 6px; margin-left: 6px;
opacity: 0.8; opacity: 0.8;
} }
......
<template> <template>
<view class="form-detail-root"> <view class="form-detail-root" :style="pageStyleVars">
<!-- 与 FormAdd 一致:安全区 + 固定导航占位,避免首屏内容被导航栏遮挡 --> <!-- 与 FormAdd 一致:安全区 + 固定导航占位,避免首屏内容被导航栏遮挡 -->
<view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view> <view class="reception-safe-top-spacer" :style="receptionSafeTopSpacerStyle"></view>
<un-navbar title="客户档案" @leftClick="handleClose" :titleStyle="formDetailNavbarTitleStyle" /> <un-navbar title="客户档案" @leftClick="handleClose" :titleStyle="formDetailNavbarTitleStyle" />
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
<view class="form-detail-body"> <view class="form-detail-body">
<view class="form-section"> <view class="form-section">
<view class="form-section-header"> <view class="form-section-header">
<text class="form-section-title" :style="formSectionTitleTextStyle">车主信息</text> <text class="form-section-title">车主信息</text>
</view> </view>
<view class="form-section-body"> <view class="form-section-body">
<view v-for="item in ownerInfoRows" :key="item.key" class="form-row"> <view v-for="item in ownerInfoRows" :key="item.key" class="form-row">
<text class="form-label" :style="formLabelTextStyle">{{ item.label }}</text> <text class="form-label">{{ item.label }}</text>
<text class="form-value" :style="formValueTextStyle">{{ item.value }}</text> <text class="form-value">{{ item.value }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<list-item class="form-detail-li form-detail-li-goods" :type="1"> <list-item class="form-detail-li form-detail-li-goods" :type="1">
<view class="goods-section-wrap"> <view class="goods-section-wrap">
<view class="form-detail-goods-head"> <view class="form-detail-goods-head">
<text class="form-detail-goods-title" :style="goodsTitleTextStyle">商品套餐</text> <text class="form-detail-goods-title">商品套餐</text>
</view> </view>
<CustomEmpty <CustomEmpty
v-if="goodsRowPairs.length == 0" v-if="goodsRowPairs.length == 0"
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
<image class="goods-image" :src="item.image" mode="aspectFill"></image> <image class="goods-image" :src="item.image" mode="aspectFill"></image>
</view> </view>
<view class="goods-info"> <view class="goods-info">
<text class="goods-name" :style="goodsNameTextStyle">{{ item.name }}</text> <text class="goods-name">{{ item.name }}</text>
<text class="goods-meta" :style="goodsMetaTextStyle">业务场景:{{ item.scene }}</text> <text class="goods-meta">业务场景:{{ item.scene }}</text>
<text class="goods-meta" :style="goodsMetaTextStyle">客户标签:{{ item.customerTag }}</text> <text class="goods-meta">客户标签:{{ item.customerTag }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -65,18 +65,20 @@ ...@@ -65,18 +65,20 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { ref, computed, onMounted, onUnmounted, nextTick, watch } from 'vue' import { ref, computed, onMounted, onUnmounted, nextTick, watch, type Ref } from 'vue'
import { findVisitsInfo } from '@/api/receiption.uts' import { findVisitsInfo } from '@/api/receiption.uts'
import { getMaterialResponsePage } from '@/api/customer-api.uts' import { getMaterialResponsePage } from '@/api/customer-api.uts'
import { storage } from '@/utils/storage.uts' import { storage } from '@/utils/storage.uts'
import CustomEmpty from '@/components/CustomEmpty/index.uvue' import CustomEmpty from '@/components/CustomEmpty/index.uvue'
import { cssClassRef } from '@/services/adapter' import { useScreenVars } from '@/services/adapter/hooks/index.uts'
import { import pageVars from '../styles/index.vars.uts'
getReceptionPortraitFormDetailTextConfig,
getReceptionPortraitFormDetailNavbarConfig, // 使用 index.vars.uts + common.scss 约定的 CSS 变量体系做自适应(方向/分辨率由 useScreenVars 内部决定)
type ReceptionPortraitFormDetailNavbarConfig, const screenVarsHook = useScreenVars(pageVars as UTSJSONObject)
type ReceptionPortraitFormDetailTextConfig, const pageStyleVars = computed((): Any => {
} from '../styles/portrait.uts' const sv = screenVarsHook.screenVars as Ref<UTSJSONObject>
return sv.value as Any
})
const GOODS_PLACEHOLDER_IMAGE = 'https://dummyimage.com/320x200/f3f6ff/94a3b8.png&text=%E6%9A%82%E6%97%A0%E5%9B%BE' const GOODS_PLACEHOLDER_IMAGE = 'https://dummyimage.com/320x200/f3f6ff/94a3b8.png&text=%E6%9A%82%E6%97%A0%E5%9B%BE'
...@@ -88,67 +90,10 @@ type GoodsCardItem = { ...@@ -88,67 +90,10 @@ type GoodsCardItem = {
customerTag: string customerTag: string
} }
const portraitFormDetailText = computed((): ReceptionPortraitFormDetailTextConfig | null => {
return getReceptionPortraitFormDetailTextConfig(cssClassRef.value)
})
const portraitFormDetailNavbar = computed((): ReceptionPortraitFormDetailNavbarConfig | null => {
return getReceptionPortraitFormDetailNavbarConfig(cssClassRef.value)
})
function formDetailTextPick(mapper: (c: ReceptionPortraitFormDetailTextConfig) => UTSJSONObject): UTSJSONObject {
const c = portraitFormDetailText.value
if (c == null) {
return {} as UTSJSONObject
}
return mapper(c)
}
const formDetailNavbarTitleStyle = computed((): UTSJSONObject => { const formDetailNavbarTitleStyle = computed((): UTSJSONObject => {
const c = portraitFormDetailNavbar.value
if (c == null) {
return {} as UTSJSONObject
}
return c.titleStyle
})
const formSectionTitleTextStyle = computed((): UTSJSONObject => {
return formDetailTextPick((c) => {
return { fontSize: c.sectionTitleFontSize } as UTSJSONObject
})
})
const formLabelTextStyle = computed((): UTSJSONObject => {
return formDetailTextPick((c) => {
return { fontSize: c.labelFontSize } as UTSJSONObject
})
})
const formValueTextStyle = computed((): UTSJSONObject => {
return formDetailTextPick((c) => {
return { fontSize: c.valueFontSize } as UTSJSONObject
})
})
const goodsTitleTextStyle = computed((): UTSJSONObject => {
return formDetailTextPick((c) => {
return { fontSize: c.goodsTitleFontSize } as UTSJSONObject
})
})
const goodsNameTextStyle = computed((): UTSJSONObject => {
return formDetailTextPick((c) => {
return { fontSize: c.goodsNameFontSize } as UTSJSONObject
})
})
const goodsMetaTextStyle = computed((): UTSJSONObject => {
return formDetailTextPick((c) => {
return { return {
fontSize: c.goodsMetaFontSize, fontSize: 'var(--reception-form-detail-navbar-title-font-size, 17px)',
lineHeight: c.goodsMetaLineHeight,
} as UTSJSONObject } as UTSJSONObject
})
}) })
/** 顶部安全区占位(px):与系统状态栏/刘海对齐,随窗口信息刷新 */ /** 顶部安全区占位(px):与系统状态栏/刘海对齐,随窗口信息刷新 */
...@@ -787,6 +732,8 @@ onLoad((options: UTSJSONObject | null) => { ...@@ -787,6 +732,8 @@ onLoad((options: UTSJSONObject | null) => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../styles/common.scss';
.form-detail-root { .form-detail-root {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -915,7 +862,7 @@ onLoad((options: UTSJSONObject | null) => { ...@@ -915,7 +862,7 @@ onLoad((options: UTSJSONObject | null) => {
} }
.form-section-title { .form-section-title {
font-size: 16px; font-size: var(--reception-form-detail-section-title-font-size, 16px);
font-weight: 700; font-weight: 700;
color: #1e293b; color: #1e293b;
} }
...@@ -939,14 +886,14 @@ onLoad((options: UTSJSONObject | null) => { ...@@ -939,14 +886,14 @@ onLoad((options: UTSJSONObject | null) => {
.form-label { .form-label {
width: 100px; width: 100px;
flex-shrink: 0; flex-shrink: 0;
font-size: 14px; font-size: var(--reception-form-detail-label-font-size, 14px);
color: #1e293b; color: #1e293b;
} }
.form-value { .form-value {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
font-size: 14px; font-size: var(--reception-form-detail-value-font-size, 14px);
color: #1e293b; color: #1e293b;
} }
...@@ -962,7 +909,7 @@ onLoad((options: UTSJSONObject | null) => { ...@@ -962,7 +909,7 @@ onLoad((options: UTSJSONObject | null) => {
} }
.form-detail-goods-title { .form-detail-goods-title {
font-size: 16px; font-size: var(--reception-form-detail-goods-title-font-size, 16px);
font-weight: 700; font-weight: 700;
color: #1e293b; color: #1e293b;
} }
...@@ -1023,7 +970,7 @@ onLoad((options: UTSJSONObject | null) => { ...@@ -1023,7 +970,7 @@ onLoad((options: UTSJSONObject | null) => {
.goods-name { .goods-name {
width: 100%; width: 100%;
font-size: 14px; font-size: var(--reception-form-detail-goods-name-font-size, 14px);
font-weight: 700; font-weight: 700;
color: #1e293b; color: #1e293b;
margin-bottom: 4px; margin-bottom: 4px;
...@@ -1031,9 +978,9 @@ onLoad((options: UTSJSONObject | null) => { ...@@ -1031,9 +978,9 @@ onLoad((options: UTSJSONObject | null) => {
.goods-meta { .goods-meta {
width: 100%; width: 100%;
font-size: 12px; font-size: var(--reception-form-detail-goods-meta-font-size, 12px);
color: #475569; color: #475569;
line-height: 16px; line-height: var(--reception-form-detail-goods-meta-line-height, 16px);
margin-bottom: 2px; margin-bottom: 2px;
} }
......
...@@ -25,15 +25,15 @@ ...@@ -25,15 +25,15 @@
<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" :style="listCardNameTextStyle">{{ getStr(item, 'ownerName') }}</text> <text class="card-name">{{ getStr(item, 'ownerName') }}</text>
<text class="card-car" :style="listCardCarTextStyle">{{ getStr(item, 'brandModel') }}</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" :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">{{ formatPhone(getStr(item, 'ownerPhone')) }}</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, 'brandModel') }}</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">{{ getStr(item, 'customerTagName') }}</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 class="info-row"><text class="info-label">到店日期</text><text class="info-value">{{ formatArrivalDateOnly(getArrivalTsForEntry(item)) }}</text></view>
</view> </view>
</un-skeleton> </un-skeleton>
<view <view
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,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" :style="listEntryMaskActionTextStyle">编辑</text> <text class="entry-mask-action-text">编辑</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" :style="listEntryMaskActionTextStyle">删除</text> <text class="entry-mask-action-text entry-mask-action-text-delete">删除</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -62,13 +62,8 @@ ...@@ -62,13 +62,8 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed, onMounted, onUnmounted, ref, watch } from 'vue' import { computed, ref, watch } from 'vue'
import { cssClassRef } from '@/services/adapter' import { cssClassRef } from '@/services/adapter'
import {
getReceptionPortraitListTextConfig,
isLayoutPortrait768x1174,
type ReceptionPortraitListTextConfig
} from '../styles/portrait.uts'
const props = defineProps<{ const props = defineProps<{
/** 客户档案列表(由父级拉取并传入) */ /** 客户档案列表(由父级拉取并传入) */
...@@ -82,82 +77,16 @@ const props = defineProps<{ ...@@ -82,82 +77,16 @@ const props = defineProps<{
const loading = computed<boolean>(() => props.loading === true) const loading = computed<boolean>(() => props.loading === true)
const skeletonCardCount = 6 const skeletonCardCount = 6
/** 是否横屏(w > h)。uni-app x UTS 当前编译目标不支持 onWindowResize,使用轮询响应旋转 */ /** 横屏或 768×1174 竖屏:列表双列(与 ListReception 一致;不再依赖 portrait.uts) */
const isLandscape = ref(false)
let orientationPollId = 0
const ORIENTATION_POLL_MS = 400
function syncOrientation(): void {
const info = uni.getWindowInfo()
// 宽高优先取 systemInfo(部分机型旋转后 getWindowInfo 可能刷新不及时)
const sys = uni.getSystemInfoSync()
const sysSw = sys.screenWidth
const sysSh = sys.screenHeight
const ww = info.windowWidth
const wh = info.windowHeight
const sw = info.screenWidth
const sh = info.screenHeight
const w = sysSw > 0 ? sysSw : (sw > 0 ? sw : ww)
const h = sysSh > 0 ? sysSh : (sh > 0 ? sh : wh)
const nextLandscape = w > h
if (isLandscape.value != nextLandscape) {
isLandscape.value = nextLandscape
}
}
/** 横屏或 768×1174 竖屏:列表双列(与 scss 中 *-landscape / *-entry-landscape 一致) */
const isListDualColumn = computed((): boolean => { const isListDualColumn = computed((): boolean => {
if (isLandscape.value) { const cls = cssClassRef.value
return true if (cls == null || cls == '') {
return false
} }
return isLayoutPortrait768x1174(cssClassRef.value) if (cls.indexOf('layout-landscape') >= 0) {
}) return true
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) return cls.indexOf('layout-portrait-768x1174') >= 0
}
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<{
...@@ -179,21 +108,6 @@ watch( ...@@ -179,21 +108,6 @@ watch(
} }
) )
onMounted((): void => {
syncOrientation()
orientationPollId = setInterval((): void => {
syncOrientation()
}, ORIENTATION_POLL_MS)
})
onUnmounted((): void => {
const id = orientationPollId
if (id > 0) {
clearInterval(id)
orientationPollId = 0
}
})
function getStr(data: UTSJSONObject, key: string): string { function getStr(data: UTSJSONObject, key: string): string {
const v = data[key] const v = data[key]
if (v == null) { if (v == null) {
...@@ -327,6 +241,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -327,6 +241,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "../styles/common.scss";
.customer-entry-list { .customer-entry-list {
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
...@@ -418,7 +333,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -418,7 +333,7 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
} }
.entry-mask-action-text { .entry-mask-action-text {
font-size: 26rpx; font-size: var(--reception-entry-mask-action-font-size, 13px);
color: #ffffff; color: #ffffff;
margin-top: 8px; margin-top: 8px;
text-align: center; text-align: center;
...@@ -440,16 +355,16 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -440,16 +355,16 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
} }
.card-name { .card-name {
font-size: 18px; font-size: var(--reception-customer-list-card-name-font-size, 18px);
font-weight: 600; font-weight: 600;
color: #1e293b; color: #1e293b;
} }
.card-car { .card-car {
font-size: 14px; font-size: var(--reception-customer-list-card-car-font-size, 14px);
font-weight: 600; font-weight: 600;
color: #1677ff; color: #1677ff;
margin-top: 6px; margin-top: var(--reception-customer-list-card-car-margin-top, 6px);
} }
.card-info-list { .card-info-list {
...@@ -472,13 +387,13 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void { ...@@ -472,13 +387,13 @@ function onEntryCardMaskDelete(item: UTSJSONObject): void {
} }
.info-label { .info-label {
font-size: 13px; font-size: var(--reception-customer-list-info-label-font-size, 13px);
color: #64748b; color: #64748b;
flex-shrink: 0; flex-shrink: 0;
} }
.info-value { .info-value {
font-size: 13px; font-size: var(--reception-customer-list-info-value-font-size, 13px);
color: #334155; color: #334155;
font-weight: 500; font-weight: 500;
text-align: right; text-align: right;
......
...@@ -24,27 +24,27 @@ ...@@ -24,27 +24,27 @@
<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" :style="listCardNameTextStyle">{{ getStr(item, 'customerName') }}</text> <text class="card-name">{{ getStr(item, 'customerName') }}</text>
<text class="card-car" :style="listCardCarTextStyle">{{ getStr(item, 'carBrand') }}</text> <text class="card-car">{{ 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" :style="listStatusBadgeTextStyle">{{ getReviewFlagText(item) }}</text> <text class="status-text text-slate-400">{{ 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'" :style="listStatusBadgeTextStyle">{{ getOrderFinishResultLabel(item) }}</text> <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" :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">{{ formatPhone(getStr(item, 'phoneNumber')) }}</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">{{ getReceptionSalesDisplay(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">{{ formatReceptionDuration(item) }}</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"><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" :style="listInfoLabelTextStyle">结束接待</text><text class="info-value" :style="listInfoValueTextStyle">{{ 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> </un-skeleton>
</view> </view>
...@@ -52,13 +52,8 @@ ...@@ -52,13 +52,8 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed, onMounted, onUnmounted, ref } from 'vue' import { computed } from 'vue'
import { cssClassRef } from '@/services/adapter' import { cssClassRef } from '@/services/adapter'
import {
getReceptionPortraitListTextConfig,
isLayoutPortrait768x1174,
type ReceptionPortraitListTextConfig
} from '../styles/portrait.uts'
const props = defineProps<{ const props = defineProps<{
/** 接待记录列表(由父级拉取并传入) */ /** 接待记录列表(由父级拉取并传入) */
...@@ -70,82 +65,16 @@ const props = defineProps<{ ...@@ -70,82 +65,16 @@ const props = defineProps<{
const loading = computed<boolean>(() => props.loading === true) const loading = computed<boolean>(() => props.loading === true)
const skeletonCardCount = 6 const skeletonCardCount = 6
/** 是否横屏(w > h)。uni-app x UTS 当前编译目标不支持 onWindowResize,使用轮询响应旋转 */ /** 横屏或 768×1174 竖屏:列表双列(与 adapter 注入的 cssClassRef 保持一致) */
const isLandscape = ref(false)
let orientationPollId = 0
const ORIENTATION_POLL_MS = 400
function syncOrientation(): void {
const info = uni.getWindowInfo()
// 宽高优先取 systemInfo(部分机型旋转后 getWindowInfo 可能刷新不及时)
const sys = uni.getSystemInfoSync()
const sysSw = sys.screenWidth
const sysSh = sys.screenHeight
const ww = info.windowWidth
const wh = info.windowHeight
const sw = info.screenWidth
const sh = info.screenHeight
const w = sysSw > 0 ? sysSw : (sw > 0 ? sw : ww)
const h = sysSh > 0 ? sysSh : (sh > 0 ? sh : wh)
const nextLandscape = w > h
if (isLandscape.value != nextLandscape) {
isLandscape.value = nextLandscape
}
}
/** 横屏或 768×1174 竖屏:列表双列 */
const isListDualColumn = computed((): boolean => { const isListDualColumn = computed((): boolean => {
if (isLandscape.value) { const cls = cssClassRef.value
return true if (cls == null || cls == '') {
return false
} }
return isLayoutPortrait768x1174(cssClassRef.value) if (cls.indexOf('layout-landscape') >= 0) {
}) return true
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) return cls.indexOf('layout-portrait-768x1174') >= 0
}
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<{
...@@ -153,21 +82,6 @@ const emit = defineEmits<{ ...@@ -153,21 +82,6 @@ const emit = defineEmits<{
'reception-click': [item: UTSJSONObject] 'reception-click': [item: UTSJSONObject]
}>() }>()
onMounted((): void => {
syncOrientation()
orientationPollId = setInterval((): void => {
syncOrientation()
}, ORIENTATION_POLL_MS)
})
onUnmounted((): void => {
const id = orientationPollId
if (id > 0) {
clearInterval(id)
orientationPollId = 0
}
})
function getStr(data: UTSJSONObject, key: string): string { function getStr(data: UTSJSONObject, key: string): string {
const v = data[key] const v = data[key]
if (v == null) { if (v == null) {
...@@ -300,6 +214,7 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -300,6 +214,7 @@ function onCardClick(item: UTSJSONObject): void {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "../styles/common.scss";
.reception-record-list { .reception-record-list {
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
...@@ -355,16 +270,16 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -355,16 +270,16 @@ function onCardClick(item: UTSJSONObject): void {
} }
.card-name { .card-name {
font-size: 18px; font-size: var(--reception-list-card-name-font-size, 18px);
font-weight: 600; font-weight: 600;
color: #1e293b; color: #1e293b;
} }
.card-car { .card-car {
font-size: 14px; font-size: var(--reception-list-card-car-font-size, 14px);
font-weight: 600; font-weight: 600;
color: #1677ff; color: #1677ff;
margin-top: 6px; margin-top: var(--reception-list-card-car-margin-top, 6px);
} }
.card-status-box { .card-status-box {
...@@ -394,7 +309,7 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -394,7 +309,7 @@ function onCardClick(item: UTSJSONObject): void {
background-color: #f0fdf4; background-color: #f0fdf4;
} }
.status-text { .status-text {
font-size: 11px; font-size: var(--reception-list-status-badge-font-size, 11px);
font-weight: 500; font-weight: 500;
} }
.text-slate-400 { .text-slate-400 {
...@@ -426,13 +341,13 @@ function onCardClick(item: UTSJSONObject): void { ...@@ -426,13 +341,13 @@ function onCardClick(item: UTSJSONObject): void {
} }
.info-label { .info-label {
font-size: 13px; font-size: var(--reception-list-info-label-font-size, 13px);
color: #64748b; color: #64748b;
flex-shrink: 0; flex-shrink: 0;
} }
.info-value { .info-value {
font-size: 13px; font-size: var(--reception-list-info-value-font-size, 13px);
color: #334155; color: #334155;
font-weight: 500; font-weight: 500;
text-align: right; text-align: right;
......
// ========================================================================
// HomeFrame 公共样式变量 - UTS 定义
// ========================================================================
/**
* 模块盒子高度(默认值)
*/
export const MODULE_BOX_HEIGHT = 'var(--l-module-box-height)';
/**
* ToolBox 最小高度(默认值)
*/
export const TOOL_BOX_MIN_HEIGHT = 'var(--l-tool-box-min-height)';
/**
* Common Title 高度(默认值)
*/
export const COMMON_TITLE_HEIGHT = 'var(--l-common-title-height)';
/**
* Left Tabs 高度(默认)
*/
export const LEFT_TABS_HEIGHT = '540px';
/**
* Icon Box 尺寸(默认)
*/
export const ICON_BOX_SIZE = '52px';
export const ICON_BOX_RADIUS = '26px';
/**
* Tab Label 字体大小(默认)
*/
export const TAB_LABEL_FONTSIZE = '13px';
/**
* TabBar 高度(默认竖屏)
*/
export const TABBAR_HEIGHT_DEFAULT = 56;
/**
* TabBar 图标尺寸(默认竖屏)
*/
export const TABBAR_ICON_SIZE_DEFAULT = 24;
...@@ -7,10 +7,42 @@ export default { ...@@ -7,10 +7,42 @@ export default {
'--reception-main-tabs-inactive-font-size': '15px', '--reception-main-tabs-inactive-font-size': '15px',
// 兼容旧变量(scss 里有引用) // 兼容旧变量(scss 里有引用)
'--reception-main-tabs-font-size': '17px', '--reception-main-tabs-font-size': '17px',
// receptionCenter: 客户列表子 Tab(ReceptionCustomerListTab)默认字号(可被 resolutions 覆盖)
'--reception-customer-list-sub-tab-title-font-size': '15px',
'--reception-customer-list-sub-tab-caption-font-size': '12px',
// receptionCenter: 列表底部提示文案(加载中/已到底)默认字号(可被 resolutions 覆盖) // receptionCenter: 列表底部提示文案(加载中/已到底)默认字号(可被 resolutions 覆盖)
'--reception-list-footer-font-size': '13px', '--reception-list-footer-font-size': '13px',
'--reception-list-footer-line-height': '18px', '--reception-list-footer-line-height': '18px',
// receptionCenter: 列表筛选区(分段器 + 预录按钮)默认尺寸(可被 resolutions 覆盖)
'--reception-list-filters-segmented-font-size': '14px',
'--reception-list-filters-segmented-height': '40px',
'--reception-list-filters-tabs-row-height': '40px',
'--reception-list-filters-pre-entry-btn-height': '40px',
'--reception-list-filters-pre-entry-btn-text-font-size': '13px',
'--reception-list-filters-pre-entry-btn-text-line-height': '1.35',
'--reception-list-filters-pre-entry-icon-size': '11px',
// receptionCenter: 复盘筛选下拉(secondary filter)默认尺寸(可被 resolutions 覆盖)
'--reception-list-filters-review-tag-text-font-size': '13px',
'--reception-list-filters-review-tag-min-height': '42px',
'--reception-list-filters-review-tag-arrow-size': '14px',
// receptionCenter: 接待复盘列表(ListReception) 默认字号(可被 resolutions 覆盖)
'--reception-list-card-name-font-size': '18px',
'--reception-list-card-car-font-size': '14px',
'--reception-list-card-car-margin-top': '6px',
'--reception-list-info-label-font-size': '13px',
'--reception-list-info-value-font-size': '13px',
'--reception-list-status-badge-font-size': '11px',
// receptionCenter: 客户录入列表(ListCustomer) 默认字号(可被 resolutions 覆盖)
'--reception-customer-list-card-name-font-size': '18px',
'--reception-customer-list-card-car-font-size': '14px',
'--reception-customer-list-card-car-margin-top': '6px',
'--reception-customer-list-info-label-font-size': '13px',
'--reception-customer-list-info-value-font-size': '13px',
'--reception-entry-mask-action-font-size': '13px',
// receptionCenter: dashboard header 默认样式变量(可被 resolutions 覆盖) // receptionCenter: dashboard header 默认样式变量(可被 resolutions 覆盖)
'--reception-dash-header-content-padding': '16px', '--reception-dash-header-content-padding': '16px',
'--reception-dash-header-margin-bottom': '16px', '--reception-dash-header-margin-bottom': '16px',
...@@ -125,6 +157,16 @@ export default { ...@@ -125,6 +157,16 @@ export default {
'--reception-form-add-item-padding-top': '0px', '--reception-form-add-item-padding-top': '0px',
'--reception-form-add-item-padding-bottom': '0px', '--reception-form-add-item-padding-bottom': '0px',
'--reception-form-add-navbar-title-font-size': '17px', '--reception-form-add-navbar-title-font-size': '17px',
// receptionCenter: FormDetail(客户档案详情)默认样式变量(可被 resolutions 覆盖)
'--reception-form-detail-navbar-title-font-size': '17px',
'--reception-form-detail-section-title-font-size': '16px',
'--reception-form-detail-label-font-size': '14px',
'--reception-form-detail-value-font-size': '14px',
'--reception-form-detail-goods-title-font-size': '16px',
'--reception-form-detail-goods-name-font-size': '14px',
'--reception-form-detail-goods-meta-font-size': '12px',
'--reception-form-detail-goods-meta-line-height': '16px',
}, },
portrait: { portrait: {
'--adapter-color': 'red', '--adapter-color': 'red',
...@@ -150,15 +192,48 @@ export default { ...@@ -150,15 +192,48 @@ export default {
'--reception-tabs-container-margin-top': '30px' '--reception-tabs-container-margin-top': '30px'
'--reception-tabs-container-bgc': '#ffffff', '--reception-tabs-container-bgc': '#ffffff',
// 针对 768x1174 竖屏:tabs 字体自适应增大 // 针对 768x1174 竖屏:tabs 字体自适应增大
'--reception-main-tabs-active-font-size': '24px', '--reception-main-tabs-active-font-size': '22px',
'--reception-main-tabs-inactive-font-size': '22px', '--reception-main-tabs-inactive-font-size': '20px',
// 兼容旧变量(scss 里有引用) // 兼容旧变量(scss 里有引用)
'--reception-main-tabs-font-size': '24px', '--reception-main-tabs-font-size': '24px',
// 针对 768x1174 竖屏:客户列表子 Tab 文本字号自适应增大
'--reception-customer-list-sub-tab-title-font-size': '17px',
'--reception-customer-list-sub-tab-caption-font-size': '13px',
// 针对 768x1174 竖屏:列表底部提示文案字号自适应增大 // 针对 768x1174 竖屏:列表底部提示文案字号自适应增大
'--reception-list-footer-font-size': '16px', '--reception-list-footer-font-size': '16px',
'--reception-list-footer-line-height': '22px', '--reception-list-footer-line-height': '22px',
// 针对 768x1174 竖屏:列表筛选区字号与高度自适应增大
'--reception-list-filters-segmented-font-size': '16px',
'--reception-list-filters-segmented-height': '44px',
'--reception-list-filters-tabs-row-height': '44px',
'--reception-list-filters-pre-entry-btn-height': '44px',
'--reception-list-filters-pre-entry-btn-text-font-size': '15px',
'--reception-list-filters-pre-entry-btn-text-line-height': '22px',
'--reception-list-filters-pre-entry-icon-size': '13px',
// 针对 768x1174 竖屏:复盘筛选下拉(secondary filter)尺寸同步放大
'--reception-list-filters-review-tag-text-font-size': '15px',
'--reception-list-filters-review-tag-min-height': '46px',
'--reception-list-filters-review-tag-arrow-size': '16px',
// 针对 768x1174 竖屏:接待复盘列表(ListReception) 字号自适应增大
'--reception-list-card-name-font-size': '21px',
'--reception-list-card-car-font-size': '16px',
'--reception-list-card-car-margin-top': '8px',
'--reception-list-info-label-font-size': '15px',
'--reception-list-info-value-font-size': '15px',
'--reception-list-status-badge-font-size': '13px',
// 针对 768x1174 竖屏:客户录入列表(ListCustomer) 字号自适应增大
'--reception-customer-list-card-name-font-size': '21px',
'--reception-customer-list-card-car-font-size': '16px',
'--reception-customer-list-card-car-margin-top': '8px',
'--reception-customer-list-info-label-font-size': '15px',
'--reception-customer-list-info-value-font-size': '15px',
'--reception-entry-mask-action-font-size': '16px',
// 针对 768x1174 竖屏:看板头部(header) 尺寸自适应增大 // 针对 768x1174 竖屏:看板头部(header) 尺寸自适应增大
'--reception-dash-header-content-padding': '22px', '--reception-dash-header-content-padding': '22px',
'--reception-dash-header-margin-bottom': '22px', '--reception-dash-header-margin-bottom': '22px',
...@@ -271,6 +346,16 @@ export default { ...@@ -271,6 +346,16 @@ export default {
'--reception-form-add-item-padding-top': '10px', '--reception-form-add-item-padding-top': '10px',
'--reception-form-add-item-padding-bottom': '10px', '--reception-form-add-item-padding-bottom': '10px',
'--reception-form-add-navbar-title-font-size': '22px', '--reception-form-add-navbar-title-font-size': '22px',
// 针对 768x1174 竖屏:FormDetail 字体自适应增大
'--reception-form-detail-navbar-title-font-size': '22px',
'--reception-form-detail-section-title-font-size': '20px',
'--reception-form-detail-label-font-size': '18px',
'--reception-form-detail-value-font-size': '19px',
'--reception-form-detail-goods-title-font-size': '20px',
'--reception-form-detail-goods-name-font-size': '18px',
'--reception-form-detail-goods-meta-font-size': '16px',
'--reception-form-detail-goods-meta-line-height': '22px',
}, },
'landscape-1174x768': { 'landscape-1174x768': {
'--adapter-color': '#FF4444', '--adapter-color': '#FF4444',
......
.layout-landscape-common {
.test {
font-size: 24px;
color: #166fff;
background-color: #050607;
}
}
.layout-landscape-1174x768 {
.test {
height: 300px;
font-size: 100px;
color: #166fff;
background-color: #134aff;
}
}
\ No newline at end of file \ No newline at end of file
// ========================================================================
// HomeFrame 横屏样式变量 - UTS 定义(按分辨率)
// ========================================================================
/**
* 横屏配置类型
*/
export type LandscapeConfig = {
// index.uvue 布局
backgroundColor?: string
height?: string
}
/**
* 1174x768 横屏配置
*/
export const LANDSCAPE_1174x768: LandscapeConfig = {
backgroundColor: '#134aff',
height: '300px'
};
/**
* 1920x1080 横屏配置
*/
export const LANDSCAPE_1920x1080: LandscapeConfig = {
backgroundColor: '#134aff',
height: '300px'
};
/**
* 根据分辨率获取横屏配置
*/
export function getLandscapeConfig(resolutionKey: string): null | LandscapeConfig {
// UTS 中字符串比较可能有问题,使用 indexOf 替代
if (resolutionKey.indexOf('layout-landscape-1174x768') >= 0) {
return LANDSCAPE_1174x768;
}
if (resolutionKey.indexOf('layout-landscape-1920x1080') >= 0) {
return LANDSCAPE_1920x1080;
}
return null;
}
.layout-portrait-common {
.test {
font-size: 24px;
color: #166fff;
background-color: #54ff7e;
}
}
.layout-portrait-640x979 {
.test {
font-size: 24px;
color: #166fff;
background-color: #886efc;
}
}
.layout-portrait-768x1174 {
.test {
height: 40px;
font-size: 20px;
color: #166fff;
background-color: #fc6e81;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
flex-direction: row; flex-direction: row;
flex: 1; flex: 1;
width: 100%; width: 100%;
height: 40px; height: var(--reception-list-filters-tabs-row-height, 40px);
min-height: 40px; min-height: var(--reception-list-filters-tabs-row-height, 40px);
} }
.entry-filter-segmented-wrap { .entry-filter-segmented-wrap {
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
.un-segmented__item__text { .un-segmented__item__text {
color: #64748b; color: #64748b;
font-size: 14px; font-size: var(--reception-list-filters-segmented-font-size, 14px);
} }
&--active { &--active {
...@@ -65,3 +65,123 @@ ...@@ -65,3 +65,123 @@
flex-shrink: 0; flex-shrink: 0;
margin-left: auto; margin-left: auto;
} }
// =========================
// 组合类(降低模板里的 class 噪音)
// - 保留现有的原子类供历史代码使用
// - 新代码优先使用下面这些更“语义化”的短类名
// =========================
// 基础卡片(等价于 glass-card)
.reception-filter-card {
background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(226, 232, 240, 1);
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
border-radius: 10px;
flex-direction: column;
}
// 筛选项外壳(等价于 filter-group + filter-group-compact)
.reception-filter-shell {
min-width: 0;
padding: 2px;
border-radius: 6px;
}
// “半宽 segmented”容器(从 Primary 本地样式提取,供 Primary/Secondary 复用)
.reception-filter-entry-segmented-half {
flex-grow: 0;
flex-shrink: 0;
flex-basis: 50%;
width: 50%;
max-width: 50%;
min-width: 0;
}
// =========================
// 更短的缩写类(进一步减少模板字符数)
// - rcf = reception center filters
// - 建议模板层优先使用这组短类
// =========================
// 基础卡片:卡片外观 + 壳(等价于 reception-filter-card + reception-filter-shell)
.rcf-card {
background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(226, 232, 240, 1);
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
border-radius: 10px;
flex-direction: column;
min-width: 0;
padding: 2px;
border-radius: 6px;
}
// 半宽 segmented:rcf-card + 50% 宽度
.rcf-half {
background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(226, 232, 240, 1);
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
border-radius: 10px;
flex-direction: column;
min-width: 0;
padding: 2px;
border-radius: 6px;
flex-grow: 0;
flex-shrink: 0;
flex-basis: 50%;
width: 50%;
max-width: 50%;
min-width: 0;
}
// review 区域卡片(用于 Secondary):rcf-card + review-tabs-wrap 的布局外观
.rcf-review-card {
background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(226, 232, 240, 1);
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
border-radius: 10px;
flex-direction: column;
min-width: 0;
padding: 2px;
border-radius: 6px;
flex: 1 1 0;
min-width: 0;
background: #f3f7fd;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 2px;
box-sizing: border-box;
}
// review 区域半宽 segmented:rcf-half + review-tabs-wrap 的布局外观
.rcf-review-half {
background-color: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(226, 232, 240, 1);
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
border-radius: 10px;
flex-direction: column;
min-width: 0;
padding: 2px;
border-radius: 6px;
flex-grow: 0;
flex-shrink: 0;
flex-basis: 50%;
width: 50%;
max-width: 50%;
min-width: 0;
flex: 1 1 0;
min-width: 0;
background: #f3f7fd;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 2px;
box-sizing: border-box;
}
...@@ -311,7 +311,7 @@ const bottomSafeSpacerStyle = computed((): UTSJSONObject => { ...@@ -311,7 +311,7 @@ const bottomSafeSpacerStyle = computed((): UTSJSONObject => {
} }
.sub-tab-title { .sub-tab-title {
font-size: 15px; font-size: var(--reception-customer-list-sub-tab-title-font-size, 15px);
font-weight: 600; font-weight: 600;
color: #64748b; color: #64748b;
} }
...@@ -322,7 +322,7 @@ const bottomSafeSpacerStyle = computed((): UTSJSONObject => { ...@@ -322,7 +322,7 @@ const bottomSafeSpacerStyle = computed((): UTSJSONObject => {
.sub-tab-caption { .sub-tab-caption {
margin-top: 2px; margin-top: 2px;
font-size: 12px; font-size: var(--reception-customer-list-sub-tab-caption-font-size, 12px);
font-weight: 500; font-weight: 500;
color: #94a3b8; color: #94a3b8;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!