diff --git a/IDE官网/assets/css/ai-advisor.css b/IDE官网/assets/css/ai-advisor.css index 486f7a1..3629100 100644 --- a/IDE官网/assets/css/ai-advisor.css +++ b/IDE官网/assets/css/ai-advisor.css @@ -2312,9 +2312,74 @@ body.command-home .ai-stage-map--eu { /* Composer + trust strip */ .ai-composer-wrap { + position: relative; flex-shrink: 0; } +.ai-new-chat-tip { + position: absolute; + left: 50%; + bottom: calc(100% + 10px); + z-index: 6; + display: inline-flex; + align-items: center; + max-width: min(92%, 360px); + padding: 8px 14px; + border-radius: 999px; + border: 1px solid rgba(255, 255, 255, 0.78); + background: rgba(5, 79, 116, 0.92); + color: #fff; + font-size: 0.78rem; + font-weight: 600; + line-height: 1.3; + letter-spacing: 0.01em; + white-space: nowrap; + pointer-events: none; + transform: translate(-50%, 6px); + opacity: 0; + box-shadow: 0 10px 28px rgba(5, 79, 116, 0.22); + transition: + opacity 0.28s var(--ai-ease), + transform 0.28s var(--ai-ease); +} + +.ai-new-chat-tip::after { + content: ''; + position: absolute; + left: 50%; + top: 100%; + width: 10px; + height: 10px; + margin-left: -5px; + background: rgba(5, 79, 116, 0.92); + border-right: 1px solid rgba(255, 255, 255, 0.5); + border-bottom: 1px solid rgba(255, 255, 255, 0.5); + transform: rotate(45deg) translateY(-4px); +} + +.ai-new-chat-tip[hidden] { + display: none !important; +} + +.ai-new-chat-tip.is-visible { + opacity: 1; + transform: translate(-50%, 0); +} + +.ai-composer-wrap.has-new-chat-tip .ai-composer { + animation: ai-composer-tip-pulse 1.1s var(--ai-ease) 2; +} + +@keyframes ai-composer-tip-pulse { + 0%, + 100% { + box-shadow: none; + } + 45% { + box-shadow: 0 0 0 3px rgba(5, 79, 116, 0.18); + } +} + .ai-composer-wrap.is-welcome { padding: 0; border-top: none; @@ -2444,16 +2509,22 @@ body.command-home .ai-stage-map--eu { @media (prefers-reduced-motion: reduce) { .ai-composer__sheen, .ai-composer__caustic, - .ai-intent-door::after { + .ai-intent-door::after, + .ai-composer-wrap.has-new-chat-tip .ai-composer { animation: none; } + + .ai-new-chat-tip { + transition: none; + } } .ai-trust-bar { display: flex; - flex-direction: column; - align-items: stretch; - gap: 10px; + flex-wrap: wrap; + align-items: center; + justify-content: center; + gap: 8px 18px; margin-top: 4px; padding: 14px 4px 16px; border-top: 1px solid color-mix(in srgb, var(--ai-border) 55%, transparent); @@ -2461,23 +2532,6 @@ body.command-home .ai-stage-map--eu { font-size: 0.72rem; } -.ai-trust-bar__contacts { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: center; - gap: 10px 22px; -} - -.ai-trust-bar__meta { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: center; - gap: 8px 18px; - text-align: center; -} - .ai-trust-bar a, .ai-trust-wechat { display: inline-flex; @@ -2526,19 +2580,19 @@ body.command-home .ai-stage-map--eu { .ai-trust-address { display: inline-flex; - align-items: flex-start; + align-items: center; justify-content: center; gap: 6px; margin: 0; - max-width: min(100%, 560px); color: var(--ai-text-3); font-size: 0.72rem; line-height: 1.45; text-align: left; + white-space: nowrap; } .ai-trust-address i { - margin-top: 2px; + margin-top: 0; font-size: 0.88rem; line-height: 1; color: var(--ai-action); @@ -2722,15 +2776,8 @@ body.command-home .ai-stage-map--eu { font-size: 0.9rem; } - .ai-trust-bar__contacts { - flex-direction: column; - align-items: center; - gap: 10px; - } - - .ai-trust-bar__meta { - flex-direction: column; - gap: 8px; + .ai-trust-bar { + gap: 8px 14px; } .ai-trust-address { @@ -2738,6 +2785,13 @@ body.command-home .ai-stage-map--eu { justify-content: center; } + .ai-new-chat-tip { + max-width: min(94vw, 320px); + white-space: normal; + text-align: center; + border-radius: 14px; + } + .ai-composer { min-height: 76px; padding: 12px 12px 12px 18px; @@ -2754,3 +2808,123 @@ body.command-home .ai-stage-map--eu { height: 46px; } } + +/* 企业微信客服 — PC 扫码浮层 */ +.ide-kf-modal { + position: fixed; + inset: 0; + z-index: 10050; + display: grid; + place-items: center; + padding: 24px; +} + +.ide-kf-modal__backdrop { + position: absolute; + inset: 0; + background: rgba(12, 18, 28, 0.55); + backdrop-filter: blur(4px); + -webkit-backdrop-filter: blur(4px); +} + +.ide-kf-modal__panel { + position: relative; + z-index: 1; + width: min(100%, 360px); + padding: 28px 24px 22px; + border-radius: 16px; + border: 1px solid color-mix(in srgb, var(--ai-border) 80%, transparent); + background: var(--ai-surface, #fff); + box-shadow: 0 24px 64px rgba(12, 18, 28, 0.22); + text-align: center; +} + +.ide-kf-modal__close { + position: absolute; + top: 10px; + right: 10px; + width: 36px; + height: 36px; + display: grid; + place-items: center; + margin: 0; + padding: 0; + border: none; + border-radius: 8px; + background: transparent; + color: var(--ai-text-3, #6b7280); + cursor: pointer; +} + +.ide-kf-modal__close:hover { + color: var(--ai-text, #111); + background: color-mix(in srgb, var(--ai-border) 40%, transparent); +} + +.ide-kf-modal__kicker { + margin: 0 0 6px; + font-size: 0.75rem; + letter-spacing: 0.04em; + color: var(--ai-text-3, #6b7280); +} + +.ide-kf-modal__title { + margin: 0 0 8px; + font-size: 1.15rem; + font-weight: 650; + color: var(--ai-text, #111); +} + +.ide-kf-modal__hint { + margin: 0 0 18px; + font-size: 0.84rem; + line-height: 1.5; + color: var(--ai-text-2, #4b5563); +} + +.ide-kf-modal__qr-wrap { + display: grid; + place-items: center; + margin: 0 auto 16px; + padding: 12px; + width: fit-content; + border-radius: 12px; + background: #fff; + border: 1px solid color-mix(in srgb, var(--ai-border) 70%, transparent); +} + +.ide-kf-modal__qr { + display: block; + width: 220px; + height: 220px; +} + +.ide-kf-modal__qr-fallback { + margin: 0; + max-width: 220px; + font-size: 0.8rem; + line-height: 1.45; + color: var(--ai-text-2, #4b5563); +} + +.ide-kf-modal__open { + display: inline-flex; + align-items: center; + justify-content: center; + min-height: 36px; + padding: 0 14px; + border-radius: 8px; + font-size: 0.84rem; + font-weight: 600; + color: var(--ai-action, #1d7281); + text-decoration: none; +} + +.ide-kf-modal__open:hover { + text-decoration: underline; +} + +button.ai-card-link { + font: inherit; + cursor: pointer; +} diff --git a/IDE官网/assets/js/ai-advisor.js b/IDE官网/assets/js/ai-advisor.js index 6788fca..653efcf 100644 --- a/IDE官网/assets/js/ai-advisor.js +++ b/IDE官网/assets/js/ai-advisor.js @@ -10,6 +10,8 @@ const PHONE = '18123959245'; const EMAIL = 'bd01@1st56.com'; const WECHAT = 'ydgjzzh'; + // 企业微信管理后台 → 微信客服 → 在微信外接入 → 复制客服链接(勿带尾部空格) + const WECOM_KF_URL = 'https://work.weixin.qq.com/kfid/kfcae09c206f6c7045a'; const ICP = '粤ICP备2025463970号-2'; const ADDRESS_ZH = '深圳宝安区福永怀德翠岗5区36栋'; const ADDRESS_EN = 'Bldg 36, Cuigang 5, Fuyong, Bao’an, Shenzhen'; @@ -33,8 +35,8 @@ const COPY = { en: { - welcomeTitle: 'IDE, a digital one-stop cross-border logistics provider', - welcomeTitleShort: 'IDE · Cross-border logistics', + welcomeTitle: 'IDE, your cross-border logistics advisor', + welcomeTitleShort: 'IDE · Your logistics advisor', welcomeSubLead: 'Parcels, express, dropship, and 9610 clearance — ', welcomeSubAccent: 'built for SMB cross-border sellers', welcomeSubTail: '.', @@ -44,11 +46,12 @@ you: 'You', historyTitle: 'Chat history', newChat: 'New chat', + newChatHint: 'New chat started — ask here', emptyHistory: 'No conversations yet', fallback: 'Quotes are in the customer system after you register. You can also talk to an advisor.', trustPhone: PHONE, trustAddress: ADDRESS_EN, - trustWechat: 'WeChat ' + WECHAT, + trustWechat: 'WeChat support', trustEmail: EMAIL, trustIcp: ICP, guide9610Title: 'Ship first, tax second', @@ -64,8 +67,8 @@ composeLead: 'Ask about a lane, or pick a shortcut below', }, zh: { - welcomeTitle: 'IDE,全球数字化一站式跨境物流服务商', - welcomeTitleShort: 'IDE · 一站式跨境物流', + welcomeTitle: 'IDE,您身边的跨境物流顾问', + welcomeTitleShort: 'IDE · 跨境物流顾问', welcomeSubLead: '专线小包、国际快递、一件代发与 9610 报关,', welcomeSubAccent: '专为中小跨境卖家而生', welcomeSubTail: '。', @@ -75,11 +78,12 @@ you: '你', historyTitle: '历史记录', newChat: '新会话', + newChatHint: '已开启新会话,在这里提问', emptyHistory: '暂无会话', fallback: '官网不提供询价。完成注册登记后,即可在客户系统里看明码价。也可以先联系顾问。', trustPhone: PHONE, trustAddress: ADDRESS_ZH, - trustWechat: '微信 ' + WECHAT, + trustWechat: '微信客服', trustEmail: EMAIL, trustIcp: ICP, guide9610Title: '先发货,再办税', @@ -365,6 +369,7 @@ let historyListEl; let globeController = null; let coverageOpen = false; + let newChatTipTimer = null; const MAP_REGION_EU = new Set(['eu'].concat(COVER_EU.map((item) => item.mapId))); const MAP_REGION_AM = new Set(['us', 'mx', 'ca']); @@ -696,7 +701,8 @@ const rows = el('div', 'ai-card__rows'); [ [zh ? '电话' : 'Phone', PHONE], - [zh ? '微信' : 'WeChat', WECHAT], + [zh ? '微信客服' : 'WeCom', zh ? '扫码 / 手机直达' : 'Scan or tap to chat'], + [zh ? '微信号' : 'WeChat ID', WECHAT], [zh ? '邮箱' : 'Email', EMAIL], [zh ? '地址' : 'Address', zh ? ADDRESS_ZH : ADDRESS_EN], ].forEach(([label, value]) => { @@ -710,7 +716,9 @@ el( 'p', 'ai-card__body', - zh ? '要询价请先注册登记,或直接打电话、加微信。' : 'Register first to quote, or call / WeChat us directly.' + zh + ? '点「在线咨询」用微信对接顾问。询价请先注册登记。' + : 'Tap Live chat to reach an advisor on WeChat. Register first if you need a quote.' ) ); wrap.appendChild(contactActions()); @@ -817,15 +825,90 @@ return actions; } + function isWeChatEnv() { + return /MicroMessenger/i.test(navigator.userAgent); + } + + function isMobileEnv() { + return /Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent); + } + + function closeKfQrModal() { + document.getElementById('ide-kf-modal')?.remove(); + } + + function showKfQrModal(url) { + closeKfQrModal(); + const zh = lang === 'zh'; + const modal = document.createElement('div'); + modal.id = 'ide-kf-modal'; + modal.className = 'ide-kf-modal'; + modal.setAttribute('role', 'dialog'); + modal.setAttribute('aria-modal', 'true'); + modal.setAttribute('aria-label', zh ? '微信扫码咨询' : 'Scan to chat on WeChat'); + const qrSrc = + 'https://api.qrserver.com/v1/create-qr-code/?size=220x220&margin=8&data=' + + encodeURIComponent(url); + modal.innerHTML = ` +
+${zh ? '企业微信客服' : 'WeCom support'}
+${zh ? '打开手机微信,扫一扫下方二维码即可对话顾问' : 'Open WeChat on your phone and scan the code to chat'}
+${zh ? '二维码加载失败,请点下方打开客服页后用微信扫码' : 'QR failed to load — open the support page and scan there'}
+