feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口
补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -64,43 +64,43 @@
|
||||
<view
|
||||
v-if="item.type === 'lead_card' && item.cardPayload != null"
|
||||
class="ai-lead-card"
|
||||
:class="{ 'ai-lead-card-submitted': item.cardPayload.submitted }"
|
||||
:class="{ 'ai-lead-card-submitted': item.cardPayload!.submitted }"
|
||||
>
|
||||
<view class="ai-lead-header">
|
||||
<view class="ai-lead-badge">
|
||||
<text class="ai-lead-badge-text">LEAD</text>
|
||||
</view>
|
||||
<text class="ai-lead-card-title">{{ item.cardPayload.title }}</text>
|
||||
<text class="ai-lead-card-title">{{ item.cardPayload!.title }}</text>
|
||||
</view>
|
||||
<text class="ai-lead-card-desc">{{ item.cardPayload.description }}</text>
|
||||
<text class="ai-lead-card-desc">{{ item.cardPayload!.description }}</text>
|
||||
|
||||
<view v-if="!item.cardPayload.submitted" class="ai-lead-card-form">
|
||||
<view v-if="!item.cardPayload!.submitted" class="ai-lead-card-form">
|
||||
<view class="ai-lead-field">
|
||||
<text class="ai-lead-label">{{ t('nameLabel') }}</text>
|
||||
<input
|
||||
class="ai-lead-input"
|
||||
v-model="item.cardPayload.name"
|
||||
v-model="item.cardPayload!.name"
|
||||
:placeholder="t('namePlaceholder')"
|
||||
:disabled="item.cardPayload.submitting"
|
||||
:disabled="item.cardPayload!.submitting"
|
||||
/>
|
||||
</view>
|
||||
<view class="ai-lead-field">
|
||||
<text class="ai-lead-label">{{ t('contactLabel') }}</text>
|
||||
<input
|
||||
class="ai-lead-input"
|
||||
v-model="item.cardPayload.contact"
|
||||
v-model="item.cardPayload!.contact"
|
||||
:placeholder="t('contactPlaceholder')"
|
||||
:disabled="item.cardPayload.submitting"
|
||||
:disabled="item.cardPayload!.submitting"
|
||||
/>
|
||||
</view>
|
||||
<text v-if="item.cardPayload.errorMessage" class="ai-lead-error">{{ item.cardPayload.errorMessage }}</text>
|
||||
<text v-if="leadCardError(item) !== ''" class="ai-lead-error">{{ leadCardError(item) }}</text>
|
||||
<button
|
||||
class="ai-lead-submit-btn"
|
||||
:class="{ 'ai-lead-submit-btn-disabled': !canSubmitCard(item.cardPayload) || item.cardPayload.submitting }"
|
||||
:disabled="!canSubmitCard(item.cardPayload) || item.cardPayload.submitting"
|
||||
@click="handleSubmitCard(item.cardPayload)"
|
||||
:class="{ 'ai-lead-submit-btn-disabled': !canSubmitCard(item.cardPayload!) || item.cardPayload!.submitting }"
|
||||
:disabled="!canSubmitCard(item.cardPayload!) || item.cardPayload!.submitting"
|
||||
@click="handleSubmitCard(item.cardPayload!)"
|
||||
>
|
||||
<text class="ai-lead-submit-btn-text">{{ cardBtnText(item.cardPayload) }}</text>
|
||||
<text class="ai-lead-submit-btn-text">{{ cardBtnText(item.cardPayload!) }}</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
@@ -172,6 +172,7 @@ import {
|
||||
AiChatCopyKey,
|
||||
AiChatPageOptions,
|
||||
ChatLeadPayload,
|
||||
ChatMessage,
|
||||
} from './useAiChat.uts';
|
||||
|
||||
const pageTheme: Record<string, string> = {
|
||||
@@ -228,6 +229,14 @@ function t(key: AiChatCopyKey): string {
|
||||
return resolveAiChatText(key);
|
||||
}
|
||||
|
||||
function leadCardError(item: ChatMessage): string {
|
||||
if (item.cardPayload == null) {
|
||||
return '';
|
||||
}
|
||||
const message = item.cardPayload.errorMessage;
|
||||
return message != null ? message : '';
|
||||
}
|
||||
|
||||
function canSubmitCard(payload: ChatLeadPayload | null): boolean {
|
||||
if (payload == null) {
|
||||
return false;
|
||||
|
||||
@@ -44,8 +44,9 @@
|
||||
</view>
|
||||
<text class="article-empty-title">{{ emptyTitle }}</text>
|
||||
<text class="article-empty-desc">{{ emptyHint }}</text>
|
||||
<button class="primary-cta-btn article-empty-cta" @click="handleBack">
|
||||
<text class="primary-cta-btn-text">{{ backText }}</text>
|
||||
<!-- 空态返回为描边次按钮,避免与内容态底栏实心主 CTA 并存第二颗实心主按钮 -->
|
||||
<button class="empty-back-btn article-empty-cta" @click="handleBack">
|
||||
<text class="empty-back-btn-text">{{ backText }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -149,7 +150,7 @@ import {
|
||||
createArticleDetailState,
|
||||
applyArticleDetailOptions,
|
||||
loadArticleDetail,
|
||||
copyArticleShareLink,
|
||||
performArticleShareAction,
|
||||
goBackFromArticle,
|
||||
resolveArticleDetailText,
|
||||
getCurrentPageUrl,
|
||||
@@ -277,7 +278,9 @@ function handleScroll(e: ScrollCustomEvent): void {
|
||||
}
|
||||
|
||||
async function handleCopy(): Promise<void> {
|
||||
copyArticleShareLink(state, getCurrentPageUrl(state));
|
||||
// 有系统分享 API 时走 shareArticleViaSystem(仅 success 提示 shareSuccess);
|
||||
// 否则 P22 复制链接(成功提示直链已复制)。失败/取消不提示 shareSuccess。
|
||||
await performArticleShareAction(state, getCurrentPageUrl(state));
|
||||
}
|
||||
|
||||
function handleBack(): void {
|
||||
@@ -526,6 +529,32 @@ onUnload(() => {
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.empty-back-btn {
|
||||
height: 44px;
|
||||
min-height: 44px;
|
||||
width: 100%;
|
||||
max-width: 200px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: var(--oc-border, #EBF1F7);
|
||||
border-radius: var(--oc-radius-btn, 14px);
|
||||
background-color: var(--oc-surface, #FFFFFF);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.empty-back-btn:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.empty-back-btn-text {
|
||||
color: var(--oc-text, #101828);
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* 滚动容器 */
|
||||
.article-scroll {
|
||||
flex: 1;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<view class="case-header-card">
|
||||
<view class="case-badge-pill">
|
||||
<view class="case-badge-dot"></view>
|
||||
<text class="case-badge-text">{{ t('badge') }}</text>
|
||||
<text class="case-badge-text">{{ headerBadgeText }}</text>
|
||||
</view>
|
||||
<text class="case-title">{{ state.title }}</text>
|
||||
|
||||
@@ -58,8 +58,19 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 2. 多图画廊轮播 / 单图视觉展台 -->
|
||||
<view v-if="state.images.length > 0" class="gallery-wrapper">
|
||||
<!-- 2. 原生视频播放器展台 (若配置视频直链) -->
|
||||
<view v-if="state.videoUrl !== ''" class="case-video-wrapper">
|
||||
<video
|
||||
class="case-video-player"
|
||||
:src="state.videoUrl"
|
||||
:poster="state.images.length > 0 ? state.images[0] : ''"
|
||||
:controls="true"
|
||||
preload="metadata"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 3. 多图画廊轮播 / 单图视觉展台 (无视频时或图集展示) -->
|
||||
<view v-if="state.images.length > 0 && state.videoUrl === ''" class="gallery-wrapper">
|
||||
<swiper
|
||||
v-if="state.images.length > 1"
|
||||
class="case-swiper"
|
||||
@@ -142,40 +153,34 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="resource-list">
|
||||
<!-- PDF 白皮书外链行 -->
|
||||
<!-- PDF 白皮书:有 url 才渲染可点行,不露裸 URL -->
|
||||
<view
|
||||
v-if="state.pdfUrl !== ''"
|
||||
class="ext-link-row"
|
||||
@click="handleCopyLink(state.pdfUrl)"
|
||||
@click="handleOpenLink(state.pdfUrl)"
|
||||
>
|
||||
<view class="ext-link-main">
|
||||
<view class="ext-badge ext-badge-pdf">
|
||||
<text class="ext-badge-text">{{ t('pdf') }}</text>
|
||||
</view>
|
||||
<view class="ext-info">
|
||||
<text class="ext-link-action">{{ t('pdfAction') }}</text>
|
||||
<text class="ext-link-url">{{ state.pdfUrl }}</text>
|
||||
</view>
|
||||
<text class="ext-link-action">{{ t('pdfAction') }}</text>
|
||||
</view>
|
||||
<view class="ext-arrow-box">
|
||||
<text class="ext-arrow-icon">↗</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 演示视频外链行 -->
|
||||
<!-- YouTube/Vimeo:有 url 才渲染可点行,不露裸 URL -->
|
||||
<view
|
||||
v-if="state.youtubeUrl !== ''"
|
||||
class="ext-link-row"
|
||||
@click="handleCopyLink(state.youtubeUrl)"
|
||||
@click="handleOpenLink(state.youtubeUrl)"
|
||||
>
|
||||
<view class="ext-link-main">
|
||||
<view class="ext-badge ext-badge-video">
|
||||
<text class="ext-badge-text">{{ t('youtube') }}</text>
|
||||
</view>
|
||||
<view class="ext-info">
|
||||
<text class="ext-link-action">{{ t('videoAction') }}</text>
|
||||
<text class="ext-link-url">{{ state.youtubeUrl }}</text>
|
||||
</view>
|
||||
<text class="ext-link-action">{{ t('videoAction') }}</text>
|
||||
</view>
|
||||
<view class="ext-arrow-box">
|
||||
<text class="ext-arrow-icon">↗</text>
|
||||
@@ -209,7 +214,7 @@ import {
|
||||
loadCaseDetail,
|
||||
openCaseExchange,
|
||||
goCaseBack,
|
||||
copyCaseExternalLink,
|
||||
openCaseExternalLink,
|
||||
resolveCaseDetailText,
|
||||
CaseDetailPageOptions,
|
||||
} from './useCaseDetail.uts';
|
||||
@@ -251,6 +256,10 @@ const pageRtlClass = computed((): string => {
|
||||
return isRtl(getCurrentLocale()) ? 'case-rtl' : '';
|
||||
});
|
||||
|
||||
const headerBadgeText = computed((): string => {
|
||||
return state.blockType === 'video' ? t('videoBadge') : t('badge');
|
||||
});
|
||||
|
||||
const hasMetaTags = computed((): boolean => {
|
||||
return (
|
||||
(state.client != null && state.client !== '') ||
|
||||
@@ -283,8 +292,8 @@ function handleBack(): void {
|
||||
goCaseBack();
|
||||
}
|
||||
|
||||
function handleCopyLink(url: string): void {
|
||||
copyCaseExternalLink(url);
|
||||
function handleOpenLink(url: string): void {
|
||||
openCaseExternalLink(url);
|
||||
}
|
||||
|
||||
onLoad((options: CaseDetailPageOptions) => {
|
||||
@@ -428,6 +437,23 @@ onLoad((options: CaseDetailPageOptions) => {
|
||||
color: var(--oc-text, #101828);
|
||||
}
|
||||
|
||||
/* 原生视频演示展台 */
|
||||
.case-video-wrapper {
|
||||
margin-block-end: var(--oc-space-16, 16px);
|
||||
border-radius: var(--oc-radius-card, 20px);
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--oc-border, #EBF1F7);
|
||||
box-shadow: var(--oc-shadow-card, 0 8px 30px rgba(0, 0, 0, 0.04));
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
.case-video-player {
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
display: block;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
/* 2. 多图画廊展台 */
|
||||
.gallery-wrapper {
|
||||
margin-block-end: var(--oc-space-16, 16px);
|
||||
@@ -564,7 +590,8 @@ onLoad((options: CaseDetailPageOptions) => {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 52px;
|
||||
min-height: 44px;
|
||||
height: 48px;
|
||||
background-color: var(--oc-bg, #F5F8FC);
|
||||
border: 1px solid var(--oc-border, #EBF1F7);
|
||||
border-radius: var(--oc-radius-btn, 14px);
|
||||
@@ -615,23 +642,11 @@ onLoad((options: CaseDetailPageOptions) => {
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.ext-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ext-link-action {
|
||||
font-size: 13px;
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--oc-text, #101828);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.ext-link-url {
|
||||
font-size: 11px;
|
||||
color: var(--oc-text-2, #64748B);
|
||||
color: var(--oc-primary, #0088FF);
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@@ -262,6 +262,7 @@ import {
|
||||
createExchangeState,
|
||||
applyExchangeOptions,
|
||||
submitExchange,
|
||||
isExchangeSubmitSuccess,
|
||||
resolveExchangeText,
|
||||
ExchangePageOptions,
|
||||
} from './useExchange.uts';
|
||||
@@ -396,7 +397,8 @@ async function handleSubmit(): Promise<void> {
|
||||
const nameCache = state.form.name;
|
||||
const contactCache = state.form.phone !== '' ? state.form.phone : state.form.email;
|
||||
const lead = await submitExchange(state);
|
||||
if (lead != null) {
|
||||
// 仅接口明确成功(含 persisted===true 或有效落库 id)才展示完成态
|
||||
if (isExchangeSubmitSuccess(lead)) {
|
||||
submittedName.value = nameCache;
|
||||
submittedContact.value = contactCache;
|
||||
submitSuccess.value = true;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 顶部受控局部极光微光晕 (面积 < 8%) -->
|
||||
<view class="ambient-aurora-glow"></view>
|
||||
|
||||
<!-- 顶栏:返回按钮、名片主预览微标签、多语言与主客态操作 -->
|
||||
<!-- 顶栏:返回/预览在左;语言切换常驻右上,不进二级菜单 -->
|
||||
<view class="locale-bar portal-top-bar">
|
||||
<view class="top-bar-left">
|
||||
<view
|
||||
@@ -18,17 +18,19 @@
|
||||
<view class="preview-dot"></view>
|
||||
<text class="preview-badge-text">{{ previewModeLabel }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="top-bar-left">
|
||||
<view class="locale-exchange-wrap" @click="handleHeaderAction">
|
||||
<text class="locale-exchange-link">{{ headerLinkText }}</text>
|
||||
<text class="locale-exchange-arrow">↗</text>
|
||||
</view>
|
||||
<view class="locale-selector-container">
|
||||
<i18n-selector :model-value="currentLang" @change="switchLang" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="locale-exchange-wrap" @click="handleHeaderAction">
|
||||
<text class="locale-exchange-link">{{ headerLinkText }}</text>
|
||||
<text class="locale-exchange-arrow">↗</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="portal-scroll" :scroll-y="true">
|
||||
<scroll-view class="portal-scroll" :scroll-y="true" @scroll="handlePortalScroll">
|
||||
<!-- 骨架加载态 -->
|
||||
<view v-if="state.loading" class="portal-skeleton">
|
||||
<view class="skeleton-hero">
|
||||
@@ -108,53 +110,67 @@
|
||||
<!-- 2. 快捷动作条 (触控区 >= 44x44,无链接不渲染) -->
|
||||
<view v-if="hasAnyQuickAction" class="quick-action-bar">
|
||||
<view v-if="hasQuickAction('whatsapp')" class="action-item" @click="handleAction('whatsapp')">
|
||||
<view class="action-icon-box">
|
||||
<text class="action-icon-text">WA</text>
|
||||
<view class="action-icon-box action-icon-whatsapp">
|
||||
<image class="action-icon-img" src="/static/icons/whatsapp.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.whatsapp') }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="hasQuickAction('linkedin')" class="action-item" @click="handleAction('linkedin')">
|
||||
<view class="action-icon-box">
|
||||
<text class="action-icon-text">IN</text>
|
||||
<view class="action-icon-box action-icon-linkedin">
|
||||
<image class="action-icon-img" src="/static/icons/linkedin.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.linkedin') }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="hasQuickAction('email')" class="action-item" @click="handleAction('email')">
|
||||
<view class="action-icon-box">
|
||||
<text class="action-icon-text">@</text>
|
||||
<view class="action-icon-box action-icon-email">
|
||||
<image class="action-icon-img" src="/static/icons/email.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.email') }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="hasQuickAction('phone')" class="action-item" @click="handleAction('phone')">
|
||||
<view class="action-icon-box">
|
||||
<text class="action-icon-text">TEL</text>
|
||||
<view class="action-icon-box action-icon-phone">
|
||||
<image class="action-icon-img" src="/static/icons/phone.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.phone') }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="hasQuickAction('telegram')" class="action-item" @click="handleAction('telegram')">
|
||||
<view class="action-icon-box">
|
||||
<text class="action-icon-text">TG</text>
|
||||
<view class="action-icon-box action-icon-telegram">
|
||||
<image class="action-icon-img" src="/static/icons/telegram.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.telegram') }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="hasQuickAction('twitter')" class="action-item" @click="handleAction('twitter')">
|
||||
<view class="action-icon-box">
|
||||
<text class="action-icon-text">X</text>
|
||||
<view class="action-icon-box action-icon-twitter">
|
||||
<image class="action-icon-img" src="/static/icons/twitter.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.twitter') }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="hasQuickAction('wechat')" class="action-item" @click="handleAction('wechat')">
|
||||
<view class="action-icon-box">
|
||||
<text class="action-icon-text">WX</text>
|
||||
<view class="action-icon-box action-icon-wechat">
|
||||
<image class="action-icon-img" src="/static/icons/wechat.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.wechat') }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="hasQuickAction('line')" class="action-item" @click="handleAction('line')">
|
||||
<view class="action-icon-box action-icon-line">
|
||||
<image class="action-icon-img" src="/static/icons/line.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.line') }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="hasQuickAction('kakao')" class="action-item" @click="handleAction('kakao')">
|
||||
<view class="action-icon-box action-icon-kakao">
|
||||
<image class="action-icon-img" src="/static/icons/kakao.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="action-item-label">{{ textOf('portal.kakao') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 3. Bento Grid 网格展厅 -->
|
||||
@@ -235,6 +251,19 @@
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- Cookie 同意条:无本地同意记录时仅显示一条 -->
|
||||
<view v-if="showCookieBanner" class="cookie-consent-bar" :class="pageRtlClass">
|
||||
<text class="cookie-consent-text">{{ textOf('portal.cookie_notice') }}</text>
|
||||
<view class="cookie-consent-actions">
|
||||
<view class="cookie-consent-reject" role="button" @click="rejectCookieConsent">
|
||||
<text class="cookie-consent-reject-text">{{ textOf('portal.cookie_reject') }}</text>
|
||||
</view>
|
||||
<view class="cookie-consent-accept" role="button" @click="acceptCookieConsent">
|
||||
<text class="cookie-consent-accept-text">{{ textOf('portal.cookie_accept') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 6. 商务预约与需求提报抽屉 (Bottom Sheet) -->
|
||||
<view v-if="isAppointmentSheetOpen" class="appointment-sheet-mask" @click="closeAppointmentSheet">
|
||||
<view class="appointment-sheet" :class="pageRtlClass" @click.stop>
|
||||
@@ -362,12 +391,14 @@
|
||||
<script setup lang="uts">
|
||||
import {
|
||||
BentoBlockPublic,
|
||||
CardPortalDetail,
|
||||
CardProfile,
|
||||
} from '../../common/types.uts';
|
||||
import {
|
||||
createPortalState,
|
||||
loadCardPortal,
|
||||
reportPortalStay,
|
||||
updatePortalScrollDepth,
|
||||
toggleAudioPronunciation,
|
||||
triggerQuickAction,
|
||||
getBentoColSpanClass,
|
||||
@@ -383,6 +414,7 @@ import {
|
||||
executePortalGoBack,
|
||||
trackAppointmentAction,
|
||||
PortalQuickAction,
|
||||
isRenderableHttpUrl,
|
||||
} from './usePortal.uts';
|
||||
import { saveToContacts } from '../../common/vcard-export.uts';
|
||||
import { collectHallContact, submitLead } from '../../common/api.uts';
|
||||
@@ -433,6 +465,8 @@ const pageTheme: Record<string, string> = {
|
||||
};
|
||||
|
||||
const defaultAvatar = 'https://cdn.omnicard.ai/assets/default-avatar.png';
|
||||
const COOKIE_CONSENT_KEY = 'omni_cookie_consent';
|
||||
const COOKIE_CONSENT_ACCEPTED = 'accepted';
|
||||
|
||||
type PortalPageQuery = {
|
||||
id?: string;
|
||||
@@ -447,6 +481,40 @@ const state = reactive(createPortalState());
|
||||
const currentCardId = ref('');
|
||||
const currentMode = ref('');
|
||||
const currentLang = ref<OmniLocale>(detectLocale());
|
||||
const showCookieBanner = ref(false);
|
||||
|
||||
function readCookieConsentRaw(): string {
|
||||
try {
|
||||
const raw = uni.getStorageSync(COOKIE_CONSENT_KEY);
|
||||
if (raw == null) {
|
||||
return '';
|
||||
}
|
||||
return String(raw);
|
||||
} catch (_e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function hasCookieConsentRecord(): boolean {
|
||||
return readCookieConsentRaw() === COOKIE_CONSENT_ACCEPTED;
|
||||
}
|
||||
|
||||
function initCookieBanner(): void {
|
||||
// 无同意记录时显示;有 accepted 记录才视为已同意,绝不假装已同意
|
||||
showCookieBanner.value = !hasCookieConsentRecord();
|
||||
}
|
||||
|
||||
function acceptCookieConsent(): void {
|
||||
try {
|
||||
uni.setStorageSync(COOKIE_CONSENT_KEY, COOKIE_CONSENT_ACCEPTED);
|
||||
} catch (_e) {}
|
||||
showCookieBanner.value = false;
|
||||
}
|
||||
|
||||
function rejectCookieConsent(): void {
|
||||
// 拒绝:不写入同意记录,不把拒绝当成已同意;仅收起当前会话条
|
||||
showCookieBanner.value = false;
|
||||
}
|
||||
|
||||
const isOwner = computed((): boolean => {
|
||||
return checkIsCardOwner({
|
||||
@@ -538,6 +606,11 @@ function getBlockTypeLabel(type: string): string {
|
||||
return textOf('portal.block');
|
||||
}
|
||||
|
||||
type PortalCardSocialExtra = CardPortalDetail & {
|
||||
line?: string;
|
||||
kakao?: string;
|
||||
};
|
||||
|
||||
function readQuickActionValue(type: PortalQuickAction): string {
|
||||
if (state.card == null) {
|
||||
return '';
|
||||
@@ -563,11 +636,27 @@ function readQuickActionValue(type: PortalQuickAction): string {
|
||||
if (type === 'wechat') {
|
||||
return state.card!.wechat || '';
|
||||
}
|
||||
if (type === 'line') {
|
||||
const extra = state.card! as PortalCardSocialExtra;
|
||||
return extra.line != null ? extra.line : '';
|
||||
}
|
||||
if (type === 'kakao') {
|
||||
const extra = state.card! as PortalCardSocialExtra;
|
||||
return extra.kakao != null ? extra.kakao : '';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function hasQuickAction(type: PortalQuickAction): boolean {
|
||||
return readQuickActionValue(type).trim() !== '';
|
||||
const raw = readQuickActionValue(type).trim();
|
||||
if (raw === '') {
|
||||
return false;
|
||||
}
|
||||
// Line / KakaoTalk:空、缺失或非 http(s) 均不渲染(P35 空社交不渲染)
|
||||
if (type === 'line' || type === 'kakao') {
|
||||
return isRenderableHttpUrl(raw);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const hasAnyQuickAction = computed((): boolean => {
|
||||
@@ -578,7 +667,9 @@ const hasAnyQuickAction = computed((): boolean => {
|
||||
hasQuickAction('phone') ||
|
||||
hasQuickAction('telegram') ||
|
||||
hasQuickAction('twitter') ||
|
||||
hasQuickAction('wechat')
|
||||
hasQuickAction('wechat') ||
|
||||
hasQuickAction('line') ||
|
||||
hasQuickAction('kakao')
|
||||
);
|
||||
});
|
||||
|
||||
@@ -789,7 +880,7 @@ async function submitAppointmentForm(): Promise<void> {
|
||||
function handleBlockClick(block: BentoBlockPublic): void {
|
||||
const blockId = block.id != null ? String(block.id) : '';
|
||||
const cardQuery = currentCardId.value;
|
||||
if (block.type === 'case') {
|
||||
if (block.type === 'case' || block.type === 'video') {
|
||||
uni.navigateTo({
|
||||
url: `/pages/portal/case-detail?cardId=${cardQuery}&blockId=${blockId}`,
|
||||
});
|
||||
@@ -854,6 +945,7 @@ onLoad((options: PortalPageQuery) => {
|
||||
const queryMode = (options && options.mode) ? String(options.mode) : '';
|
||||
currentCardId.value = queryId;
|
||||
currentMode.value = queryMode;
|
||||
initCookieBanner();
|
||||
const stored = readStoredPortalLocale();
|
||||
applyResolvedLocale(resolvePortalLocale(queryLang, stored, '', detectLocale()));
|
||||
loadCardPortal(state, queryId, querySource).then((cardData) => {
|
||||
@@ -862,8 +954,23 @@ onLoad((options: PortalPageQuery) => {
|
||||
});
|
||||
});
|
||||
|
||||
type PortalScrollDetail = {
|
||||
scrollTop: number;
|
||||
scrollHeight: number;
|
||||
};
|
||||
|
||||
type PortalScrollEvent = {
|
||||
detail: PortalScrollDetail | null;
|
||||
};
|
||||
|
||||
function handlePortalScroll(e: PortalScrollEvent): void {
|
||||
if (e != null && e.detail != null) {
|
||||
updatePortalScrollDepth(state, e.detail.scrollTop, e.detail.scrollHeight, 667);
|
||||
}
|
||||
}
|
||||
|
||||
onUnload(() => {
|
||||
reportPortalStay(state, 100);
|
||||
reportPortalStay(state, state.scrollDepth);
|
||||
releaseAudioPlayer();
|
||||
});
|
||||
</script>
|
||||
@@ -1294,15 +1401,46 @@ onUnload(() => {
|
||||
opacity: 0.85;
|
||||
}
|
||||
.action-icon-box {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 8px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 9px;
|
||||
background-color: var(--oc-primary-soft, #EBF5FF);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-block-end: 4px;
|
||||
}
|
||||
.action-icon-img {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
.action-icon-whatsapp {
|
||||
background-color: #E8F9EE;
|
||||
}
|
||||
.action-icon-linkedin {
|
||||
background-color: #E6F0FA;
|
||||
}
|
||||
.action-icon-email {
|
||||
background-color: #EBF5FF;
|
||||
}
|
||||
.action-icon-phone {
|
||||
background-color: #E6F8EF;
|
||||
}
|
||||
.action-icon-telegram {
|
||||
background-color: #E6F5FC;
|
||||
}
|
||||
.action-icon-twitter {
|
||||
background-color: #F2F4F7;
|
||||
}
|
||||
.action-icon-wechat {
|
||||
background-color: #E6F8EE;
|
||||
}
|
||||
.action-icon-line {
|
||||
background-color: #E6F8EE;
|
||||
}
|
||||
.action-icon-kakao {
|
||||
background-color: #FFFBE6;
|
||||
}
|
||||
.action-icon-text {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
@@ -1474,6 +1612,67 @@ onUnload(() => {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* Cookie 同意条 */
|
||||
.cookie-consent-bar {
|
||||
position: fixed;
|
||||
left: 16px;
|
||||
right: 16px;
|
||||
bottom: calc(72px + var(--window-bottom, 0px) + env(safe-area-inset-bottom, 0px));
|
||||
z-index: 120;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 14px 16px;
|
||||
background-color: rgba(255, 255, 255, 0.98);
|
||||
border: 1px solid var(--oc-border, #EBF1F7);
|
||||
border-radius: var(--oc-radius-card, 20px);
|
||||
box-shadow: var(--oc-shadow-float, 0 12px 36px rgba(16, 24, 40, 0.08));
|
||||
}
|
||||
.cookie-consent-text {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
color: var(--oc-text-2, #64748B);
|
||||
}
|
||||
.cookie-consent-actions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.cookie-consent-reject {
|
||||
min-height: 40px;
|
||||
padding: 0 14px;
|
||||
border-radius: var(--oc-radius-pill, 9999px);
|
||||
border: 1px solid var(--oc-border, #EBF1F7);
|
||||
background-color: var(--oc-bg, #F5F8FC);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.cookie-consent-reject-text {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--oc-text-2, #64748B);
|
||||
}
|
||||
.cookie-consent-accept {
|
||||
min-height: 40px;
|
||||
padding: 0 16px;
|
||||
border-radius: var(--oc-radius-pill, 9999px);
|
||||
background: var(--oc-primary-gradient, linear-gradient(135deg, #00A3FF 0%, #0B63E5 100%));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
box-shadow: var(--oc-shadow-cta, 0 8px 20px rgba(0, 136, 255, 0.22));
|
||||
}
|
||||
.cookie-consent-accept-text {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* 6. 商务预约排期卡片与抽屉样式 (Bento Grid Appointment & Bottom Sheet) */
|
||||
.appointment-card {
|
||||
background: linear-gradient(135deg, #FFFFFF 0%, #F5F9FF 100%);
|
||||
|
||||
@@ -52,7 +52,6 @@ export type ArticleDetailState = {
|
||||
visitorId: string;
|
||||
};
|
||||
|
||||
const SHARE_CTA_LABEL = '复制链接';
|
||||
const BACK_LABEL = '返回';
|
||||
const OG_DESC_MAX = 160;
|
||||
const VISITOR_STORAGE_KEY = 'omni_visitor_id';
|
||||
@@ -227,7 +226,10 @@ type UniStackPage = {
|
||||
*/
|
||||
export function getCurrentPageUrl(state: ArticleDetailState): string {
|
||||
try {
|
||||
const pages = uni.getCurrentPages();
|
||||
if (typeof getCurrentPages !== 'function') {
|
||||
return buildArticlePagePath(state.cardId, state.blockId);
|
||||
}
|
||||
const pages = getCurrentPages();
|
||||
if (pages != null && pages.length > 0) {
|
||||
const page = pages[pages.length - 1] as UniStackPage;
|
||||
const route = page != null && page.route != null ? String(page.route) : '';
|
||||
@@ -250,7 +252,7 @@ export function getArticleShareFields(
|
||||
): ArticleShareFields {
|
||||
const og = state.openGraph;
|
||||
return {
|
||||
ctaLabel: SHARE_CTA_LABEL,
|
||||
ctaLabel: resolveArticleDetailText('shareCta'),
|
||||
copiedToast: getOmniText(getCurrentLocale(), 'portal.copied_link'),
|
||||
shareUrl: resolveShareUrl(state.linkUrl, pageUrl),
|
||||
title: og.title,
|
||||
@@ -270,6 +272,9 @@ export function getArticleEmptyMessage(): string {
|
||||
export type ArticleDetailTextKey =
|
||||
| 'kicker'
|
||||
| 'shareCta'
|
||||
| 'shareSuccess'
|
||||
| 'shareFailed'
|
||||
| 'copyFailed'
|
||||
| 'back'
|
||||
| 'empty'
|
||||
| 'emptyHint'
|
||||
@@ -313,6 +318,15 @@ export function resolveArticleDetailText(
|
||||
if (key === 'shareCta') {
|
||||
return '复制分享链接';
|
||||
}
|
||||
if (key === 'shareSuccess') {
|
||||
return '已分享';
|
||||
}
|
||||
if (key === 'shareFailed') {
|
||||
return '分享失败';
|
||||
}
|
||||
if (key === 'copyFailed') {
|
||||
return '复制失败';
|
||||
}
|
||||
if (key === 'back') {
|
||||
return '返回';
|
||||
}
|
||||
@@ -341,6 +355,15 @@ export function resolveArticleDetailText(
|
||||
if (key === 'shareCta') {
|
||||
return 'نسخ رابط المشاركة';
|
||||
}
|
||||
if (key === 'shareSuccess') {
|
||||
return 'تمت المشاركة';
|
||||
}
|
||||
if (key === 'shareFailed') {
|
||||
return 'فشلت المشاركة';
|
||||
}
|
||||
if (key === 'copyFailed') {
|
||||
return 'فشل النسخ';
|
||||
}
|
||||
if (key === 'back') {
|
||||
return 'رجوع';
|
||||
}
|
||||
@@ -369,6 +392,15 @@ export function resolveArticleDetailText(
|
||||
if (key === 'shareCta') {
|
||||
return 'Copiar enlace para compartir';
|
||||
}
|
||||
if (key === 'shareSuccess') {
|
||||
return 'Compartido';
|
||||
}
|
||||
if (key === 'shareFailed') {
|
||||
return 'Error al compartir';
|
||||
}
|
||||
if (key === 'copyFailed') {
|
||||
return 'Error al copiar';
|
||||
}
|
||||
if (key === 'back') {
|
||||
return 'Volver';
|
||||
}
|
||||
@@ -397,6 +429,15 @@ export function resolveArticleDetailText(
|
||||
if (key === 'shareCta') {
|
||||
return 'Freigabelink kopieren';
|
||||
}
|
||||
if (key === 'shareSuccess') {
|
||||
return 'Geteilt';
|
||||
}
|
||||
if (key === 'shareFailed') {
|
||||
return 'Teilen fehlgeschlagen';
|
||||
}
|
||||
if (key === 'copyFailed') {
|
||||
return 'Kopieren fehlgeschlagen';
|
||||
}
|
||||
if (key === 'back') {
|
||||
return 'Zurück';
|
||||
}
|
||||
@@ -425,6 +466,15 @@ export function resolveArticleDetailText(
|
||||
if (key === 'shareCta') {
|
||||
return 'Copier le lien de partage';
|
||||
}
|
||||
if (key === 'shareSuccess') {
|
||||
return 'Partagé';
|
||||
}
|
||||
if (key === 'shareFailed') {
|
||||
return 'Échec du partage';
|
||||
}
|
||||
if (key === 'copyFailed') {
|
||||
return 'Échec de la copie';
|
||||
}
|
||||
if (key === 'back') {
|
||||
return 'Retour';
|
||||
}
|
||||
@@ -453,6 +503,15 @@ export function resolveArticleDetailText(
|
||||
if (key === 'shareCta') {
|
||||
return '共有リンクをコピー';
|
||||
}
|
||||
if (key === 'shareSuccess') {
|
||||
return '共有しました';
|
||||
}
|
||||
if (key === 'shareFailed') {
|
||||
return '共有に失敗しました';
|
||||
}
|
||||
if (key === 'copyFailed') {
|
||||
return 'コピーに失敗しました';
|
||||
}
|
||||
if (key === 'back') {
|
||||
return '戻る';
|
||||
}
|
||||
@@ -480,6 +539,15 @@ export function resolveArticleDetailText(
|
||||
if (key === 'shareCta') {
|
||||
return 'Copy share link';
|
||||
}
|
||||
if (key === 'shareSuccess') {
|
||||
return 'Shared';
|
||||
}
|
||||
if (key === 'shareFailed') {
|
||||
return 'Share failed';
|
||||
}
|
||||
if (key === 'copyFailed') {
|
||||
return 'Copy failed';
|
||||
}
|
||||
if (key === 'back') {
|
||||
return 'Back';
|
||||
}
|
||||
@@ -641,11 +709,80 @@ export function navToAuthorPortal(state: ArticleDetailState): void {
|
||||
});
|
||||
}
|
||||
|
||||
type ShareWithSystemOption = {
|
||||
type?: string;
|
||||
summary?: string;
|
||||
href?: string;
|
||||
success?: () => void;
|
||||
fail?: (err: { errCode?: number; errMsg?: string } | null) => void;
|
||||
};
|
||||
|
||||
type UniWithSystemShare = {
|
||||
shareWithSystem?: (options: ShareWithSystemOption) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* 主 CTA:复制 linkUrl 或当前页 URL
|
||||
* 是否具备系统分享 API(uni.shareWithSystem)
|
||||
*/
|
||||
export function hasArticleSystemShare(): boolean {
|
||||
const uniShare = uni as UniWithSystemShare;
|
||||
return uniShare.shareWithSystem != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统分享:仅 uni.shareWithSystem 明确 success 才提示「已分享」;
|
||||
* 失败 / 用户取消不得提示已分享。
|
||||
*/
|
||||
export function shareArticleViaSystem(
|
||||
state: ArticleDetailState,
|
||||
pageUrl?: string
|
||||
): Promise<boolean> {
|
||||
const fallback = pageUrl != null ? pageUrl : getCurrentPageUrl(state);
|
||||
const shareUrl = resolveShareUrl(state.linkUrl, fallback);
|
||||
if (shareUrl === '') {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
const uniShare = uni as UniWithSystemShare;
|
||||
if (uniShare.shareWithSystem == null) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
const summary = state.title !== '' ? state.title : shareUrl;
|
||||
|
||||
return new Promise<boolean>(resolve => {
|
||||
uniShare.shareWithSystem!({
|
||||
type: 'text',
|
||||
summary: summary,
|
||||
href: shareUrl,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: resolveArticleDetailText('shareSuccess'),
|
||||
icon: 'none',
|
||||
});
|
||||
resolve(true);
|
||||
},
|
||||
fail: (err: { errCode?: number; errMsg?: string } | null) => {
|
||||
// 取消(1310600)静默;其它失败只提示 shareFailed
|
||||
const code = err != null && err.errCode != null ? err.errCode : 0;
|
||||
if (code !== 1310600) {
|
||||
uni.showToast({
|
||||
title: resolveArticleDetailText('shareFailed'),
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
resolve(false);
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 主 CTA:复制 linkUrl 或当前页 URL。
|
||||
* 仅剪贴板 success 才提示直链已复制(P22);失败只提示 copyFailed。
|
||||
*/
|
||||
export function copyArticleShareLink(state: ArticleDetailState, pageUrl?: string): boolean {
|
||||
const fallback = pageUrl != null && pageUrl !== '' ? pageUrl : getCurrentPageUrl(state);
|
||||
const fallback = pageUrl != null ? pageUrl : getCurrentPageUrl(state);
|
||||
const shareUrl = resolveShareUrl(state.linkUrl, fallback);
|
||||
if (shareUrl === '') {
|
||||
return false;
|
||||
@@ -659,10 +796,30 @@ export function copyArticleShareLink(state: ArticleDetailState, pageUrl?: string
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: resolveArticleDetailText('copyFailed'),
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 底栏主动作:有系统分享则走系统分享;否则回退复制链接。
|
||||
* 分享失败/取消不回退复制,避免把失败伪装成已分享或已复制。
|
||||
*/
|
||||
export async function performArticleShareAction(
|
||||
state: ArticleDetailState,
|
||||
pageUrl?: string
|
||||
): Promise<boolean> {
|
||||
if (hasArticleSystemShare()) {
|
||||
return await shareArticleViaSystem(state, pageUrl);
|
||||
}
|
||||
return copyArticleShareLink(state, pageUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 空状态返回:优先回退上一页
|
||||
*/
|
||||
|
||||
@@ -27,6 +27,9 @@ export type CaseMetaRecord = {
|
||||
pdf?: string;
|
||||
youtubeUrl?: string;
|
||||
youtube?: string;
|
||||
videoUrl?: string;
|
||||
video?: string;
|
||||
poster?: string;
|
||||
url?: string;
|
||||
type?: string;
|
||||
client?: string;
|
||||
@@ -48,6 +51,8 @@ export type CaseDetailState = {
|
||||
kpis: CaseKpi[];
|
||||
pdfUrl: string;
|
||||
youtubeUrl: string;
|
||||
videoUrl: string;
|
||||
blockType: string;
|
||||
client?: string;
|
||||
industry?: string;
|
||||
region?: string;
|
||||
@@ -70,6 +75,7 @@ export type CaseDetailCopyKey =
|
||||
| 'youtube'
|
||||
| 'loading'
|
||||
| 'badge'
|
||||
| 'videoBadge'
|
||||
| 'overview'
|
||||
| 'challenge'
|
||||
| 'solution'
|
||||
@@ -87,16 +93,17 @@ export const CASE_DETAIL_COPY: Record<CaseDetailCopyKey, string> = {
|
||||
back: '返回',
|
||||
cta: '咨询',
|
||||
pdf: 'PDF',
|
||||
youtube: 'YouTube',
|
||||
youtube: '视频',
|
||||
loading: '加载中',
|
||||
badge: '标杆商务实践',
|
||||
videoBadge: '视频演示实况',
|
||||
overview: '案例详情与方案',
|
||||
challenge: '业务挑战与背景',
|
||||
solution: '落地解决方案',
|
||||
kpis: '核心商业化成果',
|
||||
resources: '项目资料与演示',
|
||||
pdfAction: '复制白皮书链接',
|
||||
videoAction: '复制演示视频链接',
|
||||
pdfAction: '打开白皮书',
|
||||
videoAction: '观看演示视频',
|
||||
clientLabel: '标杆客户',
|
||||
industryLabel: '行业赛道',
|
||||
regionLabel: '业务覆盖区域',
|
||||
@@ -131,6 +138,9 @@ export function resolveCaseDetailText(key: CaseDetailCopyKey): string {
|
||||
if (key === 'badge') {
|
||||
return zh ? CASE_DETAIL_COPY.badge : 'GLOBAL CASE STUDY';
|
||||
}
|
||||
if (key === 'videoBadge') {
|
||||
return zh ? CASE_DETAIL_COPY.videoBadge : 'FEATURED VIDEO DEMO';
|
||||
}
|
||||
if (key === 'overview') {
|
||||
return zh ? CASE_DETAIL_COPY.overview : 'Case Overview';
|
||||
}
|
||||
@@ -147,10 +157,16 @@ export function resolveCaseDetailText(key: CaseDetailCopyKey): string {
|
||||
return zh ? CASE_DETAIL_COPY.resources : 'Project Resources';
|
||||
}
|
||||
if (key === 'pdfAction') {
|
||||
return zh ? CASE_DETAIL_COPY.pdfAction : 'Copy Document Link';
|
||||
return zh ? CASE_DETAIL_COPY.pdfAction : 'Open whitepaper';
|
||||
}
|
||||
if (key === 'videoAction') {
|
||||
return zh ? CASE_DETAIL_COPY.videoAction : 'Copy Video Link';
|
||||
return zh ? CASE_DETAIL_COPY.videoAction : 'Watch demo video';
|
||||
}
|
||||
if (key === 'pdf') {
|
||||
return 'PDF';
|
||||
}
|
||||
if (key === 'youtube') {
|
||||
return zh ? '视频' : 'Video';
|
||||
}
|
||||
if (key === 'clientLabel') {
|
||||
return zh ? CASE_DETAIL_COPY.clientLabel : 'Client';
|
||||
@@ -165,23 +181,41 @@ export function resolveCaseDetailText(key: CaseDetailCopyKey): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* 外链无 open 能力时只复制,不发起新请求
|
||||
* 打开案例外链:优先 window.open(对齐 useLogin / useLeadDetail),
|
||||
* 无 H5 open 能力时回退复制;空 url 不渲染、不打开。
|
||||
*/
|
||||
export function copyCaseExternalLink(url: string): boolean {
|
||||
const trimmed = url != null ? url.trim() : '';
|
||||
if (trimmed === '') {
|
||||
export function openCaseExternalLink(url: string): boolean {
|
||||
const safeUrl = url != null ? url.trim() : '';
|
||||
if (safeUrl === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
let opened = false;
|
||||
try {
|
||||
if (typeof window !== 'undefined' && typeof window.open === 'function') {
|
||||
window.open(safeUrl, '_blank');
|
||||
opened = true;
|
||||
}
|
||||
} catch (_e) {}
|
||||
|
||||
if (opened) {
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
uni.setClipboardData({
|
||||
data: safeUrl,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: getOmniText(getCurrentLocale(), 'portal.copied_link'),
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
return true;
|
||||
} catch (_e) {
|
||||
return false;
|
||||
}
|
||||
uni.setClipboardData({
|
||||
data: trimmed,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: getOmniText(getCurrentLocale(), 'portal.copied_link'),
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,6 +234,8 @@ export function createCaseDetailState(): CaseDetailState {
|
||||
kpis: [],
|
||||
pdfUrl: '',
|
||||
youtubeUrl: '',
|
||||
videoUrl: '',
|
||||
blockType: 'case',
|
||||
client: '',
|
||||
industry: '',
|
||||
region: '',
|
||||
@@ -223,7 +259,7 @@ export function applyCaseDetailOptions(
|
||||
}
|
||||
|
||||
/**
|
||||
* 从门户聚合数据中选出 id 匹配且 type 为 case 的块;缺块返回 null
|
||||
* 从门户聚合数据中选出 id 匹配且 type 为 case 或 video 的块;缺块返回 null
|
||||
*/
|
||||
export function pickCaseBlock(
|
||||
card: CardPortalDetail | null,
|
||||
@@ -236,7 +272,7 @@ export function pickCaseBlock(
|
||||
const blocks = card.bentoBlocks;
|
||||
for (let i = 0; i < blocks.length; i++) {
|
||||
const block = blocks[i];
|
||||
if (String(block.id) === target && block.type === 'case') {
|
||||
if (String(block.id) === target && (block.type === 'case' || block.type === 'video')) {
|
||||
return block;
|
||||
}
|
||||
}
|
||||
@@ -301,6 +337,12 @@ function collectImages(mediaUrl: string, meta: CaseMetaRecord): string[] {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result.length === 0) {
|
||||
const poster = readTrimmed(meta.poster);
|
||||
if (poster !== '') {
|
||||
result.push(poster);
|
||||
}
|
||||
}
|
||||
if (result.length === 0 && mediaUrl !== '') {
|
||||
result.push(mediaUrl);
|
||||
}
|
||||
@@ -324,7 +366,25 @@ function resolvePdfUrl(meta: CaseMetaRecord): string {
|
||||
return '';
|
||||
}
|
||||
|
||||
function resolveYoutubeUrl(meta: CaseMetaRecord): string {
|
||||
function resolveVideoDirectUrl(meta: CaseMetaRecord, block: BentoBlockPublic): string {
|
||||
const metaVideo = readTrimmed(meta.videoUrl) || readTrimmed(meta.video);
|
||||
if (metaVideo !== '') {
|
||||
const lower = metaVideo.toLowerCase();
|
||||
if (lower.indexOf('youtube.com') < 0 && lower.indexOf('youtu.be') < 0) {
|
||||
return metaVideo;
|
||||
}
|
||||
}
|
||||
const link = block.linkUrl != null ? String(block.linkUrl).trim() : '';
|
||||
if (link !== '') {
|
||||
const lower = link.toLowerCase();
|
||||
if (lower.indexOf('youtube.com') < 0 && lower.indexOf('youtu.be') < 0) {
|
||||
return link;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function resolveYoutubeUrl(meta: CaseMetaRecord, block?: BentoBlockPublic): string {
|
||||
const youtubeUrl = readTrimmed(meta.youtubeUrl);
|
||||
if (youtubeUrl !== '') {
|
||||
return youtubeUrl;
|
||||
@@ -333,7 +393,7 @@ function resolveYoutubeUrl(meta: CaseMetaRecord): string {
|
||||
if (youtube !== '') {
|
||||
return youtube;
|
||||
}
|
||||
const url = readTrimmed(meta.url);
|
||||
const url = readTrimmed(meta.url) || readTrimmed(meta.videoUrl);
|
||||
const kind = readTrimmed(meta.type).toLowerCase();
|
||||
const lower = url.toLowerCase();
|
||||
if (
|
||||
@@ -342,6 +402,13 @@ function resolveYoutubeUrl(meta: CaseMetaRecord): string {
|
||||
) {
|
||||
return url;
|
||||
}
|
||||
if (block != null && block.linkUrl != null) {
|
||||
const link = String(block.linkUrl).trim();
|
||||
const linkLower = link.toLowerCase();
|
||||
if (linkLower.indexOf('youtube.com') >= 0 || linkLower.indexOf('youtu.be') >= 0) {
|
||||
return link;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -352,6 +419,8 @@ function clearCaseContent(state: CaseDetailState): void {
|
||||
state.kpis = [];
|
||||
state.pdfUrl = '';
|
||||
state.youtubeUrl = '';
|
||||
state.videoUrl = '';
|
||||
state.blockType = 'case';
|
||||
state.client = '';
|
||||
state.industry = '';
|
||||
state.region = '';
|
||||
@@ -371,13 +440,15 @@ function fillFromBlock(state: CaseDetailState, block: BentoBlockPublic): void {
|
||||
state.empty = false;
|
||||
state.loading = false;
|
||||
state.errorMessage = '';
|
||||
state.blockType = block.type != null ? String(block.type) : 'case';
|
||||
state.title = block.title != null ? block.title : '';
|
||||
state.content = block.content != null ? block.content : '';
|
||||
state.images = collectImages(mediaUrl, meta);
|
||||
const kpis = normalizeKpis(meta.kpis);
|
||||
state.kpis = kpis.length > 0 ? kpis : normalizeKpis(meta.metrics);
|
||||
state.pdfUrl = resolvePdfUrl(meta);
|
||||
state.youtubeUrl = resolveYoutubeUrl(meta);
|
||||
state.videoUrl = resolveVideoDirectUrl(meta, block);
|
||||
state.youtubeUrl = resolveYoutubeUrl(meta, block);
|
||||
state.client = readTrimmed(meta.client);
|
||||
state.industry = readTrimmed(meta.industry);
|
||||
state.region = readTrimmed(meta.region);
|
||||
|
||||
@@ -120,6 +120,24 @@ export function validateExchangeForm(form: ExchangeForm): string {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅接口明确成功才视为互换完成:
|
||||
* - persisted === false → 未落库,不成功
|
||||
* - persisted === true → 成功
|
||||
* - 无 persisted 字段时,须有非空 id(CRM 留资落库回执)
|
||||
*/
|
||||
export function isExchangeSubmitSuccess(lead: LeadEntity | null | Record<string, unknown>): boolean {
|
||||
if (lead == null || typeof lead !== 'object') {
|
||||
return false;
|
||||
}
|
||||
const record = lead as Record<string, unknown>;
|
||||
if ('persisted' in record) {
|
||||
return record['persisted'] === true;
|
||||
}
|
||||
const id = record['id'];
|
||||
return id != null && String(id).trim() !== '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空表单字段,保留名片标识
|
||||
*/
|
||||
@@ -192,6 +210,14 @@ export async function submitExchange(state: ExchangeState): Promise<LeadEntity |
|
||||
try {
|
||||
const lead = await submitLead(payload);
|
||||
state.submitting = false;
|
||||
if (!isExchangeSubmitSuccess(lead)) {
|
||||
state.errorMessage = '交换未保存,请稍后重试';
|
||||
uni.showToast({
|
||||
title: state.errorMessage,
|
||||
icon: 'none',
|
||||
});
|
||||
return null;
|
||||
}
|
||||
resetExchangeForm(state);
|
||||
uni.showToast({
|
||||
title: '留资已提交',
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import { ExchangeForm } from './useExchange.uts';
|
||||
import { httpPost } from '../../common/request.uts';
|
||||
|
||||
export type ExtractedContactInfo = {
|
||||
name: string;
|
||||
@@ -15,6 +16,14 @@ export type ExtractedContactInfo = {
|
||||
rawText: string;
|
||||
};
|
||||
|
||||
export type OcrApiRecognizeResult = {
|
||||
name: string;
|
||||
company: string;
|
||||
phone: string;
|
||||
email: string;
|
||||
title: string;
|
||||
};
|
||||
|
||||
export type OcrScanState = {
|
||||
scanning: boolean;
|
||||
rawText: string;
|
||||
@@ -27,6 +36,10 @@ export type HandleOcrUploadOptions = {
|
||||
mockText?: string;
|
||||
sourceType?: string[];
|
||||
overwrite?: boolean;
|
||||
httpPost?: (
|
||||
url: string,
|
||||
data?: Record<string, string>
|
||||
) => Promise<OcrApiRecognizeResult>;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -526,7 +539,7 @@ export function fillFormFromOcr(
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟 OCR 识别返回预设样例名片,用于客户端无外部云 OCR 时的交互演示与离线测试
|
||||
* 模拟 OCR 识别返回预设样例名片,仅供离线演示/单测;真实上传路径不得依赖此函数
|
||||
*/
|
||||
export function simulateOcrScan(sampleType?: string): ExtractedContactInfo {
|
||||
if (sampleType === 'uae' || sampleType === 'dubai') {
|
||||
@@ -558,6 +571,87 @@ export function simulateOcrScan(sampleType?: string): ExtractedContactInfo {
|
||||
`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将后端 OCR 识别结果映射为本地填单结构
|
||||
*/
|
||||
export function mapOcrApiResult(apiResult: OcrApiRecognizeResult): ExtractedContactInfo {
|
||||
const name = apiResult != null && apiResult.name != null ? String(apiResult.name).trim() : '';
|
||||
const company =
|
||||
apiResult != null && apiResult.company != null ? String(apiResult.company).trim() : '';
|
||||
const phoneRaw =
|
||||
apiResult != null && apiResult.phone != null ? String(apiResult.phone).trim() : '';
|
||||
const email = apiResult != null && apiResult.email != null ? String(apiResult.email).trim() : '';
|
||||
const title = apiResult != null && apiResult.title != null ? String(apiResult.title).trim() : '';
|
||||
const phone = phoneRaw !== '' ? normalizeE164Phone(phoneRaw) : '';
|
||||
|
||||
return {
|
||||
name,
|
||||
company,
|
||||
phone,
|
||||
email,
|
||||
title,
|
||||
notes: '',
|
||||
rawText: [name, title, company, phone, email].filter((v) => v !== '').join('\n'),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取本地图片为 base64;不可读时返回空串
|
||||
*/
|
||||
function readLocalImageBase64(filePath: string): Promise<string> {
|
||||
return new Promise<string>((resolve) => {
|
||||
try {
|
||||
if (typeof uni === 'undefined' || typeof uni.getFileSystemManager !== 'function') {
|
||||
resolve('');
|
||||
return;
|
||||
}
|
||||
const fs = uni.getFileSystemManager();
|
||||
if (fs == null || typeof fs.readFile !== 'function') {
|
||||
resolve('');
|
||||
return;
|
||||
}
|
||||
fs.readFile({
|
||||
filePath: filePath,
|
||||
encoding: 'base64',
|
||||
success: (res: unknown) => {
|
||||
let data = '';
|
||||
if (res != null && typeof res === 'object') {
|
||||
const r = res as Record<string, unknown>;
|
||||
if (r.data != null) {
|
||||
data = String(r.data);
|
||||
}
|
||||
}
|
||||
resolve(data);
|
||||
},
|
||||
fail: (_err: unknown) => {
|
||||
resolve('');
|
||||
},
|
||||
});
|
||||
} catch (_e) {
|
||||
resolve('');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据选图路径组装 OCR 请求体:优先 imageBase64,其次 imageUrl
|
||||
*/
|
||||
async function buildOcrRecognizeBody(
|
||||
imagePath: string
|
||||
): Promise<Record<string, string>> {
|
||||
const path = imagePath.trim();
|
||||
if (path.startsWith('http://') || path.startsWith('https://')) {
|
||||
return { imageUrl: path };
|
||||
}
|
||||
|
||||
const base64 = await readLocalImageBase64(path);
|
||||
if (base64 !== '') {
|
||||
return { imageBase64: base64 };
|
||||
}
|
||||
|
||||
return { imageUrl: path };
|
||||
}
|
||||
|
||||
/**
|
||||
* 拍照或上传名片 OCR 识别流程处理入口
|
||||
*/
|
||||
@@ -568,11 +662,16 @@ export async function handleCardOcrUpload(
|
||||
): Promise<boolean> {
|
||||
const opt = options != null ? options : {};
|
||||
const overwrite = opt.overwrite !== undefined ? opt.overwrite : true;
|
||||
const postFn =
|
||||
opt.httpPost != null
|
||||
? opt.httpPost
|
||||
: (url: string, data?: Record<string, string>) =>
|
||||
httpPost<OcrApiRecognizeResult>(url, data);
|
||||
|
||||
ocrState.scanning = true;
|
||||
ocrState.errorMessage = '';
|
||||
|
||||
// 1. 如果传入 mockText,直接模拟完成识别 (用于测试或开发模拟)
|
||||
// 1. 如果传入 mockText,走本地 parseOcrCardText(供测试/离线模拟)
|
||||
if (opt.mockText && opt.mockText.trim() !== '') {
|
||||
const extracted = parseOcrCardText(opt.mockText);
|
||||
ocrState.rawText = opt.mockText;
|
||||
@@ -587,7 +686,7 @@ export async function handleCardOcrUpload(
|
||||
return true;
|
||||
}
|
||||
|
||||
// 2. 调用客户端拍照/选图 API
|
||||
// 2. 调用客户端拍照/选图 API,成功后请求后端 OCR
|
||||
return new Promise<boolean>((resolve) => {
|
||||
try {
|
||||
const sourceTypes = opt.sourceType != null && opt.sourceType.length > 0
|
||||
@@ -607,18 +706,32 @@ export async function handleCardOcrUpload(
|
||||
}
|
||||
ocrState.imagePath = path !== '' ? path : 'https://cdn.omnicard.ai/mock-card.jpg';
|
||||
|
||||
// 图像上传与 OCR 解析
|
||||
const sample = simulateOcrScan('cn');
|
||||
ocrState.rawText = sample.rawText;
|
||||
ocrState.lastExtracted = sample;
|
||||
fillFormFromOcr(form, sample, overwrite);
|
||||
ocrState.scanning = false;
|
||||
void (async () => {
|
||||
try {
|
||||
const body = await buildOcrRecognizeBody(ocrState.imagePath);
|
||||
const apiResult = await postFn('/open/ai/ocr/recognize', body);
|
||||
const extracted = mapOcrApiResult(apiResult);
|
||||
ocrState.rawText = extracted.rawText;
|
||||
ocrState.lastExtracted = extracted;
|
||||
fillFormFromOcr(form, extracted, overwrite);
|
||||
ocrState.scanning = false;
|
||||
ocrState.errorMessage = '';
|
||||
|
||||
uni.showToast({
|
||||
title: '名片识别成功,已自动填入',
|
||||
icon: 'none',
|
||||
});
|
||||
resolve(true);
|
||||
uni.showToast({
|
||||
title: '名片识别成功,已自动填入',
|
||||
icon: 'none',
|
||||
});
|
||||
resolve(true);
|
||||
} catch (err: unknown) {
|
||||
ocrState.scanning = false;
|
||||
let msg = '名片识别失败';
|
||||
if (err instanceof Error && err.message !== '') {
|
||||
msg = err.message;
|
||||
}
|
||||
ocrState.errorMessage = msg;
|
||||
resolve(false);
|
||||
}
|
||||
})();
|
||||
},
|
||||
fail: (err: unknown) => {
|
||||
ocrState.scanning = false;
|
||||
|
||||
@@ -107,6 +107,7 @@ export type PortalState = {
|
||||
errorMessage: string;
|
||||
visitorId: string;
|
||||
enterTime: number;
|
||||
scrollDepth: number;
|
||||
touchType: string;
|
||||
isPlayingAudio: boolean;
|
||||
audioContext: any | null;
|
||||
@@ -145,6 +146,7 @@ export function createPortalState(): PortalState {
|
||||
errorMessage: '',
|
||||
visitorId: getOrCreateVisitorId(),
|
||||
enterTime: Date.now(),
|
||||
scrollDepth: 0,
|
||||
touchType: 'link',
|
||||
isPlayingAudio: false,
|
||||
audioContext: null,
|
||||
@@ -162,6 +164,7 @@ export async function loadCardPortal(
|
||||
state.errorMessage = '';
|
||||
state.touchType = source;
|
||||
state.enterTime = Date.now();
|
||||
state.scrollDepth = 0;
|
||||
|
||||
// 1. 优先尝试秒级读取本地缓存快照,实现首屏 0ms 呈现
|
||||
const cached: CachedPortalData | null = getCachedPortal(cardIdOrSlug);
|
||||
@@ -194,6 +197,7 @@ export async function loadCardPortal(
|
||||
touchType: state.touchType,
|
||||
stayDurationMs: 0,
|
||||
scrollDepth: 0,
|
||||
viewedBlocks: ['hero'],
|
||||
}).catch((_e: unknown) => {
|
||||
// 轨迹上报容错,不阻断主流程
|
||||
});
|
||||
@@ -217,7 +221,68 @@ export async function loadCardPortal(
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报访客停留时长与阅读深度
|
||||
* 记录门户滚动深度,只升不降
|
||||
*/
|
||||
export function updatePortalScrollDepth(
|
||||
state: PortalState,
|
||||
scrollTop: number,
|
||||
scrollHeight: number,
|
||||
windowHeight: number
|
||||
): number {
|
||||
if (scrollHeight <= 0) {
|
||||
return state.scrollDepth;
|
||||
}
|
||||
const maxScroll = Math.max(1, scrollHeight - windowHeight);
|
||||
const currentRatio = Math.min(1, Math.max(0, scrollTop / maxScroll));
|
||||
const depth = Math.round(currentRatio * 100);
|
||||
if (depth > state.scrollDepth) {
|
||||
state.scrollDepth = depth;
|
||||
}
|
||||
return state.scrollDepth;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按真实滚动深度收录已进入视口的模块,未滚动只记名片主页
|
||||
*/
|
||||
export function collectViewedBlockKeys(
|
||||
card: CardPortalDetail | null,
|
||||
scrollDepth: number
|
||||
): string[] {
|
||||
const keys: string[] = ['hero'];
|
||||
if (card == null) {
|
||||
return keys;
|
||||
}
|
||||
const depth = Math.min(100, Math.max(0, Math.round(scrollDepth)));
|
||||
const blocks = filterVisibleBentoBlocks(card.bentoBlocks);
|
||||
const sequence: string[] = [];
|
||||
if (depth > 0) {
|
||||
sequence.push('appointment');
|
||||
}
|
||||
const visibleCount = depth <= 0 ? 0 : Math.max(1, Math.ceil((depth / 100) * Math.max(blocks.length, 1)));
|
||||
const take = Math.min(blocks.length, visibleCount);
|
||||
for (let i = 0; i < take; i++) {
|
||||
const block = blocks[i];
|
||||
const id = block.id != null ? String(block.id).trim() : '';
|
||||
if (id !== '') {
|
||||
sequence.push(id);
|
||||
} else if (block.type != null && String(block.type).trim() !== '') {
|
||||
sequence.push(String(block.type).trim());
|
||||
}
|
||||
}
|
||||
const seen: Record<string, boolean> = { hero: true };
|
||||
for (let i = 0; i < sequence.length; i++) {
|
||||
const key = sequence[i];
|
||||
if (seen[key] === true) {
|
||||
continue;
|
||||
}
|
||||
seen[key] = true;
|
||||
keys.push(key);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报访客停留时长与阅读深度,并带上已查看模块
|
||||
*/
|
||||
export async function reportPortalStay(
|
||||
state: PortalState,
|
||||
@@ -227,6 +292,10 @@ export async function reportPortalStay(
|
||||
return null;
|
||||
}
|
||||
|
||||
const depth = Math.min(100, Math.max(0, Math.round(scrollDepth)));
|
||||
if (depth > state.scrollDepth) {
|
||||
state.scrollDepth = depth;
|
||||
}
|
||||
const stayDurationMs = Math.max(0, Date.now() - state.enterTime);
|
||||
try {
|
||||
const track = await recordRadarTrack({
|
||||
@@ -234,7 +303,8 @@ export async function reportPortalStay(
|
||||
visitorId: state.visitorId,
|
||||
touchType: state.touchType,
|
||||
stayDurationMs,
|
||||
scrollDepth,
|
||||
scrollDepth: state.scrollDepth,
|
||||
viewedBlocks: collectViewedBlockKeys(state.card, state.scrollDepth),
|
||||
});
|
||||
return track;
|
||||
} catch (e) {
|
||||
@@ -290,7 +360,23 @@ export type PortalQuickAction =
|
||||
| 'phone'
|
||||
| 'telegram'
|
||||
| 'twitter'
|
||||
| 'wechat';
|
||||
| 'wechat'
|
||||
| 'line'
|
||||
| 'kakao';
|
||||
|
||||
/**
|
||||
* Line / KakaoTalk 等外链入口:仅合法 http(s) URL 可渲染与触发
|
||||
*/
|
||||
export function isRenderableHttpUrl(value?: string | null): boolean {
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
const trimmed = value.trim();
|
||||
if (trimmed === '') {
|
||||
return false;
|
||||
}
|
||||
return /^https?:\/\//i.test(trimmed);
|
||||
}
|
||||
|
||||
export function triggerQuickAction(
|
||||
type: PortalQuickAction,
|
||||
@@ -304,6 +390,14 @@ export function triggerQuickAction(
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((type === 'line' || type === 'kakao') && !isRenderableHttpUrl(value)) {
|
||||
uni.showToast({
|
||||
title: getOmniText(getCurrentLocale(), 'portal.contact_unset'),
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type === 'phone') {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: value,
|
||||
@@ -394,6 +488,32 @@ export function triggerQuickAction(
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type === 'line') {
|
||||
uni.setClipboardData({
|
||||
data: value.trim(),
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: getOmniText(getCurrentLocale(), 'portal.copied_line'),
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type === 'kakao') {
|
||||
uni.setClipboardData({
|
||||
data: value.trim(),
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: getOmniText(getCurrentLocale(), 'portal.copied_kakao'),
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户