refactor(arch): 落地平台架构演进第一二阶段整改,消除OOM与越权风险并支持高并发缓冲与AI多租户BYOK
- [P0安全底座] 多租户数据闭环:公开留资与雷达足迹自动逆向追溯绑定名片 tenantId 与归属销售 userId - [P0性能稳定] 消除内存全量加载:公海池分批带条件扫描回收,雷达国家分布改用 SQL 原生 GROUP BY 聚合查询彻底消除 OOM 隐患 - [P0商业变现] 商业化配额门禁切面:在 Cool-Admin modifyBefore 生命周期织入 assertQuotaAvailable 校验,阻断超额名片创建 - [P0环境解耦] 客户端解耦本地硬编码:request.uts 支持 api_base_url 本地覆盖,生产数据库名修正为 crmmpdata - [P1高并发削峰] 雷达足迹批量缓冲引擎:引入 CrmRadarBufferService 环形缓冲队列与阈值/定时批量 Bulk Insert 落盘 - [P2中枢租户化] AI 智能中枢多租户 BYOK 与 Token 成本风控:支持企业自带 Key 隔离、Token 消耗账本、用量配额门禁与名片人设个性化联动 - [跨端规范] 对齐 Uni-app x 移动微官网原生首屏与底部原生 tabBar 规范 - [测试驱动] 全工程 116 个测试套件,1,175 个单元与集成测试用例全部 100% 绿色通过,管理后台 Vite 打包无错误
这个提交包含在:
368
mpuniapp/pages/owner/hall/index.uvue
普通文件
368
mpuniapp/pages/owner/hall/index.uvue
普通文件
@@ -0,0 +1,368 @@
|
||||
<template>
|
||||
<view class="hall-page" :style="pageTheme">
|
||||
<view class="hall-header">
|
||||
<text class="hall-title">{{ pageTitle }}</text>
|
||||
<text class="hall-subtitle">{{ pageSubtitle }}</text>
|
||||
<view class="hall-tabs">
|
||||
<view
|
||||
class="hall-tab"
|
||||
:class="{ 'hall-tab-active': state.tab === 'contacts' }"
|
||||
@click="handleTab('contacts')"
|
||||
>
|
||||
<text class="hall-tab-text">{{ t('tabContacts') }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="hall-tab"
|
||||
:class="{ 'hall-tab-active': state.tab === 'team' }"
|
||||
@click="handleTab('team')"
|
||||
>
|
||||
<text class="hall-tab-text">{{ t('tabTeam') }}</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"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view v-if="state.loading" class="hall-skeleton">
|
||||
<view class="skeleton-line"></view>
|
||||
<view class="skeleton-card"></view>
|
||||
<view class="skeleton-card"></view>
|
||||
</view>
|
||||
|
||||
<view v-else-if="state.errorMessage !== ''" class="hall-feedback">
|
||||
<text class="feedback-title">{{ t('error') }}</text>
|
||||
<text class="feedback-desc">{{ state.errorMessage }}</text>
|
||||
</view>
|
||||
|
||||
<view v-else-if="state.empty" class="hall-feedback">
|
||||
<text class="feedback-title">{{ t('empty') }}</text>
|
||||
<text class="feedback-desc">{{ emptyDesc }}</text>
|
||||
</view>
|
||||
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
</list-item>
|
||||
</list-view>
|
||||
|
||||
<view class="hall-cta-bar">
|
||||
<button
|
||||
class="primary-cta-btn"
|
||||
:class="{ 'primary-cta-btn-disabled': state.loading }"
|
||||
:disabled="state.loading"
|
||||
@click="handlePrimary"
|
||||
>
|
||||
<text class="primary-cta-btn-text">{{ ctaLabel }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { utsLightColors, utsRadius, utsSpacing } from '../../../common/tokens.uts';
|
||||
import {
|
||||
applyHallTab,
|
||||
createHallState,
|
||||
HallContactItem,
|
||||
HallCopyKey,
|
||||
HallTab,
|
||||
openHallPortal,
|
||||
refreshHall,
|
||||
resolveHallText,
|
||||
submitHallExchange,
|
||||
} from './useHall.uts';
|
||||
|
||||
const pageTheme: Record<string, string> = {
|
||||
'--oc-primary': utsLightColors.primary,
|
||||
'--oc-primary-soft': utsLightColors.primarySoft,
|
||||
'--oc-bg': utsLightColors.bg,
|
||||
'--oc-surface': utsLightColors.surface,
|
||||
'--oc-border': utsLightColors.border,
|
||||
'--oc-text': utsLightColors.text,
|
||||
'--oc-text-2': utsLightColors.text2,
|
||||
'--oc-radius-btn': utsRadius.button,
|
||||
'--oc-radius-card': utsRadius.card,
|
||||
'--oc-space-8': utsSpacing.space8,
|
||||
'--oc-space-12': utsSpacing.space12,
|
||||
'--oc-space-16': utsSpacing.space16,
|
||||
'--oc-space-24': utsSpacing.space24,
|
||||
};
|
||||
|
||||
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 emptyDesc = computed((): string => {
|
||||
if (state.tab === 'team') {
|
||||
return resolveHallText('teamEmpty');
|
||||
}
|
||||
return pageSubtitle.value;
|
||||
});
|
||||
|
||||
const ctaLabel = computed((): string => {
|
||||
if (state.loading) {
|
||||
return resolveHallText('loading');
|
||||
}
|
||||
if (state.exchangeCode.trim() !== '') {
|
||||
return resolveHallText('exchange');
|
||||
}
|
||||
return resolveHallText('refresh');
|
||||
});
|
||||
|
||||
function t(key: HallCopyKey): string {
|
||||
return resolveHallText(key);
|
||||
}
|
||||
|
||||
function formatField(value: string | null | undefined): string {
|
||||
if (value == null) {
|
||||
return '';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
async function handleTab(tab: HallTab): Promise<void> {
|
||||
applyHallTab(state, tab);
|
||||
await refreshHall(state);
|
||||
}
|
||||
|
||||
function handleOpenPortal(item: HallContactItem): void {
|
||||
openHallPortal(item);
|
||||
}
|
||||
|
||||
async function handlePrimary(): Promise<void> {
|
||||
if (state.exchangeCode.trim() !== '') {
|
||||
await submitHallExchange(state);
|
||||
return;
|
||||
}
|
||||
await refreshHall(state);
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
refreshHall(state);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.hall-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
background-color: var(--oc-surface, #F7F8FA);
|
||||
}
|
||||
|
||||
.hall-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
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);
|
||||
}
|
||||
|
||||
.hall-title {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: var(--oc-text, #101828);
|
||||
line-height: 1.25;
|
||||
margin-bottom: var(--oc-space-8, 8px);
|
||||
}
|
||||
|
||||
.hall-subtitle {
|
||||
font-size: 14px;
|
||||
color: var(--oc-text-2, #667085);
|
||||
line-height: 1.6;
|
||||
margin-bottom: var(--oc-space-12, 12px);
|
||||
}
|
||||
|
||||
.hall-tabs {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: var(--oc-space-12, 12px);
|
||||
}
|
||||
|
||||
.hall-tab {
|
||||
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);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hall-tab-active {
|
||||
background-color: var(--oc-primary-soft, #EAF1FF);
|
||||
border-color: var(--oc-primary, #0B5CFF);
|
||||
}
|
||||
|
||||
.hall-tab-text {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--oc-text-2, #667085);
|
||||
}
|
||||
|
||||
.hall-tab-active .hall-tab-text {
|
||||
color: var(--oc-primary, #0B5CFF);
|
||||
}
|
||||
|
||||
.hall-search {
|
||||
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);
|
||||
font-size: 16px;
|
||||
color: var(--oc-text, #101828);
|
||||
}
|
||||
|
||||
.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);
|
||||
}
|
||||
|
||||
.skeleton-card {
|
||||
height: 88px;
|
||||
background-color: var(--oc-border, #E3E7ED);
|
||||
border-radius: var(--oc-radius-card, 16px);
|
||||
margin-bottom: var(--oc-space-12, 12px);
|
||||
}
|
||||
|
||||
.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);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.feedback-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--oc-text, #101828);
|
||||
margin-bottom: var(--oc-space-8, 8px);
|
||||
}
|
||||
|
||||
.feedback-desc {
|
||||
font-size: 14px;
|
||||
color: var(--oc-text-2, #667085);
|
||||
text-align: center;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.hall-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));
|
||||
}
|
||||
|
||||
.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);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.hall-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.hall-name {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--oc-text, #101828);
|
||||
line-height: 1.25;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.hall-meta-text {
|
||||
font-size: 14px;
|
||||
color: var(--oc-text-2, #667085);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.hall-cta-bar {
|
||||
position: fixed;
|
||||
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);
|
||||
box-sizing: border-box;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.primary-cta-btn {
|
||||
height: 48px;
|
||||
min-height: 44px;
|
||||
background-color: var(--oc-primary, #0B5CFF);
|
||||
border-radius: var(--oc-radius-btn, 12px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
.primary-cta-btn-disabled {
|
||||
background-color: var(--oc-border, #E3E7ED);
|
||||
}
|
||||
|
||||
.primary-cta-btn-text {
|
||||
color: var(--oc-bg, #FFFFFF);
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.primary-cta-btn-disabled .primary-cta-btn-text {
|
||||
color: var(--oc-text-2, #667085);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,273 @@
|
||||
/**
|
||||
* OmniCard AI - 名片大厅人脉驱动层
|
||||
*/
|
||||
|
||||
import {
|
||||
CardContact,
|
||||
OwnerPageData,
|
||||
OwnerPageQuery,
|
||||
} from '../../../common/types.uts';
|
||||
import {
|
||||
collectHallContact,
|
||||
confirmHallExchange,
|
||||
fetchHallContactPage,
|
||||
fetchTeamWallPage,
|
||||
} from '../../../common/api.uts';
|
||||
import { getCurrentLocale, getOmniText } from '../../../common/locale.uts';
|
||||
|
||||
export type HallCopyKey =
|
||||
| 'title'
|
||||
| 'subtitle'
|
||||
| 'searchPlaceholder'
|
||||
| 'refresh'
|
||||
| 'exchangePlaceholder'
|
||||
| 'exchange'
|
||||
| 'empty'
|
||||
| 'error'
|
||||
| 'loading'
|
||||
| 'scan'
|
||||
| 'tabContacts'
|
||||
| 'tabTeam'
|
||||
| 'teamEmpty';
|
||||
|
||||
export type HallContactItem = {
|
||||
id?: string | number;
|
||||
peerCardId: number;
|
||||
peerName: string;
|
||||
peerTitle?: string;
|
||||
peerCompany?: string;
|
||||
peerSlug?: string;
|
||||
source?: string;
|
||||
};
|
||||
|
||||
export type HallTab = 'contacts' | 'team';
|
||||
|
||||
export type HallState = {
|
||||
tab: HallTab;
|
||||
list: HallContactItem[];
|
||||
page: number;
|
||||
size: number;
|
||||
total: number;
|
||||
keyWord: string;
|
||||
exchangeCode: string;
|
||||
loading: boolean;
|
||||
empty: boolean;
|
||||
errorMessage: string;
|
||||
};
|
||||
|
||||
export type LoadHallApi = {
|
||||
fetchHallContactPage: (
|
||||
query: OwnerPageQuery
|
||||
) => Promise<OwnerPageData<CardContact>>;
|
||||
fetchTeamWallPage?: (
|
||||
query: OwnerPageQuery
|
||||
) => Promise<OwnerPageData<CardContact>>;
|
||||
confirmHallExchange?: (
|
||||
exchangeCode: string
|
||||
) => Promise<{ status: string; isDualSynced: boolean }>;
|
||||
collectHallContact?: (peerCardId: string | number) => Promise<CardContact>;
|
||||
};
|
||||
|
||||
function isZhLocale(): boolean {
|
||||
return getCurrentLocale() === 'zh-CN';
|
||||
}
|
||||
|
||||
export function resolveHallText(key: HallCopyKey): string {
|
||||
const locale = getCurrentLocale();
|
||||
if (key === 'empty') {
|
||||
return getOmniText(locale, 'common.empty');
|
||||
}
|
||||
if (key === 'error') {
|
||||
return getOmniText(locale, 'common.error');
|
||||
}
|
||||
if (key === 'loading') {
|
||||
return getOmniText(locale, 'common.loading');
|
||||
}
|
||||
if (key === 'scan') {
|
||||
return getOmniText(locale, 'card.scan_nfc');
|
||||
}
|
||||
|
||||
const zh = isZhLocale();
|
||||
if (key === 'title') {
|
||||
return zh ? '名片大厅' : 'Card hall';
|
||||
}
|
||||
if (key === 'subtitle') {
|
||||
return zh ? '已互换和收藏的名片' : 'Exchanged and saved cards';
|
||||
}
|
||||
if (key === 'searchPlaceholder') {
|
||||
return zh ? '搜索姓名或公司' : 'Search name or company';
|
||||
}
|
||||
if (key === 'refresh') {
|
||||
return zh ? '刷新人脉' : 'Refresh network';
|
||||
}
|
||||
if (key === 'exchangePlaceholder') {
|
||||
return zh ? '输入 6 位互换码' : '6-digit exchange code';
|
||||
}
|
||||
if (key === 'exchange') {
|
||||
return zh ? '确认互换' : 'Confirm exchange';
|
||||
}
|
||||
if (key === 'tabContacts') {
|
||||
return zh ? '人脉' : 'Network';
|
||||
}
|
||||
if (key === 'tabTeam') {
|
||||
return zh ? '团队' : 'Team';
|
||||
}
|
||||
if (key === 'teamEmpty') {
|
||||
return zh ? '还没有同事发布名片' : 'No published teammate cards yet';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
export function toHallItem(row: CardContact): HallContactItem {
|
||||
return {
|
||||
id: row.id,
|
||||
peerCardId: Number(row.peerCardId),
|
||||
peerName: row.peerName != null ? row.peerName : '',
|
||||
peerTitle: row.peerTitle,
|
||||
peerCompany: row.peerCompany,
|
||||
peerSlug: row.peerSlug,
|
||||
source: row.source,
|
||||
};
|
||||
}
|
||||
|
||||
export function createHallState(): HallState {
|
||||
return {
|
||||
tab: 'contacts',
|
||||
list: [],
|
||||
page: 1,
|
||||
size: 20,
|
||||
total: 0,
|
||||
keyWord: '',
|
||||
exchangeCode: '',
|
||||
loading: false,
|
||||
empty: false,
|
||||
errorMessage: '',
|
||||
};
|
||||
}
|
||||
|
||||
function readErrorMessage(err: unknown): string {
|
||||
if (err instanceof Error && err.message !== '') {
|
||||
return err.message;
|
||||
}
|
||||
return resolveHallText('error');
|
||||
}
|
||||
|
||||
export function buildHallPortalUrl(item: HallContactItem): string {
|
||||
if (item.peerSlug != null && item.peerSlug !== '') {
|
||||
return `/pages/portal/index?slug=${item.peerSlug}`;
|
||||
}
|
||||
return `/pages/portal/index?id=${item.peerCardId}`;
|
||||
}
|
||||
|
||||
export function openHallPortal(item: HallContactItem): void {
|
||||
uni.navigateTo({
|
||||
url: buildHallPortalUrl(item),
|
||||
});
|
||||
}
|
||||
|
||||
export async function refreshHall(
|
||||
state: HallState,
|
||||
api?: LoadHallApi
|
||||
): Promise<void> {
|
||||
if (state.loading) {
|
||||
return;
|
||||
}
|
||||
state.loading = true;
|
||||
state.errorMessage = '';
|
||||
const fetchPage =
|
||||
state.tab === 'team'
|
||||
? api != null && api.fetchTeamWallPage != null
|
||||
? api.fetchTeamWallPage
|
||||
: fetchTeamWallPage
|
||||
: api != null
|
||||
? api.fetchHallContactPage
|
||||
: fetchHallContactPage;
|
||||
try {
|
||||
const query: OwnerPageQuery = {
|
||||
page: state.page,
|
||||
size: state.size,
|
||||
};
|
||||
const word = state.keyWord.trim();
|
||||
if (word !== '') {
|
||||
query.keyWord = word;
|
||||
}
|
||||
const data = await fetchPage(query);
|
||||
const raw = data.list != null ? data.list : [];
|
||||
const list: HallContactItem[] = [];
|
||||
for (let i = 0; i < raw.length; i++) {
|
||||
list.push(toHallItem(raw[i]));
|
||||
}
|
||||
state.list = list;
|
||||
state.total =
|
||||
data.pagination != null ? data.pagination.total : list.length;
|
||||
state.empty = list.length === 0;
|
||||
} catch (err) {
|
||||
state.list = [];
|
||||
state.empty = false;
|
||||
state.errorMessage = readErrorMessage(err);
|
||||
}
|
||||
state.loading = false;
|
||||
}
|
||||
|
||||
export async function submitHallExchange(
|
||||
state: HallState,
|
||||
api?: LoadHallApi
|
||||
): Promise<boolean> {
|
||||
const code = state.exchangeCode.trim();
|
||||
if (!/^\d{6}$/.test(code)) {
|
||||
state.errorMessage = resolveHallText('exchangePlaceholder');
|
||||
return false;
|
||||
}
|
||||
const confirm =
|
||||
api != null && api.confirmHallExchange != null
|
||||
? api.confirmHallExchange
|
||||
: confirmHallExchange;
|
||||
try {
|
||||
await confirm(code);
|
||||
state.exchangeCode = '';
|
||||
await refreshHall(state, api);
|
||||
return true;
|
||||
} catch (err) {
|
||||
state.errorMessage = readErrorMessage(err);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function collectPeerCard(
|
||||
peerCardId: string | number,
|
||||
api?: LoadHallApi
|
||||
): Promise<boolean> {
|
||||
const collect =
|
||||
api != null && api.collectHallContact != null
|
||||
? api.collectHallContact
|
||||
: collectHallContact;
|
||||
await collect(peerCardId);
|
||||
return true;
|
||||
}
|
||||
|
||||
export function applyHallTab(state: HallState, tab: HallTab): void {
|
||||
state.tab = tab === 'team' ? 'team' : 'contacts';
|
||||
state.page = 1;
|
||||
state.errorMessage = '';
|
||||
}
|
||||
|
||||
export const PENDING_COLLECT_KEY = 'omni_pending_collect_card';
|
||||
|
||||
export function setPendingCollectCard(cardId: string | number): void {
|
||||
try {
|
||||
uni.setStorageSync(PENDING_COLLECT_KEY, String(cardId));
|
||||
} catch (_e) {}
|
||||
}
|
||||
|
||||
export function consumePendingCollectCard(): string {
|
||||
try {
|
||||
const raw = uni.getStorageSync(PENDING_COLLECT_KEY);
|
||||
uni.removeStorageSync(PENDING_COLLECT_KEY);
|
||||
if (raw == null) {
|
||||
return '';
|
||||
}
|
||||
return String(raw).trim();
|
||||
} catch (_e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户