feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口
补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -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%);
|
||||
|
||||
在新工单中引用
屏蔽一个用户