🎯 虚拟身份客服系统演示

📋 使用场景说明

这个演示展示了如何在项目中集成虚拟身份客服系统。同一个项目账号下,不同设备的用户将有完全独立的聊天环境。

🔑 核心特性

完全隔离:不同设备的用户看到的聊天记录完全独立
自动识别:同一设备再次访问时自动恢复聊天记录
无感知:用户无需任何额外操作

👤 模拟用户选择

📊 当前虚拟身份信息

项目账号: demo@shop.com
设备指纹: 计算中...
虚拟身份: 未生成

💻 集成代码示例

1. 基础集成

<script src="https://your-domain.com/widget/customer-service.js"></script> <script> // 获取当前项目的登录用户ID const currentUserId = getCurrentProjectUserId(); // 你的项目函数 // 初始化客服系统 CustomerService.init({ apiUrl: 'https://your-chat-api.com/api', siteKey: 'your-site-key', externalUserId: currentUserId, // 关键参数:项目用户ID position: 'bottom-right', primaryColor: '#007bff' }); </script>

2. 电商网站集成示例

<script> // 电商网站集成示例 function initCustomerService() { // 获取当前登录用户(可能是体验账号或正式账号) const userId = getUserId() || 'demo@shop.com'; CustomerService.init({ apiUrl: 'https://chat.yoursite.com/api', siteKey: 'shop_site_key_123', externalUserId: userId, position: 'bottom-right', primaryColor: '#e74c3c', welcomeMessage: '欢迎来到我们的商城!有什么问题请随时咨询。' }); } // 页面加载完成后初始化 document.addEventListener('DOMContentLoaded', initCustomerService); </script>

3. SaaS系统集成示例

<script> // SaaS系统集成示例 function initSaaSCustomerService() { const userInfo = getCurrentUser(); CustomerService.init({ apiUrl: 'https://support.saas.com/api', siteKey: 'saas_enterprise_key', externalUserId: userInfo.email, position: 'bottom-left', primaryColor: '#2ecc71', welcomeMessage: '您好!我是您的专属客服,随时为您解答问题。' }); } </script>