// 个人版 / 企业版界面区分原型(2026-12-01)。只渲染演示数据,不发任何请求。 // URL 参数:edition=personal|enterprise · end=mobile|desktop · page=contacts|mine|agent|groups|nav · capture=1 const q = new URLSearchParams(location.search); const edition = q.get('edition') === 'enterprise' ? 'enterprise' : 'personal'; const end = q.get('end') === 'desktop' ? 'desktop' : 'mobile'; const page = q.get('page') || 'contacts'; if (q.get('capture')) document.body.classList.add('capture'); const P = edition === 'personal'; const me = P ? { name: '用户5512', mobile: '18182795512' } : { name: '用户9836', mobile: '19170119836', org: '飞码AI', role: '管理员' }; const myAgents = P ? [['agent-node-app-zcuh81n3sl', true], ['agent-node-app-hfc5cvr2jd', true], ['agent-node-app-0lk9iavzmm', false]] : [['研究助手', true]]; const colleagues = [ { name: '张敏', mobile: '138****2051', agents: [['文案助手', true], ['数据分析', false]] }, { name: '李航', mobile: '139****7730', agents: [['客服助手', true]] }, ]; const allAgents = P ? myAgents.map(([n, on]) => ({ n, on })) : [ ...myAgents.map(([n, on]) => ({ n, on, owner: '我' })), ...colleagues.flatMap((c) => c.agents.map(([n, on]) => ({ n, on, owner: c.name }))), ]; const NOTES = { personal: { contacts: '个人版:去掉“全部/数字生命/同事”分段和“同事”分组,不显示“归属 xxx”,只列我的数字生命。', mine: '个人版:资料卡显示“个人版”标签,不显示所属组织;桌面“所属组织”一行改为“账号类型:个人版”。', agent: '个人版:可以重命名自己的容器,不再提示“只有企业管理员可以重命名”。', groups: '个人版:空态不再写“需要公司管理员创建”。', nav: '个人版:不出现“成员管理”(个人试用组织的用户以前会看到)。', }, enterprise: { contacts: '企业版:结构不变;“同事”列表不再包含自己(本例自己是用户9836)。', mine: '企业版:显示企业名与身份(不变)。', agent: '企业版:管理员可重命名(不变);普通成员仍显示“只有企业管理员可以重命名容器”。', groups: '企业版:空态文案不变。', nav: '企业版:管理员显示“成员管理”(不变)。', }, }; const status = (on) => `● ${on ? '在线' : '离线'}`; const agentRow = (a) => `
${a.n}
数字生命${a.owner ? ' · 归属 ' + a.owner : ''}
${status(a.on)}
`; const personRow = (c) => `
${c.name[0]}
${c.name}
${c.mobile} · ${c.agents.length} 个数字生命
`; const editionBadge = P ? '个人版' : `企业版 · ${me.role}`; const views = { contacts() { const search = ''; if (P) return { title: '通讯录', sub: '我的数字生命,点击进入会话或详情。', tools: search, body: `

我的数字生命 · ${allAgents.length}

${list(allAgents.map(agentRow))}` }; return { title: '通讯录', sub: 'AI 数字生命与同事,点击进入会话或档案。', tools: `
全部数字生命同事
${search}`, body: `

同事 · ${colleagues.length}

${list(colleagues.map(personRow))}

数字生命 · ${allAgents.length}

${list(allAgents.map(agentRow))}` }; }, mine() { const profile = `
用

${me.name}

${me.mobile}${P ? '' : ' · ' + me.org}
${editionBadge}
`; const rows = P ? '
账号类型个人版
' : `
所属组织${me.org}
身份${me.role}
`; const rest = '
(通知、外观等其余分区两版相同,不变)
'; return { title: '我的', body: end === 'mobile' ? profile + rest : `${profile}

账号信息

${rows}
${rest}` }; }, agent() { const name = myAgents[0][0]; return { title: '容器设置', back: true, body: `
当前名称
${name}
${P ? '个人容器' : '企业容器'}
` }; }, groups() { const desc = P ? '把你的多个数字生命拉进一个组,一起完成任务。' : '在工作组里可以由多名数字生命协作。需要公司管理员创建。'; return { title: '工作组', body: `

还没有工作组

${desc}

` }; }, nav() { return { title: '会话', body: '
(背景为会话列表)
', drawer: true }; }, }; const list = (rows) => `
${rows.join('')}
`; const NAV = [ ['fa-comment', '会话'], ['fa-address-book', '通讯录'], ['fa-table-list', '工作台'], ['fa-people-group', '工作组'], ['fa-server', '我的容器'], ['fa-users-gear', '成员管理', 'admin'], ['fa-circle-user', '我的'], ]; const navItems = (current, showGone) => NAV.filter(([, , only]) => !only || !P || showGone) .map(([ic, label, only]) => ``).join(''); const pageLabel = { contacts: '通讯录', mine: '我的', agent: '我的容器', groups: '工作组', nav: '会话' }; function render() { const v = views[page](); const note = `
${NOTES[edition][page]}
`; const app = document.getElementById('app'); if (end === 'mobile') { const tabs = [['fa-comment', '会话'], ['fa-address-book', '通讯录'], ['fa-table-list', '工作台'], ['fa-circle-user', '我的']]; const drawer = v.drawer ? `
用
${me.name}
${editionBadge}
更多
${navItems('', true)}
` : ''; app.innerHTML = `

${v.title}

${note}${v.tools || ''}${v.body}
${v.back ? '' : ``}${drawer}
`; } else { const body = page === 'contacts' ? v.body.replace(/
/g, '
') : v.body; app.innerHTML = `
${note}

${v.title}

${v.sub ? `

${v.sub}

` : ''}
${v.tools ? `
${v.tools}
` : ''}${body}
`; } } function reviewBar() { const link = (k, val, label) => { const p = new URLSearchParams(location.search); p.set(k, val); const cur = (q.get(k) || { edition: 'personal', end: 'mobile', page: 'contacts' }[k]) === val; return `${label}`; }; document.getElementById('review-bar').innerHTML = `个人版/企业版原型${link('edition', 'personal', '个人版')}${link('edition', 'enterprise', '企业版')}${link('end', 'mobile', '手机')}${link('end', 'desktop', '桌面')}${Object.entries(pageLabel).map(([k]) => link('page', k, { contacts: '通讯录', mine: '我的', agent: '容器设置', groups: '工作组', nav: '菜单' }[k])).join('')}`; } reviewBar(); render();