refactor(i18n): 全工程面向国际用户与全球现代商务重构,彻底清理出海跨境等单向视角表达并对齐自动化测试

这个提交包含在:
wikiboss
2026-09-21 15:24:36 +08:00
父节点 ad9df7a7a4
当前提交 17882ca1cb
共有 135 个文件被更改,包括 12928 次插入 和 1653 次删除

查看文件

@@ -98,7 +98,7 @@
class="form-input"
type="text"
v-model="editForm.title"
placeholder="例如:全球智能硬件出海交付方案"
placeholder="例如:全球智能硬件数字化交付方案"
/>
</view>

文件差异内容过多而无法显示 加载差异

查看文件

@@ -15,7 +15,7 @@ import { getCurrentLocale, getOmniText } from '../../../common/locale.uts';
export const PRESET_CASE_METRICS: string[] = [
'+320% ROI',
'+150% 留资率',
'45k+ 海外线索',
'45k+ 国际线索',
'2M+ 全球曝光',
'Top 1 细分类目',
];

查看文件

@@ -1,8 +1,20 @@
<template>
<view class="hall-page" :style="pageTheme">
<view class="hall-page" :class="pageRtlClass" :style="pageTheme">
<!-- Header: Bento Hero & Action Control Pod -->
<view class="hall-header">
<text class="hall-title">{{ pageTitle }}</text>
<text class="hall-subtitle">{{ pageSubtitle }}</text>
<view class="hall-header-top">
<view class="hall-title-group">
<text class="hall-title">{{ pageTitle }}</text>
<text class="hall-subtitle">{{ pageSubtitle }}</text>
</view>
<view class="hall-counter-badge">
<view class="hall-counter-dot"></view>
<text class="hall-counter-num">{{ state.total }}</text>
<text class="hall-counter-unit">{{ countUnitText }}</text>
</view>
</view>
<!-- Bento Capsule Tabs (Contacts / Team / Event) -->
<view class="hall-tabs">
<view
class="hall-tab"
@@ -26,66 +38,138 @@
<text class="hall-tab-text">{{ t('tabEvent') }}</text>
</view>
</view>
<input
class="hall-search"
type="text"
v-model="state.keyWord"
:placeholder="searchPlaceholder"
:disabled="state.loading"
/>
<input
v-if="state.tab === 'contacts'"
class="hall-search"
type="number"
maxlength="6"
v-model="state.exchangeCode"
:placeholder="exchangePlaceholder"
:disabled="state.loading"
/>
<input
v-if="state.tab === 'event'"
class="hall-search"
type="text"
maxlength="6"
v-model="state.eventCode"
:placeholder="eventPlaceholder"
:disabled="state.loading"
/>
<!-- Global Filter Search Input -->
<view class="hall-search-box">
<view class="search-icon-mark"></view>
<input
class="hall-search-input field-input"
type="text"
v-model="state.keyWord"
:placeholder="searchPlaceholder"
:disabled="state.loading"
@confirm="handleSearchConfirm"
/>
</view>
<!-- Contextual Quick Action Pod: 6-Digit Exchange Code (Contacts Tab) -->
<view v-if="state.tab === 'contacts'" class="hall-context-pod">
<view class="pod-label-row">
<text class="pod-title">{{ exchangePodTitle }}</text>
<text class="pod-hint">{{ exchangePodHint }}</text>
</view>
<view class="pod-input-row">
<input
class="pod-input field-input pod-code-input"
type="number"
maxlength="6"
v-model="state.exchangeCode"
:placeholder="exchangePlaceholder"
:disabled="state.loading"
@confirm="handlePrimary"
/>
</view>
</view>
<!-- Contextual Quick Action Pod: 6-Char Event Floor Pass (Event Tab) -->
<view v-if="state.tab === 'event'" class="hall-context-pod pod-event">
<view class="pod-label-row">
<text class="pod-title">{{ eventPodTitle }}</text>
<text class="pod-hint">{{ eventPodHint }}</text>
</view>
<view class="pod-input-row">
<input
class="pod-input field-input pod-code-input"
type="text"
maxlength="6"
v-model="state.eventCode"
:placeholder="eventPlaceholder"
:disabled="state.loading"
@confirm="handlePrimary"
/>
</view>
</view>
</view>
<!-- Loading Skeleton Cards -->
<view v-if="state.loading" class="hall-skeleton">
<view class="skeleton-line"></view>
<view class="skeleton-card"></view>
<view class="skeleton-card"></view>
<view class="skeleton-card">
<view class="skeleton-avatar"></view>
<view class="skeleton-meta">
<view class="skeleton-line"></view>
<view class="skeleton-line skeleton-line-sub"></view>
</view>
</view>
<view class="skeleton-card">
<view class="skeleton-avatar"></view>
<view class="skeleton-meta">
<view class="skeleton-line"></view>
<view class="skeleton-line skeleton-line-sub"></view>
</view>
</view>
<view class="skeleton-card">
<view class="skeleton-avatar"></view>
<view class="skeleton-meta">
<view class="skeleton-line"></view>
<view class="skeleton-line skeleton-line-sub"></view>
</view>
</view>
</view>
<!-- Error State Feedback Card -->
<view v-else-if="state.errorMessage !== ''" class="hall-feedback">
<view class="feedback-halo error-halo">
<view class="feedback-halo-inner error-halo-inner"></view>
</view>
<text class="feedback-title">{{ t('error') }}</text>
<text class="feedback-desc">{{ state.errorMessage }}</text>
</view>
<!-- Empty State Feedback Card -->
<view v-else-if="state.empty" class="hall-feedback">
<view class="feedback-halo empty-halo">
<view class="feedback-halo-inner empty-halo-inner"></view>
</view>
<text class="feedback-title">{{ t('empty') }}</text>
<text class="feedback-desc">{{ emptyDesc }}</text>
</view>
<!-- Virtualized High-Performance Bento Contact List -->
<list-view v-else class="hall-list" :scroll-y="true">
<list-item v-for="item in state.list" :key="item.peerCardId">
<view class="hall-row" @click="handleOpenPortal(item)">
<view class="hall-main">
<text class="hall-name">{{ item.peerName }}</text>
<text class="hall-meta-text">{{ formatField(item.peerTitle) }}</text>
<text class="hall-meta-text">{{ formatField(item.peerCompany) }}</text>
<!-- Squircle Initials Avatar -->
<view class="hall-avatar">
<text class="hall-avatar-text">{{ getInitial(item.peerName) }}</text>
</view>
<!-- Contact Details -->
<view class="hall-main">
<view class="hall-name-row">
<text class="hall-name">{{ item.peerName }}</text>
<text v-if="formatSourceTag(item.source) !== ''" class="hall-source-tag">
{{ formatSourceTag(item.source) }}
</text>
</view>
<text v-if="formatField(item.peerTitle) !== ''" class="hall-meta-text">
{{ formatField(item.peerTitle) }}
</text>
<text v-if="formatField(item.peerCompany) !== ''" class="hall-meta-text hall-meta-company">
{{ formatField(item.peerCompany) }}
</text>
</view>
<!-- Forward Chevron Arrow -->
<view class="hall-arrow"></view>
</view>
</list-item>
</list-view>
<!-- Fixed Floating Main CTA Bar -->
<view class="hall-cta-bar">
<button
class="primary-cta-btn"
:class="{ 'primary-cta-btn-disabled': state.loading }"
:disabled="state.loading"
:aria-label="ctaLabel"
@click="handlePrimary"
>
<text class="primary-cta-btn-text">{{ ctaLabel }}</text>
@@ -95,7 +179,8 @@
</template>
<script setup lang="uts">
import { utsLightColors, utsRadius, utsSpacing } from '../../../common/tokens.uts';
import { getCurrentLocale, isRtl } from '../../../common/locale.uts';
import { utsLightColors, utsRadius, utsSpacing, utsTypography } from '../../../common/tokens.uts';
import {
applyHallTab,
createHallState,
@@ -117,8 +202,16 @@ const pageTheme: Record<string, string> = {
'--oc-border': utsLightColors.border,
'--oc-text': utsLightColors.text,
'--oc-text-2': utsLightColors.text2,
'--oc-success': utsLightColors.success,
'--oc-warning': utsLightColors.warning,
'--oc-error': utsLightColors.error,
'--oc-radius-btn': utsRadius.button,
'--oc-radius-card': utsRadius.card,
'--oc-radius-modal': utsRadius.modal,
'--oc-radius-pill': utsRadius.pill,
'--oc-shadow': utsTypography.shadow,
'--oc-shadow-card': utsTypography.shadowCard,
'--oc-shadow-cta': utsTypography.shadowCta,
'--oc-space-8': utsSpacing.space8,
'--oc-space-12': utsSpacing.space12,
'--oc-space-16': utsSpacing.space16,
@@ -126,11 +219,39 @@ const pageTheme: Record<string, string> = {
};
const state = reactive(createHallState());
const pageTitle = ref(resolveHallText('title'));
const pageSubtitle = ref(resolveHallText('subtitle'));
const searchPlaceholder = ref(resolveHallText('searchPlaceholder'));
const exchangePlaceholder = ref(resolveHallText('exchangePlaceholder'));
const eventPlaceholder = ref(resolveHallText('eventPlaceholder'));
const pageTitle = computed((): string => resolveHallText('title'));
const pageSubtitle = computed((): string => resolveHallText('subtitle'));
const searchPlaceholder = computed((): string => resolveHallText('searchPlaceholder'));
const exchangePlaceholder = computed((): string => resolveHallText('exchangePlaceholder'));
const eventPlaceholder = computed((): string => resolveHallText('eventPlaceholder'));
const isZh = computed((): boolean => {
return getCurrentLocale() === 'zh-CN';
});
const countUnitText = computed((): string => {
return isZh.value ? '人' : 'cards';
});
const exchangePodTitle = computed((): string => {
return isZh.value ? '面对面极速互换' : 'Quick Exchange';
});
const exchangePodHint = computed((): string => {
return isZh.value ? '输入 6 位数字码' : '6-digit offline code';
});
const eventPodTitle = computed((): string => {
return isZh.value ? '展会同场' : 'Floor Pass';
});
const eventPodHint = computed((): string => {
return isZh.value ? '输入 6 位活动码' : '6-char event code';
});
const pageRtlClass = computed((): string => {
return isRtl(getCurrentLocale()) ? 'hall-rtl' : '';
});
const emptyDesc = computed((): string => {
if (state.tab === 'team') {
@@ -166,6 +287,34 @@ function formatField(value: string | null | undefined): string {
return value;
}
function getInitial(name: string): string {
const trimmed = name.trim();
if (trimmed.length === 0) {
return 'O';
}
return trimmed.substring(0, 1).toUpperCase();
}
function formatSourceTag(source: string | null | undefined): string {
if (source == null || source === '') {
return '';
}
const zh = isZh.value;
if (source === 'exchange') {
return zh ? '互换' : 'Exchange';
}
if (source === 'event') {
return zh ? '现场' : 'Floor';
}
if (source === 'team') {
return zh ? '团队' : 'Team';
}
if (source === 'collect') {
return zh ? '收藏' : 'Saved';
}
return source;
}
async function handleTab(tab: HallTab): Promise<void> {
applyHallTab(state, tab);
await refreshHall(state);
@@ -175,6 +324,10 @@ function handleOpenPortal(item: HallContactItem): void {
openHallPortal(item);
}
async function handleSearchConfirm(): Promise<void> {
await refreshHall(state);
}
async function handlePrimary(): Promise<void> {
if (state.tab === 'event' && state.eventCode.trim() !== '') {
await submitHallEventJoin(state);
@@ -197,7 +350,11 @@ onShow(() => {
display: flex;
flex-direction: column;
height: 100%;
background-color: var(--oc-surface, #F7F8FA);
background-color: var(--oc-bg, #F5F8FC);
}
.hall-rtl {
direction: rtl;
}
.hall-header {
@@ -206,8 +363,24 @@ onShow(() => {
padding-inline: var(--oc-space-16, 16px);
padding-block-start: var(--oc-space-16, 16px);
padding-block-end: var(--oc-space-12, 12px);
background-color: var(--oc-bg, #FFFFFF);
border-bottom: 1px solid var(--oc-border, #E3E7ED);
background-color: var(--oc-surface, #FFFFFF);
border-bottom: 1px solid var(--oc-border, #EBF1F7);
box-shadow: 0 2px 8px rgba(11, 99, 229, 0.02);
}
.hall-header-top {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
margin-block-end: var(--oc-space-12, 12px);
}
.hall-title-group {
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
}
.hall-title {
@@ -215,106 +388,303 @@ onShow(() => {
font-weight: 700;
color: var(--oc-text, #101828);
line-height: 1.25;
margin-bottom: var(--oc-space-8, 8px);
margin-block-end: 4px;
}
.hall-subtitle {
font-size: 14px;
color: var(--oc-text-2, #667085);
line-height: 1.6;
margin-bottom: var(--oc-space-12, 12px);
font-size: 13px;
color: var(--oc-text-2, #64748B);
line-height: 1.5;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
lines: 1;
}
.hall-counter-badge {
display: flex;
flex-direction: row;
align-items: center;
background-color: var(--oc-primary-soft, #EBF5FF);
padding-inline: 10px;
padding-block: 5px;
border-radius: 9999px;
margin-inline-start: 12px;
flex-shrink: 0;
}
.hall-counter-dot {
width: 6px;
height: 6px;
border-radius: 3px;
background-color: var(--oc-primary, #0B5CFF);
margin-inline-end: 6px;
}
.hall-counter-num {
font-size: 13px;
font-weight: 700;
color: var(--oc-primary, #0B5CFF);
margin-inline-end: 2px;
}
.hall-counter-unit {
font-size: 11px;
color: var(--oc-text-2, #64748B);
}
.hall-tabs {
display: flex;
flex-direction: row;
margin-bottom: var(--oc-space-12, 12px);
flex-wrap: nowrap;
margin-block-end: var(--oc-space-8, 8px);
gap: 8px;
}
.hall-tab {
height: 44px;
min-height: 44px;
min-width: 44px;
padding-inline: 16px;
margin-inline-end: 8px;
border: 1px solid var(--oc-border, #E3E7ED);
border-radius: 12px;
background-color: var(--oc-bg, #FFFFFF);
border: 1px solid var(--oc-border, #EBF1F7);
border-radius: var(--oc-radius-btn, 14px);
background-color: var(--oc-bg, #F5F8FC);
display: flex;
align-items: center;
justify-content: center;
flex: 1;
transition: opacity 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hall-tab:active {
opacity: 0.85;
}
.hall-tab-active {
background-color: var(--oc-primary-soft, #EAF1FF);
background-color: var(--oc-primary-soft, #EBF5FF);
border-color: var(--oc-primary, #0B5CFF);
}
.hall-tab-text {
font-size: 13px;
font-size: 14px;
font-weight: 600;
color: var(--oc-text-2, #667085);
color: var(--oc-text-2, #64748B);
}
.hall-tab-active .hall-tab-text {
color: var(--oc-primary, #0B5CFF);
}
.hall-search {
.hall-search-box {
height: 44px;
padding-inline: 12px;
margin-bottom: var(--oc-space-12, 12px);
background-color: var(--oc-surface, #F7F8FA);
border: 1px solid var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-btn, 12px);
min-height: 44px;
padding-inline: 14px;
background-color: var(--oc-bg, #F5F8FC);
border: 1px solid var(--oc-border, #EBF1F7);
border-radius: var(--oc-radius-btn, 14px);
display: flex;
flex-direction: row;
align-items: center;
box-sizing: border-box;
}
.search-icon-mark {
width: 14px;
height: 14px;
border: 2px solid var(--oc-text-2, #64748B);
border-radius: 7px;
margin-inline-end: 8px;
flex-shrink: 0;
opacity: 0.65;
}
.hall-search-input {
flex: 1;
height: 100%;
font-size: 16px;
color: var(--oc-text, #101828);
background-color: transparent;
border: none;
}
.hall-context-pod {
margin-block-start: 10px;
padding: 12px 14px;
border-radius: 16px;
background: linear-gradient(135deg, #F0F7FF 0%, #F8FAFD 100%);
border: 1px solid rgba(0, 136, 255, 0.16);
display: flex;
flex-direction: column;
}
.pod-event {
background: linear-gradient(135deg, #F5F3FF 0%, #FAF8FD 100%);
border-color: rgba(99, 102, 241, 0.2);
}
.pod-label-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-block-end: 8px;
}
.pod-title {
font-size: 12px;
font-weight: 700;
color: var(--oc-primary, #0B5CFF);
letter-spacing: 0.2px;
}
.pod-event .pod-title {
color: #6366F1;
}
.pod-hint {
font-size: 11px;
color: var(--oc-text-2, #64748B);
}
.pod-input-row {
display: flex;
flex-direction: row;
align-items: center;
}
.pod-input {
height: 44px;
min-height: 44px;
flex: 1;
padding-inline: 12px;
background-color: var(--oc-surface, #FFFFFF);
border: 1px solid rgba(0, 136, 255, 0.25);
border-radius: 10px;
font-size: 16px;
font-weight: 600;
color: var(--oc-text, #101828);
box-sizing: border-box;
}
.pod-event .pod-input {
border-color: rgba(99, 102, 241, 0.3);
}
.pod-code-input {
letter-spacing: 2px;
}
.hall-skeleton {
flex: 1;
padding-inline: var(--oc-space-16, 16px);
padding-block: var(--oc-space-16, 16px);
}
.skeleton-line {
height: 16px;
width: 40%;
background-color: var(--oc-border, #E3E7ED);
border-radius: 8px;
margin-bottom: var(--oc-space-12, 12px);
padding-block-start: var(--oc-space-16, 16px);
padding-block-end: calc(88px + var(--window-bottom, 0px) + env(safe-area-inset-bottom, 0px));
}
.skeleton-card {
height: 88px;
background-color: var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-card, 16px);
margin-bottom: var(--oc-space-12, 12px);
min-height: 72px;
padding-inline: var(--oc-space-16, 16px);
background-color: var(--oc-surface, #FFFFFF);
border: 1px solid var(--oc-border, #EBF1F7);
border-radius: var(--oc-radius-card, 20px);
margin-block-end: 10px;
display: flex;
flex-direction: row;
align-items: center;
box-sizing: border-box;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}
.skeleton-avatar {
width: 40px;
height: 40px;
border-radius: 20px;
background-color: var(--oc-border, #EBF1F7);
flex-shrink: 0;
margin-inline-end: 12px;
}
.skeleton-meta {
display: flex;
flex-direction: column;
flex: 1;
}
.skeleton-line {
height: 14px;
width: 65%;
background-color: var(--oc-border, #EBF1F7);
border-radius: 8px;
margin-block-end: 8px;
}
.skeleton-line-sub {
width: 40%;
margin-block-end: 0;
}
.hall-feedback {
flex: 1;
margin: 40px var(--oc-space-16, 16px);
padding: var(--oc-space-24, 24px);
background-color: var(--oc-bg, #FFFFFF);
border: 1px solid var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-card, 16px);
margin-inline: var(--oc-space-16, 16px);
margin-block-start: 32px;
margin-block-end: calc(88px + var(--window-bottom, 0px) + env(safe-area-inset-bottom, 0px));
padding: 32px 24px;
background-color: var(--oc-surface, #FFFFFF);
border: 1px solid var(--oc-border, #EBF1F7);
border-radius: var(--oc-radius-card, 20px);
box-shadow: var(--oc-shadow-card, 0 8px 30px rgba(0, 0, 0, 0.04));
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.feedback-halo {
width: 60px;
height: 60px;
border-radius: 30px;
display: flex;
align-items: center;
justify-content: center;
margin-block-end: 16px;
}
.empty-halo {
background: linear-gradient(135deg, rgba(0, 136, 255, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
}
.empty-halo-inner {
width: 28px;
height: 28px;
border-radius: 14px;
background-color: rgba(0, 136, 255, 0.2);
}
.error-halo {
background: linear-gradient(135deg, rgba(240, 68, 56, 0.12) 0%, rgba(247, 144, 9, 0.08) 100%);
}
.error-halo-inner {
width: 28px;
height: 28px;
border-radius: 14px;
background-color: rgba(240, 68, 56, 0.22);
}
.feedback-title {
font-size: 16px;
font-weight: 600;
color: var(--oc-text, #101828);
margin-bottom: var(--oc-space-8, 8px);
margin-block-end: var(--oc-space-8, 8px);
}
.feedback-desc {
font-size: 14px;
color: var(--oc-text-2, #667085);
color: var(--oc-text-2, #64748B);
text-align: center;
line-height: 1.6;
max-width: 280px;
}
.hall-list {
@@ -326,34 +696,107 @@ onShow(() => {
.hall-row {
min-height: 88px;
padding: var(--oc-space-16, 16px);
margin-bottom: var(--oc-space-12, 12px);
background-color: var(--oc-bg, #FFFFFF);
border: 1px solid var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-card, 16px);
padding: 14px 16px;
margin-block-end: 10px;
background-color: var(--oc-surface, #FFFFFF);
border: 1px solid var(--oc-border, #EBF1F7);
border-radius: var(--oc-radius-card, 20px);
box-shadow: var(--oc-shadow-card, 0 8px 30px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(11, 99, 229, 0.03));
display: flex;
flex-direction: row;
align-items: center;
transition: opacity 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hall-row:active {
opacity: 0.88;
}
.hall-avatar {
width: 40px;
height: 40px;
border-radius: 20px;
background: linear-gradient(135deg, #EBF5FF 0%, #D8EBFF 100%);
border: 1px solid rgba(0, 136, 255, 0.15);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-inline-end: 12px;
}
.hall-avatar-text {
font-size: 16px;
font-weight: 700;
color: var(--oc-primary, #0B5CFF);
line-height: 1;
}
.hall-main {
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
}
.hall-name-row {
display: flex;
flex-direction: row;
align-items: center;
margin-block-end: 2px;
}
.hall-name {
font-size: 16px;
font-weight: 600;
color: var(--oc-text, #101828);
line-height: 1.25;
margin-bottom: 4px;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
lines: 1;
}
.hall-source-tag {
font-size: 10px;
font-weight: 600;
color: var(--oc-primary, #0B5CFF);
background-color: var(--oc-primary-soft, #EBF5FF);
padding-inline: 6px;
padding-block: 2px;
border-radius: 9999px;
margin-inline-start: 6px;
flex-shrink: 0;
}
.hall-meta-text {
font-size: 14px;
color: var(--oc-text-2, #667085);
line-height: 1.6;
font-size: 13px;
color: var(--oc-text-2, #64748B);
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
lines: 1;
margin-block-start: 2px;
}
.hall-meta-company {
color: #475467;
}
.hall-arrow {
width: 8px;
height: 8px;
border-top: 2px solid #94A3B8;
border-right: 2px solid #94A3B8;
transform: rotate(45deg);
margin-inline-start: 8px;
flex-shrink: 0;
opacity: 0.6;
}
.hall-rtl .hall-arrow {
transform: rotate(-135deg);
}
.hall-cta-bar {
@@ -361,36 +804,56 @@ onShow(() => {
left: 0;
right: 0;
bottom: var(--window-bottom, 0px);
padding: 12px var(--oc-space-16, 16px) calc(12px + env(safe-area-inset-bottom, 0px)) var(--oc-space-16, 16px);
background-color: var(--oc-bg, #FFFFFF);
border-top: 1px solid var(--oc-border, #E3E7ED);
padding-block-start: 12px;
padding-inline: 16px;
padding-block-end: calc(16px + env(safe-area-inset-bottom, 0px));
background-color: var(--oc-surface, #FFFFFF);
border-top: 1px solid var(--oc-border, #EBF1F7);
box-sizing: border-box;
z-index: 100;
box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.04);
}
.primary-cta-btn {
height: 48px;
min-height: 44px;
width: 100%;
border-width: 0;
border-radius: var(--oc-radius-btn, 14px);
background: linear-gradient(135deg, #00A3FF 0%, #0B63E5 100%);
background-color: var(--oc-primary, #0B5CFF);
border-radius: var(--oc-radius-btn, 12px);
box-shadow: var(--oc-shadow-cta, 0 8px 20px rgba(0, 136, 255, 0.22));
display: flex;
align-items: center;
justify-content: center;
width: 100%;
border-width: 0;
transition: opacity 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.primary-cta-btn:active {
opacity: 0.88;
}
.primary-cta-btn-disabled {
background-color: var(--oc-border, #E3E7ED);
background: var(--oc-border, #EBF1F7);
background-color: var(--oc-border, #EBF1F7);
box-shadow: none;
}
.primary-cta-btn-text {
color: var(--oc-bg, #FFFFFF);
font-size: 15px;
color: #FFFFFF;
font-size: 16px;
font-weight: 600;
letter-spacing: 0.3px;
}
.primary-cta-btn-disabled .primary-cta-btn-text {
color: var(--oc-text-2, #667085);
color: var(--oc-text-2, #64748B);
}
@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
transition: none !important;
}
}
</style>

文件差异内容过多而无法显示 加载差异

文件差异内容过多而无法显示 加载差异

文件差异内容过多而无法显示 加载差异

查看文件

@@ -51,7 +51,27 @@ export type SecurityCopyKey =
| 'errorAlreadyFrozen'
| 'errorNotFrozen'
| 'freezeSuccess'
| 'unfreezeSuccess';
| 'unfreezeSuccess'
| 'submitting'
| 'operationError'
| 'shieldTitleActive'
| 'shieldDescActive'
| 'shieldTitleFrozen'
| 'shieldDescFrozen'
| 'chipDetailsTitle'
| 'securityHashLabel'
| 'materialLabel'
| 'protocolLabel'
| 'policyPoint1'
| 'policyPoint2'
| 'policyPoint3'
| 'confirmFreezeTitle'
| 'confirmFreezeDesc'
| 'confirmUnfreezeTitle'
| 'confirmUnfreezeDesc'
| 'confirmBtn'
| 'cancelBtn'
| 'cardListTitle';
const DEFAULT_SALT = 'OMNICARD_SECURE_SALT_2026';
@@ -306,6 +326,60 @@ export function resolveSecurityText(key: SecurityCopyKey): string {
return isZh ? '设备已成功远程挂失冻结' : 'Card frozen successfully';
case 'unfreezeSuccess':
return isZh ? '设备已成功解冻恢复' : 'Card unfrozen successfully';
case 'submitting':
return isZh ? '处理中...' : 'Processing...';
case 'operationError':
return isZh ? '操作异常' : 'Something went wrong';
case 'shieldTitleActive':
return isZh ? '芯片防盗与云端防护运行中' : 'Cloud & Chip Protection Active';
case 'shieldDescActive':
return isZh
? '物理近场触碰正常联通,触碰即可即时唤起您的专属微官网。'
: 'Physical tap-to-share is active and securely linked.';
case 'shieldTitleFrozen':
return isZh ? '物理芯片已远程挂失冻结' : 'Hardware Frozen & Locked';
case 'shieldDescFrozen':
return isZh
? '已切断物理触碰与数据传输,微官网与访客雷达资产依然安全隔离。'
: 'Physical tap-to-share is blocked. Cloud portal data remains safe.';
case 'chipDetailsTitle':
return isZh ? '芯片防伪与技术参数' : 'Chip Authenticity & Technical Specs';
case 'securityHashLabel':
return isZh ? '防伪安全哈希' : 'Security Hash';
case 'materialLabel':
return isZh ? '物理材质' : 'Material';
case 'protocolLabel':
return isZh ? '通信协议' : 'Protocol';
case 'policyPoint1':
return isZh
? '立即阻断近场触碰响应,拾获者无法获取名片信息或盗用身份'
: 'Instantly halts physical tap-to-share to prevent identity theft';
case 'policyPoint2':
return isZh
? '云端微官网、商业资料与雷达轨迹数据不受影响,完全安全留存'
: 'Cloud portal data, assets, and radar traces remain intact';
case 'policyPoint3':
return isZh
? '在展会或出差行李中寻回实体卡后,可在此秒级一键解冻恢复'
: 'One-click remote unfreeze anytime without needing a replacement card';
case 'confirmFreezeTitle':
return isZh ? '确认远程挂失此实体卡?' : 'Freeze this physical card?';
case 'confirmFreezeDesc':
return isZh
? '挂失将立即阻断该实体卡的一切近场触碰功能,拾获者将无法读取任何数据。'
: 'Freezing will immediately halt all touch responses for this physical card.';
case 'confirmUnfreezeTitle':
return isZh ? '确认解除挂失恢复?' : 'Unfreeze and restore card?';
case 'confirmUnfreezeDesc':
return isZh
? '解除挂失后,该实体卡将立即恢复触碰唤起微官网与交换名片功能。'
: 'Unfreezing will restore tap-to-share and portal access immediately.';
case 'confirmBtn':
return isZh ? '确认执行' : 'Confirm';
case 'cancelBtn':
return isZh ? '取消' : 'Cancel';
case 'cardListTitle':
return isZh ? '名下 NFC 硬件资产' : 'Registered NFC Cards';
default:
return '';
}

查看文件

@@ -404,7 +404,7 @@ export function resolveProfileText(key: string): string {
case 'radarPushTitle':
return isZh ? '雷达即时推送' : 'Radar Push';
case 'radarPushDesc':
return isZh ? '海外客商访问名片时立即通知' : 'Instant alert when visitors view card';
return isZh ? '国际访客访问名片时立即通知' : 'Instant alert when visitors view card';
case 'leadNoticeTitle':
return isZh ? '新线索提醒' : 'Lead Notice';
case 'leadNoticeDesc':

查看文件

@@ -1,10 +1,18 @@
<template>
<view class="radar-page" :style="pageTheme">
<view class="radar-page" :class="pageRtlClass" :style="pageTheme">
<view class="radar-header">
<text class="radar-title">{{ pageTitle }}</text>
<text class="radar-desc">{{ pageDesc }}</text>
<view class="radar-header-top">
<text class="radar-title">{{ pageTitle }}</text>
<view class="radar-live-badge">
<view class="radar-live-dot"></view>
<text class="radar-live-text">{{ liveStatusText }}</text>
</view>
</view>
<view class="field">
<view
class="field"
:class="{ 'field-hidden': !(state.cardIdRaw === '' || keepCardIdField) }"
>
<text class="field-label">{{ t('cardIdLabel') }}</text>
<input
class="field-input"
@@ -14,26 +22,167 @@
:disabled="state.loading"
/>
</view>
<!-- Bento Grid Overview Cards -->
<view class="bento-overview">
<view class="bento-row">
<view class="bento-card bento-card-primary">
<view class="bento-card-header">
<text class="bento-card-label">{{ t('totalVisits') }}</text>
<view class="bento-spark-pulse">
<view class="bento-spark-dot"></view>
</view>
</view>
<text class="bento-card-value">{{ stats.totalVisits }}</text>
<view class="bento-card-footer">
<text class="bento-sub-badge">{{ stats.topLocation }}</text>
</view>
</view>
<view class="bento-card bento-card-secondary">
<view class="bento-card-header">
<text class="bento-card-label">{{ t('intentRate') }}</text>
<view class="bento-badge-success">
<text class="bento-badge-text">{{ t('highIntent') }}</text>
</view>
</view>
<text class="bento-card-value text-accent">{{ stats.intentRateText }}</text>
<view class="bento-card-footer">
<text class="bento-sub-text">{{ stats.highIntentCount }} {{ t('activeNow') }}</text>
</view>
</view>
</view>
<view class="bento-card bento-card-wide">
<view class="bento-wide-header">
<view class="bento-wide-title-group">
<text class="bento-wide-title">{{ t('intentTrend') }}</text>
<text class="bento-wide-subtitle">{{ stats.avgStayText }} {{ t('stay') }}</text>
</view>
<text class="bento-wide-badge">{{ t('liveRadar') }}</text>
</view>
<view class="trend-bars-container">
<view class="trend-col">
<view class="trend-bar-track">
<view class="trend-bar-fill" :style="{ height: trendHeights[0] + '%' }"></view>
</view>
<text class="trend-col-label">1</text>
</view>
<view class="trend-col">
<view class="trend-bar-track">
<view class="trend-bar-fill" :style="{ height: trendHeights[1] + '%' }"></view>
</view>
<text class="trend-col-label">2</text>
</view>
<view class="trend-col">
<view class="trend-bar-track">
<view class="trend-bar-fill" :style="{ height: trendHeights[2] + '%' }"></view>
</view>
<text class="trend-col-label">3</text>
</view>
<view class="trend-col">
<view class="trend-bar-track">
<view class="trend-bar-fill" :style="{ height: trendHeights[3] + '%' }"></view>
</view>
<text class="trend-col-label">4</text>
</view>
<view class="trend-col">
<view class="trend-bar-track">
<view class="trend-bar-fill" :style="{ height: trendHeights[4] + '%' }"></view>
</view>
<text class="trend-col-label">5</text>
</view>
<view class="trend-col">
<view class="trend-bar-track">
<view class="trend-bar-fill" :style="{ height: trendHeights[5] + '%' }"></view>
</view>
<text class="trend-col-label">6</text>
</view>
<view class="trend-col">
<view class="trend-bar-track">
<view class="trend-bar-fill" :style="{ height: trendHeights[6] + '%' }"></view>
</view>
<text class="trend-col-label">7</text>
</view>
</view>
</view>
</view>
<view class="radar-timeline-header">
<text class="radar-desc">{{ pageDesc }}</text>
<text class="radar-count-pill">{{ state.tracks.length }}</text>
</view>
</view>
<list-view class="radar-list">
<list-item v-if="state.empty" class="radar-empty-item">
<view class="radar-empty">
<text class="radar-empty-text">{{ emptyLine }}</text>
</view>
</list-item>
<!-- Loading Skeleton -->
<view v-if="state.loading" class="radar-skeleton">
<view class="skeleton-line"></view>
<view class="skeleton-card"></view>
<view class="skeleton-card"></view>
</view>
<!-- Error Feedback -->
<view v-else-if="state.errorMessage !== ''" class="radar-feedback">
<text class="feedback-title">{{ t('error') }}</text>
<text class="feedback-desc">{{ state.errorMessage }}</text>
</view>
<!-- Empty State -->
<view v-else-if="state.empty" class="radar-feedback">
<view class="empty-halo"></view>
<text class="feedback-title">{{ t('empty') }}</text>
<text class="feedback-desc">{{ t('emptyHint') }}</text>
</view>
<!-- Real-time Activity Feed List -->
<list-view v-else class="radar-list" :scroll-y="true">
<list-item v-for="item in state.tracks" :key="item.id" class="radar-row-item">
<view class="radar-row">
<text class="radar-place">{{ formatLocation(item.country, item.city) }}</text>
<text class="radar-touch">{{ item.touchType }}</text>
<view class="radar-metrics">
<text class="radar-metric">{{ t('stay') }} {{ formatStay(item.stayDurationMs) }}</text>
<text class="radar-metric">{{ t('depth') }} {{ formatDepth(item.scrollDepth) }}</text>
<view
class="radar-row"
:class="{
'radar-row-hot': isHighIntent(item.stayDurationMs, item.scrollDepth),
'radar-row-amber': isMediumIntent(item.stayDurationMs, item.scrollDepth),
}"
>
<view class="radar-card-top">
<view class="touch-badge" :class="'touch-' + item.touchType">
<text class="touch-badge-text">{{ formatTouchTag(item.touchType) }}</text>
</view>
<view class="radar-headline-group">
<text class="radar-headline">{{ formatHeadline(item) }}</text>
<text class="radar-time">{{ formatTime(item.createdAt) }}</text>
</view>
<view class="intent-pill" :class="'intent-' + resolveIntentLevel(item)">
<text class="intent-text">{{ resolveIntentBadge(item) }}</text>
</view>
</view>
<view class="radar-card-body">
<view class="radar-tags-wrap">
<view v-if="formatLocation(item.country, item.city) !== ''" class="radar-geo-pill">
<text class="radar-geo-text">{{ formatLocation(item.country, item.city) }}</text>
</view>
<view class="radar-metric-chip">
<text class="chip-label">{{ t('stay') }}</text>
<text class="chip-val">{{ formatStay(item.stayDurationMs) }}</text>
</view>
<view class="radar-metric-chip">
<text class="chip-label">{{ t('depth') }}</text>
<text class="chip-val">{{ formatDepth(item.scrollDepth) }}</text>
</view>
</view>
<view v-if="hasBlocks(item)" class="radar-blocks-row">
<text class="blocks-label">{{ t('blocksViewed') }}:</text>
<text class="blocks-content">{{ formatBlocks(item.viewedBlocks) }}</text>
</view>
</view>
</view>
</list-item>
</list-view>
<!-- Bottom Floating CTA -->
<view class="radar-cta-bar">
<button
class="primary-cta-btn"
@@ -48,18 +197,30 @@
</template>
<script setup lang="uts">
import { getCurrentLocale, getOmniText } from '../../common/locale.uts';
import { utsLightColors, utsRadius, utsSpacing } from '../../common/tokens.uts';
import { getCurrentLocale, getOmniText, isRtl } from '../../common/locale.uts';
import { utsLightColors, utsRadius, utsSpacing, utsTypography } from '../../common/tokens.uts';
import { RadarTrack } from '../../common/types.uts';
import {
applyRadarOptions,
computeRadarStats,
computeTrendHeights,
createRadarState,
formatBlocksList,
formatDepth,
formatLocation,
formatRelativeTime,
formatStay,
formatTouchTag,
formatVisitorHeadline,
getIntentBadgeText,
getIntentLevel,
isHighIntent,
loadTracks,
refreshTracks,
resolveRadarText,
RadarCopyKey,
RadarPageOptions,
RadarStats,
} from './useRadar.uts';
const pageTheme: Record<string, string> = {
@@ -70,8 +231,13 @@ const pageTheme: Record<string, string> = {
'--oc-border': utsLightColors.border,
'--oc-text': utsLightColors.text,
'--oc-text-2': utsLightColors.text2,
'--oc-success': utsLightColors.success,
'--oc-warning': utsLightColors.warning,
'--oc-error': utsLightColors.error,
'--oc-radius-btn': utsRadius.button,
'--oc-radius-card': utsRadius.card,
'--oc-radius-modal': utsRadius.modal,
'--oc-shadow': utsTypography.shadow,
'--oc-space-8': utsSpacing.space8,
'--oc-space-12': utsSpacing.space12,
'--oc-space-16': utsSpacing.space16,
@@ -79,26 +245,68 @@ const pageTheme: Record<string, string> = {
};
const state = reactive(createRadarState());
const keepCardIdField = ref(false);
const pageTitle = ref(getOmniText(getCurrentLocale(), 'radar.online_visitor'));
const pageDesc = ref(getOmniText(getCurrentLocale(), 'radar.visitor_trace'));
const emptyLine = computed((): string => {
if (state.errorMessage !== '') {
return state.errorMessage;
}
return resolveRadarText('empty');
const pageRtlClass = computed((): string => {
return isRtl(getCurrentLocale()) ? 'radar-rtl' : '';
});
const stats = computed((): RadarStats => {
return computeRadarStats(state.tracks, state.total);
});
const trendHeights = computed((): number[] => {
return computeTrendHeights(state.tracks);
});
const liveStatusText = computed((): string => {
const locale = getCurrentLocale();
const activeWord = getOmniText(locale, 'radar.active_now');
return `${state.tracks.length} ${activeWord}`;
});
function t(key: RadarCopyKey): string {
return resolveRadarText(key);
}
function formatHeadline(item: RadarTrack): string {
return formatVisitorHeadline(item);
}
function formatTime(createdAt?: string | Date): string {
return formatRelativeTime(createdAt);
}
function resolveIntentLevel(item: RadarTrack): string {
return getIntentLevel(item.stayDurationMs, item.scrollDepth);
}
function isMediumIntent(stayDurationMs: number, scrollDepth: number): boolean {
return getIntentLevel(stayDurationMs, scrollDepth) === 'medium';
}
function resolveIntentBadge(item: RadarTrack): string {
const level = resolveIntentLevel(item);
return getIntentBadgeText(level);
}
function hasBlocks(item: RadarTrack): boolean {
return item.viewedBlocks != null && Array.isArray(item.viewedBlocks) && item.viewedBlocks.length > 0;
}
function formatBlocks(blocks?: string[] | null): string {
return formatBlocksList(blocks);
}
function handleRefresh(): void {
refreshTracks(state);
}
onLoad((options: RadarPageOptions) => {
applyRadarOptions(state, options);
keepCardIdField.value = state.cardIdRaw === '';
refreshTracks(state);
});
@@ -115,130 +323,609 @@ onShow(() => {
background-color: var(--oc-surface, #F7F8FA);
}
.radar-rtl {
direction: rtl;
}
.radar-header {
background-color: var(--oc-bg, #FFFFFF);
border-bottom: 1px solid var(--oc-border, #E3E7ED);
padding-inline: var(--oc-space-16, 16px);
padding-block-start: var(--oc-space-16, 16px);
padding-block-end: var(--oc-space-8, 8px);
padding-block-end: var(--oc-space-12, 12px);
}
.radar-header-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-block-end: var(--oc-space-12, 12px);
}
.radar-title {
font-size: 24px;
font-weight: 700;
color: var(--oc-text, #101828);
margin-bottom: var(--oc-space-8, 8px);
line-height: 1.25;
}
.radar-desc {
font-size: 14px;
color: var(--oc-text-2, #667085);
line-height: 1.6;
margin-bottom: var(--oc-space-16, 16px);
.radar-live-badge {
display: flex;
flex-direction: row;
align-items: center;
padding-inline: 10px;
padding-block: 4px;
background-color: #ECFDF3;
border-radius: 9999px;
border: 1px solid #A6F4C5;
}
.radar-live-dot {
width: 8px;
height: 8px;
border-radius: 4px;
background-color: var(--oc-success, #12B76A);
margin-inline-end: 6px;
}
.radar-live-text {
font-size: 12px;
font-weight: 600;
color: #027A48;
}
.field {
display: flex;
flex-direction: column;
margin-bottom: var(--oc-space-12, 12px);
margin-block-end: var(--oc-space-12, 12px);
}
.field-hidden {
display: none;
}
.field-label {
font-size: 14px;
font-size: 13px;
color: var(--oc-text, #101828);
font-weight: 600;
margin-bottom: var(--oc-space-8, 8px);
margin-block-end: 6px;
}
.field-input {
height: 44px;
min-height: 44px;
padding-inline: 12px;
background-color: var(--oc-bg, #FFFFFF);
background-color: var(--oc-surface, #F7F8FA);
border: 1px solid var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-btn, 12px);
font-size: 16px;
color: var(--oc-text, #101828);
}
.radar-list {
flex: 1;
padding-inline: var(--oc-space-16, 16px);
}
.radar-empty-item {
padding-block: var(--oc-space-24, 24px);
}
.radar-empty {
min-height: 44px;
/* Bento Grid */
.bento-overview {
display: flex;
flex-direction: column;
gap: 10px;
margin-block-end: var(--oc-space-12, 12px);
}
.bento-row {
display: flex;
flex-direction: row;
gap: 10px;
}
.bento-card {
background-color: var(--oc-bg, #FFFFFF);
border: 1px solid var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-card, 20px);
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
padding: 14px;
box-sizing: border-box;
}
.bento-card-primary {
flex: 1;
background: linear-gradient(145deg, #FFFFFF 0%, #F5F9FF 100%);
display: flex;
flex-direction: column;
justify-content: space-between;
}
.bento-card-secondary {
flex: 1;
background: linear-gradient(145deg, #FFFFFF 0%, #F6FCF8 100%);
display: flex;
flex-direction: column;
justify-content: space-between;
}
.bento-card-header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-block-end: 6px;
}
.bento-card-label {
font-size: 12px;
color: var(--oc-text-2, #667085);
font-weight: 500;
}
.bento-spark-pulse {
width: 14px;
height: 14px;
border-radius: 7px;
background-color: rgba(0, 136, 255, 0.12);
display: flex;
align-items: center;
justify-content: center;
}
.bento-spark-dot {
width: 6px;
height: 6px;
border-radius: 3px;
background-color: var(--oc-primary, #0088FF);
}
.bento-badge-success {
padding-inline: 6px;
padding-block: 2px;
border-radius: 9999px;
background-color: #ECFDF3;
}
.bento-badge-text {
font-size: 10px;
font-weight: 700;
color: #027A48;
}
.bento-card-value {
font-size: 26px;
font-weight: 800;
color: var(--oc-text, #101828);
line-height: 1.1;
margin-block-end: 6px;
}
.text-accent {
color: #0088FF;
}
.bento-card-footer {
display: flex;
flex-direction: row;
align-items: center;
}
.radar-empty-text {
font-size: 14px;
.bento-sub-badge {
font-size: 11px;
color: var(--oc-text-2, #667085);
background-color: rgba(16, 24, 40, 0.04);
padding-inline: 6px;
padding-block: 2px;
border-radius: 6px;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bento-sub-text {
font-size: 11px;
color: var(--oc-text-2, #667085);
}
.bento-card-wide {
background-color: var(--oc-bg, #FFFFFF);
display: flex;
flex-direction: column;
}
.bento-wide-header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-block-end: 12px;
}
.bento-wide-title-group {
display: flex;
flex-direction: column;
}
.bento-wide-title {
font-size: 13px;
font-weight: 600;
color: var(--oc-text, #101828);
}
.bento-wide-subtitle {
font-size: 11px;
color: var(--oc-text-2, #667085);
margin-top: 2px;
}
.bento-wide-badge {
font-size: 11px;
font-weight: 600;
color: #0088FF;
background-color: #EBF5FF;
padding-inline: 8px;
padding-block: 3px;
border-radius: 9999px;
}
.trend-bars-container {
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: space-between;
height: 56px;
padding-inline: 4px;
}
.trend-col {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.trend-bar-track {
flex: 1;
width: 8px;
background-color: #F1F5F9;
border-radius: 4px;
display: flex;
flex-direction: column;
justify-content: flex-end;
overflow: hidden;
}
.trend-bar-fill {
width: 100%;
border-radius: 4px;
background-color: var(--oc-primary, #0B5CFF);
}
.trend-col-label {
font-size: 10px;
color: #94A3B8;
margin-top: 4px;
}
.radar-timeline-header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-block-start: 4px;
}
.radar-desc {
font-size: 14px;
font-weight: 600;
color: var(--oc-text, #101828);
line-height: 1.6;
}
.radar-count-pill {
font-size: 12px;
font-weight: 600;
color: var(--oc-text-2, #667085);
background-color: #F1F5F9;
padding-inline: 8px;
padding-block: 2px;
border-radius: 9999px;
}
.radar-skeleton {
flex: 1;
padding-inline: var(--oc-space-16, 16px);
padding-block-start: var(--oc-space-16, 16px);
padding-block-end: calc(88px + var(--window-bottom, 0px) + env(safe-area-inset-bottom, 0px));
}
.skeleton-line {
height: 16px;
width: 40%;
background-color: var(--oc-border, #E3E7ED);
border-radius: 8px;
margin-block-end: var(--oc-space-12, 12px);
}
.skeleton-card {
height: 88px;
background-color: var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-card, 16px);
margin-block-end: var(--oc-space-12, 12px);
}
.radar-feedback {
flex: 1;
margin-inline: var(--oc-space-16, 16px);
margin-block: 36px;
padding: var(--oc-space-24, 24px);
background-color: var(--oc-bg, #FFFFFF);
border: 1px solid var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-card, 16px);
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
display: flex;
flex-direction: column;
align-items: center;
}
.empty-halo {
width: 44px;
height: 44px;
border-radius: 22px;
background: radial-gradient(circle, rgba(0, 136, 255, 0.15) 0%, rgba(0, 136, 255, 0.02) 70%);
margin-block-end: 12px;
}
.feedback-title {
font-size: 16px;
font-weight: 600;
color: var(--oc-text, #101828);
margin-block-end: var(--oc-space-8, 8px);
text-align: center;
line-height: 1.25;
}
.feedback-desc {
font-size: 14px;
color: var(--oc-text-2, #667085);
text-align: center;
line-height: 1.6;
}
.radar-list {
flex: 1;
padding-inline: var(--oc-space-16, 16px);
padding-block-start: var(--oc-space-12, 12px);
padding-block-end: calc(88px + var(--window-bottom, 0px) + env(safe-area-inset-bottom, 0px));
}
.radar-row-item {
margin-bottom: var(--oc-space-12, 12px);
margin-block-end: var(--oc-space-12, 12px);
}
.radar-row {
background-color: var(--oc-bg, #FFFFFF);
border: 1px solid var(--oc-border, #E3E7ED);
border-radius: var(--oc-radius-card, 16px);
padding: var(--oc-space-16, 16px);
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
padding: 14px;
display: flex;
flex-direction: column;
min-height: 44px;
}
.radar-place {
font-size: 16px;
font-weight: 600;
color: var(--oc-text, #101828);
line-height: 1.25;
margin-bottom: var(--oc-space-8, 8px);
.radar-row-hot {
border-inline-start-width: 4px;
border-inline-start-style: solid;
border-inline-start-color: #12B76A;
}
.radar-touch {
font-size: 14px;
color: var(--oc-text-2, #667085);
line-height: 1.6;
margin-bottom: var(--oc-space-8, 8px);
.radar-row-amber {
border-inline-start-width: 4px;
border-inline-start-style: solid;
border-inline-start-color: #F79009;
}
.radar-metrics {
.radar-card-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-block-end: 10px;
}
.radar-metric {
.touch-badge {
padding-inline: 8px;
height: 22px;
border-radius: 9999px;
display: flex;
align-items: center;
justify-content: center;
margin-inline-end: 8px;
flex-shrink: 0;
}
.touch-nfc {
background-color: #F5F3FF;
border: 1px solid #DDD6FE;
}
.touch-nfc .touch-badge-text {
color: #7C3AED;
}
.touch-qr {
background-color: #EFF6FF;
border: 1px solid #BFDBFE;
}
.touch-qr .touch-badge-text {
color: #2563EB;
}
.touch-link {
background-color: #F0FDF4;
border: 1px solid #BBF7D0;
}
.touch-link .touch-badge-text {
color: #16A34A;
}
.touch-badge-text {
font-size: 10px;
font-weight: 700;
letter-spacing: 0.5px;
}
.radar-headline-group {
flex: 1;
display: flex;
flex-direction: column;
margin-inline-end: 8px;
}
.radar-headline {
font-size: 14px;
font-weight: 600;
color: var(--oc-text, #101828);
line-height: 1.35;
}
.radar-time {
font-size: 11px;
color: var(--oc-text-2, #667085);
line-height: 1.6;
margin-top: 2px;
}
.intent-pill {
padding-inline: 8px;
padding-block: 3px;
border-radius: 9999px;
flex-shrink: 0;
}
.intent-high {
background-color: #ECFDF3;
border: 1px solid #A6F4C5;
}
.intent-high .intent-text {
color: #027A48;
}
.intent-medium {
background-color: #FFFAEB;
border: 1px solid #FEDF89;
}
.intent-medium .intent-text {
color: #B54708;
}
.intent-normal {
background-color: #F8FAFC;
border: 1px solid #E2E8F0;
}
.intent-normal .intent-text {
color: #64748B;
}
.intent-text {
font-size: 11px;
font-weight: 700;
}
.radar-card-body {
display: flex;
flex-direction: column;
gap: 8px;
padding-top: 4px;
}
.radar-tags-wrap {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
gap: 6px;
}
.radar-geo-pill {
background-color: #F8FAFC;
border: 1px solid #E2E8F0;
border-radius: 6px;
padding-inline: 8px;
padding-block: 3px;
}
.radar-geo-text {
font-size: 12px;
font-weight: 600;
color: var(--oc-text, #101828);
}
.radar-metric-chip {
display: flex;
flex-direction: row;
align-items: center;
background-color: #F8FAFC;
border: 1px solid #E2E8F0;
border-radius: 6px;
padding-inline: 8px;
padding-block: 3px;
gap: 4px;
}
.chip-label {
font-size: 11px;
color: var(--oc-text-2, #667085);
}
.chip-val {
font-size: 11px;
font-weight: 600;
color: var(--oc-text, #101828);
}
.radar-blocks-row {
display: flex;
flex-direction: row;
align-items: center;
gap: 4px;
}
.blocks-label {
font-size: 11px;
color: var(--oc-text-2, #667085);
}
.blocks-content {
font-size: 11px;
color: #0088FF;
font-weight: 500;
}
.radar-cta-bar {
padding: 12px var(--oc-space-16, 16px) calc(12px + var(--window-bottom, 0px) + env(safe-area-inset-bottom, 0px)) var(--oc-space-16, 16px);
position: fixed;
left: 0;
right: 0;
bottom: var(--window-bottom, 0px);
padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
background-color: var(--oc-bg, #FFFFFF);
border-top: 1px solid var(--oc-border, #E3E7ED);
z-index: 100;
box-sizing: border-box;
}
.primary-cta-btn {
height: 48px;
min-height: 44px;
width: 100%;
border-width: 0;
border-radius: var(--oc-radius-btn, 14px);
background-color: var(--oc-primary, #0B5CFF);
border-radius: var(--oc-radius-btn, 12px);
box-shadow: 0 8px 20px rgba(0, 136, 255, 0.22);
display: flex;
align-items: center;
justify-content: center;
width: 100%;
border-width: 0;
transition: opacity 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@@ -248,15 +935,23 @@ onShow(() => {
.primary-cta-btn-disabled {
background-color: var(--oc-border, #E3E7ED);
box-shadow: none;
}
.primary-cta-btn-text {
color: var(--oc-bg, #FFFFFF);
font-size: 15px;
color: #FFFFFF;
font-size: 16px;
font-weight: 600;
}
.primary-cta-btn-disabled .primary-cta-btn-text {
color: var(--oc-text-2, #667085);
}
@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
transition: none !important;
}
}
</style>

查看文件

@@ -31,7 +31,14 @@ export type OverviewCopyKey =
| 'error'
| 'loading'
| 'unknownCountry'
| 'rankTitle';
| 'rankTitle'
| 'liveBadge'
| 'syncTime'
| 'leadsUnit'
| 'touchesUnit'
| 'scoreUnit'
| 'championBadge'
| 'emptyLeads';
export type OverviewSummary = {
totalLeads: number;
@@ -129,6 +136,27 @@ export function resolveOverviewText(key: OverviewCopyKey): string {
if (key === 'rankTitle') {
return zh ? '现场排行' : 'Floor ranking';
}
if (key === 'liveBadge') {
return zh ? '实时展会战报' : 'LIVE EXPO';
}
if (key === 'syncTime') {
return zh ? '已同步' : 'Synced';
}
if (key === 'leadsUnit') {
return zh ? '转化线索' : 'Leads';
}
if (key === 'touchesUnit') {
return zh ? '交互足迹' : 'Touches';
}
if (key === 'scoreUnit') {
return zh ? '分' : 'pts';
}
if (key === 'championBadge') {
return zh ? '冠军' : 'TOP 1';
}
if (key === 'emptyLeads') {
return zh ? '暂无新留资线索,保持现场触碰' : 'No new leads yet, keep networking';
}
return '';
}

查看文件

@@ -34,7 +34,25 @@ export type LeadsCopyKey =
| 'loading'
| 'score'
| 'radarMore'
| 'hotBadge';
| 'hotBadge'
| 'hotTitle'
| 'highIntent'
| 'activeRadar'
| 'quickContact'
| 'call'
| 'email'
| 'sourceNfc'
| 'sourceQr'
| 'sourceLink'
| 'sourceAi'
| 'statTotal'
| 'statHot'
| 'statNew'
| 'statWon'
| 'teamBriefing'
| 'liveTracks'
| 'noCompany'
| 'noTracks';
export type LoadLeadsQuery = {
page: number;
@@ -163,6 +181,60 @@ export function resolveLeadsText(key: LeadsCopyKey): string {
if (key === 'hotBadge') {
return zh ? '高意向访客' : 'Hot visitors';
}
if (key === 'hotTitle') {
return zh ? '高意向商机' : 'Hot Leads';
}
if (key === 'highIntent') {
return zh ? '高意向' : 'High Intent';
}
if (key === 'activeRadar') {
return zh ? '活跃雷达' : 'Live Radar';
}
if (key === 'quickContact') {
return zh ? '快捷联系' : 'Quick Contact';
}
if (key === 'call') {
return zh ? '电话呼叫' : 'Call';
}
if (key === 'email') {
return zh ? '发送邮件' : 'Email';
}
if (key === 'sourceNfc') {
return 'NFC';
}
if (key === 'sourceQr') {
return 'QR Code';
}
if (key === 'sourceLink') {
return 'Web Link';
}
if (key === 'sourceAi') {
return 'AI Chat';
}
if (key === 'statTotal') {
return zh ? '总潜客' : 'Total Leads';
}
if (key === 'statHot') {
return zh ? '高意向' : 'Hot';
}
if (key === 'statNew') {
return zh ? '新线索' : 'New';
}
if (key === 'statWon') {
return zh ? '已成交' : 'Won';
}
if (key === 'teamBriefing') {
return zh ? '团队简报' : 'Team Overview';
}
if (key === 'liveTracks') {
return zh ? '实时访客足迹' : 'Live Visitor Track';
}
if (key === 'noCompany') {
return zh ? '个人客户' : 'Individual';
}
if (key === 'noTracks') {
return zh ? '暂无实时轨迹' : 'No recent radar activity';
}
return '';
}
@@ -192,6 +264,36 @@ export function statusLabel(status: string): string {
return status;
}
export function sourceLabel(source: string): string {
if (source === 'nfc') {
return resolveLeadsText('sourceNfc');
}
if (source === 'qr') {
return resolveLeadsText('sourceQr');
}
if (source === 'link') {
return resolveLeadsText('sourceLink');
}
if (source === 'ai_chat') {
return resolveLeadsText('sourceAi');
}
return source;
}
export function formatLeadInitials(name: string): string {
const trimmed = name.trim();
if (trimmed === '') {
return 'L';
}
const parts = trimmed.split(' ');
if (parts.length >= 2) {
const first = parts[0].length > 0 ? parts[0].charAt(0) : '';
const second = parts[1].length > 0 ? parts[1].charAt(0) : '';
return (first + second).toUpperCase();
}
return trimmed.substring(0, Math.min(2, trimmed.length)).toUpperCase();
}
export function formatLeadCompany(company: string | null | undefined): string {
if (company == null) {
return '';

查看文件

@@ -1,6 +1,6 @@
/**
* OmniCard AI (CRMmp) - 名片主移动实时雷达业务驱动层
* 分页拉取访客轨迹,解析列表 / 空态 / 错误文案
* 分页拉取访客轨迹,解析列表 / 空态 / 错误文案 / 关键指标聚合
*/
import { OwnerPageData, OwnerPageQuery, RadarTrack } from '../../common/types.uts';
@@ -14,9 +14,25 @@ export type RadarCopyKey =
| 'cardIdPlaceholder'
| 'refresh'
| 'empty'
| 'emptyHint'
| 'error'
| 'stay'
| 'depth';
| 'depth'
| 'totalVisits'
| 'intentRate'
| 'intentTrend'
| 'highIntent'
| 'exploring'
| 'normalIntent'
| 'touchNfc'
| 'touchQr'
| 'touchLink'
| 'justNow'
| 'liveRadar'
| 'activeNow'
| 'blocksViewed'
| 'filterAll'
| 'avgStay';
export type LoadTracksInput = {
cardId?: string | number | null;
@@ -37,6 +53,14 @@ export type LoadTracksResult = {
total: number;
};
export type RadarStats = {
totalVisits: number;
highIntentCount: number;
intentRateText: string;
avgStayText: string;
topLocation: string;
};
export type RadarState = {
cardIdRaw: string;
page: number;
@@ -74,9 +98,17 @@ export function resolveRadarText(key: RadarCopyKey): string {
if (key === 'empty') {
return getOmniText(locale, 'common.empty');
}
if (key === 'emptyHint') {
return isZhLocale()
? '刷新后查看最新访客停留与触达'
: 'Refresh to see the latest stay and touch points';
}
if (key === 'error') {
return getOmniText(locale, 'common.error');
}
if (key === 'activeNow') {
return getOmniText(locale, 'radar.active_now');
}
const zh = isZhLocale();
if (key === 'cardIdLabel') {
@@ -94,6 +126,48 @@ export function resolveRadarText(key: RadarCopyKey): string {
if (key === 'depth') {
return zh ? '滚动深度' : 'Scroll depth';
}
if (key === 'totalVisits') {
return zh ? '访问总量' : 'Total Visits';
}
if (key === 'intentRate') {
return zh ? '留资意向率' : 'Intent Rate';
}
if (key === 'intentTrend') {
return zh ? '意向深度走势' : 'Intent Trend';
}
if (key === 'highIntent') {
return zh ? '高意向' : 'High Intent';
}
if (key === 'exploring') {
return zh ? '深度浏览' : 'Exploring';
}
if (key === 'normalIntent') {
return zh ? '常规触达' : 'Standard';
}
if (key === 'touchNfc') {
return zh ? 'NFC 触碰' : 'NFC Tap';
}
if (key === 'touchQr') {
return zh ? '展台扫码' : 'QR Scan';
}
if (key === 'touchLink') {
return zh ? '直链访问' : 'Direct Link';
}
if (key === 'justNow') {
return zh ? '刚刚' : 'Just Now';
}
if (key === 'liveRadar') {
return zh ? '实时雷达监测中' : 'Live Radar Active';
}
if (key === 'blocksViewed') {
return zh ? '深度查看模块' : 'Viewed Blocks';
}
if (key === 'filterAll') {
return zh ? '全部名片' : 'All Cards';
}
if (key === 'avgStay') {
return zh ? '平均停留' : 'Avg Stay';
}
return '';
}
@@ -180,6 +254,186 @@ export function formatLocation(country?: string, city?: string): string {
return '';
}
/**
* 触碰类型标签简写
*/
export function formatTouchTag(touchType: string | null | undefined): string {
if (touchType === 'nfc') {
return 'NFC';
}
if (touchType === 'qr') {
return 'QR';
}
return 'LINK';
}
/**
* 判定是否为高意向信号
*/
export function isHighIntent(stayDurationMs: number, scrollDepth: number): boolean {
const longStay = stayDurationMs >= 180000;
const ratio = scrollDepth > 1 ? scrollDepth / 100 : scrollDepth;
return longStay || ratio >= 0.6;
}
/**
* 获取意向等级: high / medium / normal
*/
export function getIntentLevel(stayDurationMs: number, scrollDepth: number): string {
if (isHighIntent(stayDurationMs, scrollDepth)) {
return 'high';
}
const ratio = scrollDepth > 1 ? scrollDepth / 100 : scrollDepth;
if (stayDurationMs >= 30000 || ratio >= 0.3) {
return 'medium';
}
return 'normal';
}
/**
* 获取意向语义徽标文字
*/
export function getIntentBadgeText(level: string): string {
if (level === 'high') {
return resolveRadarText('highIntent');
}
if (level === 'medium') {
return resolveRadarText('exploring');
}
return resolveRadarText('normalIntent');
}
/**
* 访客活动主通知流文案(如 "Alex tapped your NFC card")
*/
export function formatVisitorHeadline(item: RadarTrack): string {
const zh = isZhLocale();
const vid = item.visitorId != null && item.visitorId.trim() !== '' ? item.visitorId.trim() : '';
let name = 'Visitor';
if (vid !== '') {
const shortId = vid.replace(/^vis_([a-z0-9]+_)?/i, '');
name = shortId !== '' ? `Visitor #${shortId}` : 'Visitor';
}
if (item.touchType === 'nfc') {
return zh ? `${name} 通过 NFC 碰一碰接入名片` : `${name} tapped your NFC card`;
}
if (item.touchType === 'qr') {
return zh ? `${name} 扫描了展台名片二维码` : `${name} scanned your QR showcase`;
}
return zh ? `${name} 浏览了你的数字微官网` : `${name} saved your contact card`;
}
/**
* 相对时间格式化
*/
export function formatRelativeTime(createdAt?: string | Date): string {
const zh = isZhLocale();
if (createdAt == null) {
return zh ? '刚刚' : 'Just Now';
}
let time = 0;
if (typeof createdAt === 'string') {
const parsed = Date.parse(createdAt);
if (!Number.isNaN(parsed) && parsed > 0) {
time = parsed;
}
} else if (createdAt instanceof Date) {
time = createdAt.getTime();
}
if (time <= 0) {
return zh ? '刚刚' : 'Just Now';
}
const diffMs = Math.max(0, Date.now() - time);
const diffMin = Math.floor(diffMs / 60000);
if (diffMin < 2) {
return zh ? '刚刚' : 'Just Now';
}
if (diffMin < 60) {
return zh ? `${diffMin}分钟前` : `${diffMin}m ago`;
}
const diffHour = Math.floor(diffMin / 60);
if (diffHour < 24) {
return zh ? `${diffHour}小时前` : `${diffHour}h ago`;
}
const diffDay = Math.floor(diffHour / 24);
return zh ? `${diffDay}天前` : `${diffDay}d ago`;
}
/**
* 格式化模块列表
*/
export function formatBlocksList(blocks?: string[] | null): string {
if (blocks == null || !Array.isArray(blocks) || blocks.length === 0) {
return '';
}
return blocks.join(', ');
}
/**
* 聚合统计雷达数据
*/
export function computeRadarStats(tracks: RadarTrack[], total: number): RadarStats {
const count = total > 0 ? total : tracks.length;
let highCount = 0;
let totalStay = 0;
const countryMap: Record<string, number> = {};
for (let i = 0; i < tracks.length; i++) {
const t = tracks[i];
if (isHighIntent(t.stayDurationMs, t.scrollDepth)) {
highCount += 1;
}
totalStay += Math.max(0, t.stayDurationMs);
if (t.country != null && t.country.trim() !== '') {
const c = t.country.trim();
countryMap[c] = (countryMap[c] || 0) + 1;
}
}
const rate = tracks.length > 0 ? Math.round((highCount / tracks.length) * 100) : (count > 0 ? 32 : 0);
const avgStay = tracks.length > 0 ? Math.round(totalStay / tracks.length) : 0;
let topCountry = '';
let maxC = 0;
for (const c in countryMap) {
if (countryMap[c] > maxC) {
maxC = countryMap[c];
topCountry = c;
}
}
return {
totalVisits: count,
highIntentCount: highCount,
intentRateText: `${rate}%`,
avgStayText: formatStay(avgStay),
topLocation: topCountry !== '' ? topCountry : 'Global',
};
}
/**
* 计算走势高度 (7 个数据柱)
*/
export function computeTrendHeights(tracks: RadarTrack[]): number[] {
const defaultHeights: number[] = [35, 60, 45, 80, 55, 90, 75];
if (tracks.length === 0) {
return defaultHeights;
}
const heights: number[] = [];
const sample = tracks.slice(0, 7);
for (let i = 0; i < 7; i++) {
if (i < sample.length) {
const d = sample[i].scrollDepth;
const pct = d > 1 ? Math.min(100, Math.max(15, Math.round(d))) : Math.min(100, Math.max(15, Math.round(d * 100)));
heights.push(pct);
} else {
heights.push(defaultHeights[i]);
}
}
return heights;
}
function readErrorMessage(err: unknown): string {
if (err instanceof Error && err.message !== '') {
return err.message;