refactor(works): 只收录「一级菜单图标选型」与「默认头像素材库」,移除整站文档中心

- works/menu-icons/index.html:16 个一级菜单 210 个候选图标,点选复制 SVG
- works/avatar-library.html + works/avatars/(40 SVG)+ works/avatar-preview.html:默认头像素材库及在线预览
- 面包屑/图片路径改为 works 内相对路径(../avatars → avatars,返回链接指向 works.html)
- 删除 works/devdoc 整站(含 3.26MB mermaid),works.js 与版本号同步
This commit is contained in:
sgp
2026-11-15 23:24:20 +08:00
parent 5f6f154f1f
commit 5ddf33b0bb
59 changed files with 621 additions and 7971 deletions
@@ -70,7 +70,7 @@
</head>
<body>
<div class="wrap">
<div class="crumb"><a href="./index.html">开发文档</a> / 底层设计 / 默认头像素材库</div>
<div class="crumb"><a href="../works.html">设计成品</a> / 底层设计 / 默认头像素材库</div>
<h1>默认头像素材库</h1>
<p class="lead">个人中心头像选型、未设置头像时的稳定兜底,以及新用户的默认头像来源。共 40 款,全部为中性人形图标。</p>
@@ -80,7 +80,7 @@
<div><b>协议</b>ISC,可商用</div>
<div><b>数量</b>40 款(线框 20 + 背景 20)</div>
<div><b>存放目录</b><code>ruoyi-ui/public/avatars/</code></div>
<div><b>在线预览</b><a href="../avatar-preview.html" target="_blank">avatar-preview.html</a></div>
<div><b>在线预览</b><a href="avatar-preview.html" target="_blank">avatar-preview.html</a></div>
</div>
<div class="note">
@@ -138,7 +138,7 @@
var card = document.createElement('div');
card.className = 'card' + (key === 'bg' ? ' bg' : '');
card.innerHTML =
'<img alt="' + name + '" src="../avatars/' + file + '">' +
'<img alt="' + name + '" src="avatars/' + file + '">' +
'<span class="name">' + name + '</span>' +
'<span class="file">' + file + '<br>' + color + '</span>';
wrap.appendChild(card);
+293
View File
@@ -0,0 +1,293 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>默认头像选型</title>
<style>
* { box-sizing: border-box; }
body {
margin: 0;
padding: 32px 24px 48px;
background: #f4f6fa;
color: #1f2d3d;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; }
.brand {
display: inline-flex; align-items: center; gap: 8px;
font-size: 12px; color: #6b7787; letter-spacing: .04em;
}
.brand i { width: 8px; height: 8px; border-radius: 50%; background: #409eff; display: inline-block; }
h1 { margin: 10px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.sub { margin: 0; color: #7b8798; font-size: 13px; line-height: 1.7; }
.sub code { background: #e9edf5; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin-top: 24px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.group { margin-bottom: 20px; }
.group-title {
margin: 0 0 10px;
font-size: 12px;
font-weight: 600;
color: #8a94a6;
letter-spacing: .06em;
}
.grid-inner {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
gap: 14px;
}
.card {
position: relative;
display: flex; flex-direction: column; align-items: center;
padding: 20px 12px 14px;
background: #fff;
border: 1px solid #e6eaf2;
border-radius: 14px;
cursor: pointer;
transition: border-color .16s, box-shadow .16s, transform .16s;
text-align: center;
}
.card:hover { border-color: #b9c6da; box-shadow: 0 6px 18px rgba(31, 45, 61, .06); transform: translateY(-1px); }
.card.active { border-color: #409eff; box-shadow: 0 0 0 3px rgba(64, 158, 255, .14); }
.avatar {
width: 88px; height: 88px; border-radius: 50%;
background: #f1f4fa;
display: flex; align-items: center; justify-content: center;
}
.avatar img { width: 56px; height: 56px; display: block; }
.avatar.bg-avatar img { width: 72px; height: 72px; }
.name { margin-top: 14px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.file { margin-top: 4px; font-size: 11px; color: #9aa4b5; }
.check {
position: absolute; top: 10px; right: 10px;
width: 20px; height: 20px; border-radius: 50%;
background: #409eff; color: #fff; font-size: 12px;
display: none; align-items: center; justify-content: center;
}
.card.active .check { display: flex; }
.panel {
position: sticky; top: 24px;
align-self: start;
background: #fff;
border: 1px solid #e6eaf2;
border-radius: 14px;
padding: 20px;
}
.panel h2 { margin: 0 0 16px; font-size: 14px; font-weight: 600; color: #55617a; }
.preview {
display: flex; align-items: center; justify-content: center;
width: 132px; height: 132px; margin: 0 auto;
border-radius: 50%; background: #f1f4fa;
}
.preview img { width: 84px; height: 84px; }
.empty { color: #a6afbf; font-size: 12px; }
.sel-name { margin-top: 14px; text-align: center; font-size: 15px; font-weight: 600; min-height: 22px; }
.sel-path { margin-top: 4px; text-align: center; font-size: 11px; color: #9aa4b5; word-break: break-all; }
.sizes { display: flex; justify-content: center; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #eef1f6; }
.size { text-align: center; }
.size .box { display: flex; align-items: center; justify-content: center; background: #f1f4fa; border-radius: 50%; margin: 0 auto; }
.size .box.s48 { width: 44px; height: 44px; }
.size .box.s32 { width: 32px; height: 32px; }
.size .box img { width: 70%; height: 70%; }
.size span { display: block; margin-top: 6px; font-size: 10px; color: #9aa4b5; }
.actions { margin-top: 18px; display: grid; gap: 8px; }
button {
font: inherit; border-radius: 8px; padding: 9px 12px; cursor: pointer;
border: 1px solid #dfe5ef; background: #fff; color: #3d4a60; transition: all .15s;
}
button:hover:not(:disabled) { border-color: #b9c6da; background: #f7f9fd; }
button.primary { background: #409eff; border-color: #409eff; color: #fff; }
button.primary:hover:not(:disabled) { background: #2f8ff0; }
button:disabled { opacity: .5; cursor: not-allowed; }
.tip { margin-top: 18px; padding-top: 14px; border-top: 1px solid #eef1f6; font-size: 11px; color: #9aa4b5; line-height: 1.7; }
.toast {
position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(10px);
background: rgba(31, 45, 61, .92); color: #fff; font-size: 13px;
padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: all .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
</style>
</head>
<body>
<div class="wrap">
<div class="brand"><i></i>ZHENOS · 头像素材选型</div>
<h1>默认头像选型</h1>
<p class="sub">
同一线框半身图形(Lucide <code>user</code>,ISC,可商用)的两种做法:<b>线框二十色</b>(仅描边变色)与 <b>彩色背景二十款</b>(渐变底 + 白色图标)。<br>
选好后把编号告诉我,我再接入个人中心;本页仅用于选型预览,不影响现有系统。
</p>
<div class="layout">
<div class="grid" id="grid"></div>
<aside class="panel">
<h2>当前选择</h2>
<div class="preview" id="preview"><span class="empty">尚未选择</span></div>
<div class="sel-name" id="selName">—</div>
<div class="sel-path" id="selPath">点击左侧卡片选择</div>
<div class="sizes">
<div class="size">
<div class="box s48"><img id="size48" alt="" src=""></div>
<span>48px</span>
</div>
<div class="size">
<div class="box s32"><img id="size32" alt="" src=""></div>
<span>32px</span>
</div>
</div>
<div class="actions">
<button class="primary" id="copyBtn" disabled>复制文件路径</button>
<button id="resetBtn" disabled>重新选择</button>
</div>
<div class="tip">
接入后会同步用于:个人中心、顶栏头像、评论区等默认头像位置。<br>
用户上传自定义头像不受影响。
</div>
</aside>
</div>
</div>
<div class="toast" id="toast"></div>
<script>
var AVATARS = [
{ file: 'avatar-line-01.svg', name: '墨蓝', color: '#3B5BDB', style: 'line' },
{ file: 'avatar-line-02.svg', name: '湖蓝', color: '#1C7ED6', style: 'line' },
{ file: 'avatar-line-03.svg', name: '青碧', color: '#0CA678', style: 'line' },
{ file: 'avatar-line-04.svg', name: '松绿', color: '#2F9E44', style: 'line' },
{ file: 'avatar-line-05.svg', name: '橄榄', color: '#74B816', style: 'line' },
{ file: 'avatar-line-06.svg', name: '琥珀', color: '#F08C00', style: 'line' },
{ file: 'avatar-line-07.svg', name: '珊瑚', color: '#E8590C', style: 'line' },
{ file: 'avatar-line-08.svg', name: '玫红', color: '#D6336C', style: 'line' },
{ file: 'avatar-line-09.svg', name: '紫罗兰', color: '#7048E8', style: 'line' },
{ file: 'avatar-line-10.svg', name: '石墨', color: '#495057', style: 'line' },
{ file: 'avatar-line-11.svg', name: '天青', color: '#1098AD', style: 'line' },
{ file: 'avatar-line-12.svg', name: '深青', color: '#0B7285', style: 'line' },
{ file: 'avatar-line-13.svg', name: '墨绿', color: '#087F5B', style: 'line' },
{ file: 'avatar-line-14.svg', name: '苔绿', color: '#5C940D', style: 'line' },
{ file: 'avatar-line-15.svg', name: '酒红', color: '#A61E4D', style: 'line' },
{ file: 'avatar-line-16.svg', name: '砖红', color: '#C92A2A', style: 'line' },
{ file: 'avatar-line-17.svg', name: '紫晶', color: '#9C36B5', style: 'line' },
{ file: 'avatar-line-18.svg', name: '蓝紫', color: '#5F3DC4', style: 'line' },
{ file: 'avatar-line-19.svg', name: '赭石', color: '#A0522D', style: 'line' },
{ file: 'avatar-line-20.svg', name: '玄黑', color: '#212529', style: 'line' },
{ file: 'avatar-bg-01.svg', name: '极光蓝紫', color: '#4C6EF5', style: 'bg' },
{ file: 'avatar-bg-02.svg', name: '晴空蓝', color: '#1C7ED6', style: 'bg' },
{ file: 'avatar-bg-03.svg', name: '青碧', color: '#0CA678', style: 'bg' },
{ file: 'avatar-bg-04.svg', name: '森野绿', color: '#2F9E44', style: 'bg' },
{ file: 'avatar-bg-05.svg', name: '落日橙', color: '#E8590C', style: 'bg' },
{ file: 'avatar-bg-06.svg', name: '莓果粉', color: '#D6336C', style: 'bg' },
{ file: 'avatar-bg-07.svg', name: '星云紫', color: '#7048E8', style: 'bg' },
{ file: 'avatar-bg-08.svg', name: '深海青', color: '#0B7285', style: 'bg' },
{ file: 'avatar-bg-09.svg', name: '石墨蓝', color: '#495057', style: 'bg' },
{ file: 'avatar-bg-10.svg', name: '赤陶红', color: '#C92A2A', style: 'bg' },
{ file: 'avatar-bg-11.svg', name: '紫藤', color: '#9C36B5', style: 'bg' },
{ file: 'avatar-bg-12.svg', name: '冰川青', color: '#1098AD', style: 'bg' },
{ file: 'avatar-bg-13.svg', name: '橄榄', color: '#5C940D', style: 'bg' },
{ file: 'avatar-bg-14.svg', name: '胭脂', color: '#A61E4D', style: 'bg' },
{ file: 'avatar-bg-15.svg', name: '海军蓝', color: '#3B5BDB', style: 'bg' },
{ file: 'avatar-bg-16.svg', name: '鸢尾紫', color: '#6D28D9', style: 'bg' },
{ file: 'avatar-bg-17.svg', name: '翡翠', color: '#087F5B', style: 'bg' },
{ file: 'avatar-bg-18.svg', name: '琥珀棕', color: '#B45309', style: 'bg' },
{ file: 'avatar-bg-19.svg', name: '午夜蓝', color: '#312E81', style: 'bg' },
{ file: 'avatar-bg-20.svg', name: '陨石灰', color: '#212529', style: 'bg' }
];
var STYLE_LABELS = { line: '线框半身 · 二十色', bg: '彩色背景 · 二十款' };
var selected = null;
var grid = document.getElementById('grid');
var toastTimer = null;
function pathOf(item) { return 'avatars/' + item.file; }
Object.keys(STYLE_LABELS).forEach(function (style) {
var list = AVATARS.map(function (item, index) { return { item: item, index: index }; })
.filter(function (entry) { return entry.item.style === style; });
if (!list.length) { return; }
var group = document.createElement('div');
group.className = 'group';
var title = document.createElement('div');
title.className = 'group-title';
title.textContent = STYLE_LABELS[style];
group.appendChild(title);
var inner = document.createElement('div');
inner.className = 'grid-inner';
list.forEach(function (entry) {
var item = entry.item;
var card = document.createElement('button');
card.type = 'button';
card.className = 'card';
card.innerHTML =
'<span class="check">✓</span>' +
'<span class="avatar' + (item.style === 'bg' ? ' bg-avatar' : '') + '"><img alt="' + item.name + '" src="' + pathOf(item) + '"></span>' +
'<span class="name"><i class="dot" style="background:' + item.color + '"></i>' + item.name + '</span>' +
'<span class="file">' + item.color + '</span>';
card.addEventListener('click', function () { select(entry.index); });
inner.appendChild(card);
});
group.appendChild(inner);
grid.appendChild(group);
});
function select(index) {
selected = AVATARS[index];
var cards = grid.querySelectorAll('.card');
for (var i = 0; i < cards.length; i++) {
cards[i].classList.toggle('active', i === index);
}
document.getElementById('preview').innerHTML =
'<img alt="' + selected.name + '" src="' + pathOf(selected) + '">';
document.getElementById('selName').textContent = selected.name + '(' + selected.color + ')';
document.getElementById('selPath').textContent = pathOf(selected);
document.getElementById('size48').src = pathOf(selected);
document.getElementById('size32').src = pathOf(selected);
document.getElementById('copyBtn').disabled = false;
document.getElementById('resetBtn').disabled = false;
}
function reset() {
selected = null;
var cards = grid.querySelectorAll('.card');
for (var i = 0; i < cards.length; i++) { cards[i].classList.remove('active'); }
document.getElementById('preview').innerHTML = '<span class="empty">尚未选择</span>';
document.getElementById('selName').textContent = '—';
document.getElementById('selPath').textContent = '点击左侧卡片选择';
document.getElementById('size48').removeAttribute('src');
document.getElementById('size32').removeAttribute('src');
document.getElementById('copyBtn').disabled = true;
document.getElementById('resetBtn').disabled = true;
}
function showToast(text) {
var toast = document.getElementById('toast');
toast.textContent = text;
toast.classList.add('show');
clearTimeout(toastTimer);
toastTimer = setTimeout(function () { toast.classList.remove('show'); }, 1600);
}
document.getElementById('resetBtn').addEventListener('click', reset);
document.getElementById('copyBtn').addEventListener('click', function () {
if (!selected) { return; }
var text = pathOf(selected);
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(function () { showToast('已复制:' + text); });
} else {
var ta = document.createElement('textarea');
ta.value = text;
document.body.appendChild(ta);
ta.select();
document.execCommand('copy');
document.body.removeChild(ta);
showToast('已复制:' + text);
}
});
</script>
</body>
</html>
+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#EEF2FF"/>
<stop offset="1" stop-color="#E0E7FF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="48" cy="48" r="36" fill="none" stroke="#4C6EF5" stroke-opacity="0.14" stroke-width="1.2"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#4C6EF5" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 690 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#E7F5FF"/>
<stop offset="1" stop-color="#D0EBFF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="30" cy="28" r="20" fill="#FFFFFF" fill-opacity="0.65"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#1C7ED6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 655 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#E6FCF5"/>
<stop offset="1" stop-color="#C3FAE8"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<path d="M18 66c10 8 22 12 36 12" fill="none" stroke="#0CA678" stroke-opacity="0.12" stroke-width="1.4" stroke-linecap="round"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#0CA678" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 716 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#EBFBEE"/>
<stop offset="1" stop-color="#D3F9D8"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="48" cy="48" r="36" fill="none" stroke="#2F9E44" stroke-opacity="0.14" stroke-width="1.2"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#2F9E44" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 690 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#FFF4E6"/>
<stop offset="1" stop-color="#FFE8CC"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="30" cy="28" r="20" fill="#FFFFFF" fill-opacity="0.65"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#E8590C" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 655 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#FFF0F6"/>
<stop offset="1" stop-color="#FFDEEB"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<path d="M18 66c10 8 22 12 36 12" fill="none" stroke="#D6336C" stroke-opacity="0.12" stroke-width="1.4" stroke-linecap="round"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#D6336C" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 716 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#F3F0FF"/>
<stop offset="1" stop-color="#E5DBFF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="48" cy="48" r="36" fill="none" stroke="#7048E8" stroke-opacity="0.14" stroke-width="1.2"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#7048E8" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 690 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#E3FAFC"/>
<stop offset="1" stop-color="#C5F6FA"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="30" cy="28" r="20" fill="#FFFFFF" fill-opacity="0.65"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#0B7285" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 655 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#F1F3F5"/>
<stop offset="1" stop-color="#E9ECEF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<path d="M18 66c10 8 22 12 36 12" fill="none" stroke="#495057" stroke-opacity="0.12" stroke-width="1.4" stroke-linecap="round"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#495057" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 716 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#FFF5F5"/>
<stop offset="1" stop-color="#FFE3E3"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="48" cy="48" r="36" fill="none" stroke="#C92A2A" stroke-opacity="0.14" stroke-width="1.2"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#C92A2A" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 690 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#F8F0FC"/>
<stop offset="1" stop-color="#F3D9FA"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="30" cy="28" r="20" fill="#FFFFFF" fill-opacity="0.65"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#9C36B5" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 655 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#E3FAFC"/>
<stop offset="1" stop-color="#D0EBFF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<path d="M18 66c10 8 22 12 36 12" fill="none" stroke="#1098AD" stroke-opacity="0.12" stroke-width="1.4" stroke-linecap="round"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#1098AD" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 716 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#F4FCE3"/>
<stop offset="1" stop-color="#E9FAC8"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="48" cy="48" r="36" fill="none" stroke="#5C940D" stroke-opacity="0.14" stroke-width="1.2"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#5C940D" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 690 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#FFF0F6"/>
<stop offset="1" stop-color="#FFE0E9"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="30" cy="28" r="20" fill="#FFFFFF" fill-opacity="0.65"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#A61E4D" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 655 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#EDF2FF"/>
<stop offset="1" stop-color="#DBE4FF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<path d="M18 66c10 8 22 12 36 12" fill="none" stroke="#3B5BDB" stroke-opacity="0.12" stroke-width="1.4" stroke-linecap="round"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#3B5BDB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 716 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#F3F0FF"/>
<stop offset="1" stop-color="#E5DBFF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="48" cy="48" r="36" fill="none" stroke="#6D28D9" stroke-opacity="0.14" stroke-width="1.2"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#6D28D9" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 690 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#E6FCF5"/>
<stop offset="1" stop-color="#D3F9D8"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="30" cy="28" r="20" fill="#FFFFFF" fill-opacity="0.65"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#087F5B" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 655 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#FFF9DB"/>
<stop offset="1" stop-color="#FFF3BF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<path d="M18 66c10 8 22 12 36 12" fill="none" stroke="#B45309" stroke-opacity="0.12" stroke-width="1.4" stroke-linecap="round"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#B45309" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 716 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#EDF2FF"/>
<stop offset="1" stop-color="#E0E7FF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="48" cy="48" r="36" fill="none" stroke="#312E81" stroke-opacity="0.14" stroke-width="1.2"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#312E81" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 690 B

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#F8F9FA"/>
<stop offset="1" stop-color="#E9ECEF"/>
</linearGradient>
</defs>
<circle cx="48" cy="48" r="48" fill="url(#g)"/>
<circle cx="30" cy="28" r="20" fill="#FFFFFF" fill-opacity="0.65"/>
<g transform="translate(19.2 19.2) scale(2.4)" fill="none" stroke="#212529" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 655 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#3B5BDB" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1C7ED6" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#0CA678" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#2F9E44" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#74B816" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#F08C00" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#E8590C" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#D6336C" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#7048E8" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#495057" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1098AD" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#0B7285" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#087F5B" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#5C940D" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#A61E4D" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#C92A2A" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#9C36B5" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#5F3DC4" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#A0522D" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#212529" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> <circle cx="12" cy="7" r="4" /></svg>

After

Width:  |  Height:  |  Size: 247 B

-93
View File
@@ -1,93 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>AI 赋能 · 设计说明 | 开发文档中心</title>
<link rel="stylesheet" href="assets/devdoc.css" />
</head>
<body>
<div class="topbar">
<a class="back" href="index.html">‹ 返回文档中心</a>
<span class="crumb">开发文档中心 / <b>AI 赋能</b></span>
</div>
<div class="page">
<div class="paper">
<h1>AI 赋能 · 设计说明</h1>
<p class="subtitle">AI 赋能矩阵的场景划分、NL2SQL 引擎、权限范围与算力体系。建档 2026-11-14,对应 <code>ruoyi-estate/ai</code>。</p>
<h2 id="matrix">一、矩阵与场景</h2>
<p>菜单 <strong>10509 AI 赋能矩阵</strong> 下挂三类助手,统一权限族 <code>estate:ai:*</code>,各场景只暴露与角色相关的入口。</p>
<table>
<thead><tr><th>助手</th><th>菜单</th><th>场景</th><th>解决什么问题</th></tr></thead>
<tbody>
<tr><td>AI 营销助手</td><td>10510</td><td>开单问数、业务简报、营销素材</td><td>经纪人快速拿数据、拿话术、拿成片</td></tr>
<tr><td>AI 经管助手</td><td>10511</td><td>门店罗盘、管理简报</td><td>店长/老板看目标达成、同比环比与下钻</td></tr>
<tr><td>AI 赋能助手</td><td>10512</td><td>话术陪练、培训、复盘、模板</td><td>新人训练、案例复用、经验沉淀</td></tr>
</tbody>
</table>
<div class="note">
<p><strong>设计原则:</strong>每个场景固定 <code>assistantType</code>,前端不能跨场景调用;提示词、可见视图与计费口径随场景收敛,避免“一个万能对话框”导致越权与答非所问。</p>
</div>
<h2 id="nl2sql">二、NL2SQL 与语义视图</h2>
<p>自然语言问数走「范围校验 → 语义 Prompt → 模型生成 SQL → 护栏校验 → 只读执行 → 结论」链路。模型只能看到 13 个语义视图,接触不到基表。</p>
<table>
<thead><tr><th>视图</th><th>业务域</th><th>关键字段</th></tr></thead>
<tbody>
<tr><td><code>v_bi_listing</code></td><td>房源</td><td>价格、面积、状态、区域、上架/成交时间</td></tr>
<tr><td><code>v_bi_customer</code></td><td>客源</td><td>脱敏姓名/手机、等级、来源、意向</td></tr>
<tr><td><code>v_bi_showing</code> / <code>v_bi_follow</code></td><td>带看/跟进</td><td>次数、时长、状态</td></tr>
<tr><td><code>v_bi_deal</code></td><td>成交</td><td>成交价、佣金、区域</td></tr>
<tr><td><code>v_bi_agent</code></td><td>经纪人</td><td>姓名、部门、状态</td></tr>
<tr><td><code>v_bi_contract</code></td><td>合同</td><td>编号、类型、金额、签署/起止日期</td></tr>
<tr><td><code>v_bi_receivable</code></td><td>应收</td><td>应收/实收/余额、账龄、逾期</td></tr>
<tr><td><code>v_bi_transaction</code> / <code>v_bi_transaction_node</code></td><td>交易</td><td>节点进度、风险、签约/完成</td></tr>
<tr><td><code>v_bi_project</code></td><td>楼盘</td><td>均价、销售状态、开盘/交房</td></tr>
<tr><td><code>v_bi_commission</code></td><td>佣金</td><td>佣金额、实收、状态</td></tr>
<tr><td><code>v_bi_price_log</code></td><td>调价</td><td>新旧售价/租金、原因</td></tr>
</tbody>
</table>
<h3>SQL 护栏</h3>
<ul>
<li>只允许单条 <code>SELECT</code>;禁止写操作、DDL、系统库、文件/网络函数。</li>
<li>必须包含 <code>tenant_id</code>、<code>dept_id</code>、<code>agent_id</code>,聚合查询按三者分组。</li>
<li>必须带 <code>stat_date BETWEEN ? AND ?</code>,防止全表扫描。</li>
<li>结果最多 500 行;服务端再叠加当前用户权限范围。</li>
</ul>
<h2>三、范围、脱敏与可追溯</h2>
<p>权限范围在服务端裁决,不依赖模型:平台管理员看全量;公司管理员看本公司;店长叠加部门子树;经纪人只看本人。</p>
<table>
<thead><tr><th>能力</th><th>实现要点</th></tr></thead>
<tbody>
<tr><td>范围收口</td><td><code>resolveAgentScope / resolveDeptScope / isCompanyAdmin</code>,部门子树用 <code>DEPT_SUBTREE_WHERE</code></td></tr>
<tr><td>PII 脱敏</td><td>视图内已脱敏手机号/姓名;审计 SQL 用 <code>maskPii(truncate(...))</code></td></tr>
<tr><td>数据截止</td><td>取 <code>MAX(stat_date)</code>,结果卡展示“数据截止”</td></tr>
<tr><td>多轮与纠错</td><td>携带历史消息;SQL 校验/执行失败自动给模型一次修正机会</td></tr>
<tr><td>稳定性</td><td>模型 429 / 5xx / IO 异常指数退避重试,最多 3 次</td></tr>
</tbody>
</table>
<h2 id="credit">四、算力、报告与定时简报</h2>
<h3>算力账户</h3>
<p><code>EstateAiCreditService</code> 按租户开户,调用前 <code>precheck</code> 校验余额,按场景记录用量;后台提供分场景用量统计,便于成本归因。</p>
<h3>报告归档</h3>
<p>问数结果可存为报告(<code>estate_bi_report</code>),支持明细导出与分享;报告按归属人/部门校验可见性,不能跨部门读取。</p>
<h3>定时简报</h3>
<div class="flow">
<span>创建定时任务</span><i>→</i><span>按周期生成简报</span><i>→</i><span>归档报告</span><i>→</i>
<span class="on">按渠道推送(企微)</span>
</div>
<p>任务表 <code>estate_bi_schedule</code>,支持手动「立即执行」;推送渠道为 <code>WECOM</code> 时调用企业微信 Webhook。目标管理表 <code>estate_ai_target</code> 记录周期目标,罗盘页展示达成率。</p>
<h2>五、营销素材任务</h2>
<p>素材任务把房源信息转成可发布的短视频:AI 改写口播文案 →(可选)TTS 生成配音 → ffmpeg 合成画面与音频。任务有明确状态与失败原因,支持重试与删除;删除时逐条校验租户归属,避免越权。</p>
<div class="note warn">
<p><strong>成本控制:</strong>TTS 为可选能力,未配置时自动跳过并保留纯文案成片;模型调用与算力扣减在同一事务边界外执行,失败不重复扣费。</p>
</div>
</div>
</div>
</body>
</html>
-116
View File
@@ -1,116 +0,0 @@
/* 开发文档详情页通用样式(与目录页同一视觉体系) */
:root {
--ink: #1f2329;
--ink-2: #5c6670;
--ink-3: #8a939e;
--line: #e6e9ee;
--bg: #f6f7f9;
--panel: #ffffff;
--brand: #2b6de5;
--brand-soft: #eef3fe;
--ok: #12805c;
--warn: #a16207;
--danger: #b42318;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
font-size: 14px;
line-height: 1.78;
-webkit-font-smoothing: antialiased;
}
.topbar {
position: sticky; top: 0; z-index: 20;
display: flex; align-items: center; gap: 14px;
padding: 10px 22px;
background: rgba(255,255,255,.94);
border-bottom: 1px solid var(--line);
backdrop-filter: blur(6px);
}
.topbar a.back {
display: inline-flex; align-items: center; gap: 6px;
padding: 5px 11px; border-radius: 7px;
color: var(--brand); background: var(--brand-soft);
font-size: 12.5px; text-decoration: none; white-space: nowrap;
}
.topbar a.back:hover { background: #e2ecff; }
.topbar .crumb { color: var(--ink-3); font-size: 12.5px; }
.topbar .crumb b { color: var(--ink-2); font-weight: 500; }
.page { max-width: 1020px; margin: 0 auto; padding: 30px 28px 80px; }
.paper {
background: var(--panel);
border: 1px solid var(--line);
border-radius: 12px;
padding: 34px 38px 44px;
}
h1 { margin: 0 0 8px; font-size: 25px; font-weight: 600; line-height: 1.4; }
.subtitle { margin: 0 0 22px; color: var(--ink-2); font-size: 13px; }
.subtitle code { background: #f2f4f7; border-radius: 3px; padding: 1px 5px; font-size: 12px; }
h2 {
margin: 38px 0 14px; padding-left: 11px;
font-size: 19px; font-weight: 600;
border-left: 4px solid var(--brand);
line-height: 1.4;
}
h2:first-of-type { margin-top: 6px; }
h3 { margin: 24px 0 8px; font-size: 15.5px; font-weight: 600; }
p { margin: 10px 0; }
ul, ol { margin: 8px 0; padding-left: 24px; }
li { margin: 4px 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-size: 12.3px; background: #f2f4f7; border-radius: 3px; padding: 1px 5px;
}
pre {
margin: 12px 0; padding: 14px 16px; overflow: auto;
background: #1f2430; border-radius: 8px; line-height: 1.65;
}
pre code { background: transparent; color: #e6e9ef; padding: 0; font-size: 12.3px; white-space: pre; }
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: #f8f9fb; font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: #fbfcfd; }
.note {
margin: 14px 0; padding: 11px 15px;
color: var(--ink-2); background: var(--brand-soft);
border-left: 3px solid var(--brand); border-radius: 5px; font-size: 13px;
}
.note p { margin: 3px 0; }
.note.warn { background: #fff8e8; border-left-color: #d99a1a; }
/* 状态流 / 步骤链 */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.flow span {
padding: 5px 12px; border-radius: 6px; font-size: 12.5px;
background: #f3f5f8; border: 1px solid var(--line); color: var(--ink-2);
}
.flow span.on { background: var(--brand-soft); border-color: #c7d9fb; color: var(--brand); font-weight: 600; }
.flow i { color: #c0c7d0; font-style: normal; }
/* 两列卡片 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.card h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; }
.card p { margin: 0; font-size: 12.8px; color: var(--ink-2); }
@media (max-width: 820px) {
.page { padding: 16px 12px 50px; }
.paper { padding: 22px 16px 30px; }
.grid { grid-template-columns: 1fr; }
.topbar { padding: 9px 12px; }
.topbar .crumb { display: none; }
}
@media print {
.topbar { display: none; }
body { background: #fff; }
.page { max-width: none; padding: 0; }
.paper { border: 0; padding: 0; }
}
-109
View File
@@ -1,109 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>基础业务 · 设计说明 | 开发文档中心</title>
<link rel="stylesheet" href="assets/devdoc.css" />
</head>
<body>
<div class="topbar">
<a class="back" href="index.html">‹ 返回文档中心</a>
<span class="crumb">开发文档中心 / <b>基础业务</b></span>
</div>
<div class="page">
<div class="paper">
<h1>基础业务 · 模块设计说明</h1>
<p class="subtitle">房源、客源、交易、薪酬四大业务域的模型、状态机与关键约定。建档 2026-09-20,对应代码 <code>ruoyi-estate</code>。</p>
<h2 id="listing">一、房源管理</h2>
<p>房源是交易链路的起点。主表 <code>estate_listing</code> 承载 57 个业务字段,另有扩展、举证、图片、审核、轨迹、调价、委托、钥匙、维护、成交等 11 张子表,按需写入,避免主表过宽。</p>
<h3>编码规则</h3>
<p>编码由系统生成:<code>{typeCode}{yyMM}{4 位序号}</code>,共 10 个字符,无前缀、无连字符,序号按月重置。</p>
<table>
<thead><tr><th>房源类型</th><th>typeCode</th><th>示例</th></tr></thead>
<tbody>
<tr><td>二手房(默认)</td><td>ES</td><td><code>ES26060001</code></td></tr>
<tr><td>商业房源</td><td>SY</td><td><code>SY26060001</code></td></tr>
<tr><td>新房</td><td>XF</td><td><code>XF26060001</code></td></tr>
</tbody>
</table>
<h3>状态机</h3>
<div class="flow">
<span>草稿 DRAFT</span><i>→</i><span>待举证 PENDING_EVIDENCE</span><i>→</i>
<span>待检核 PENDING_AUDIT</span><i>→</i><span class="on">有效 ACTIVE</span>
</div>
<div class="flow">
<span>有效</span><i>→</i><span>维护中 MAINTAINING</span>
<span>已成交 DEAL</span><span>暂缓 SUSPENDED</span><i>→</i><span>无效 INVALID</span>
</div>
<p>仅草稿状态允许提交;提交时校验楼盘、标题、售价/租金三项必填。有效房源才可对外展示与被带看。</p>
<h3>楼盘四级级联</h3>
<p>房源与楼盘字典通过 <code>projectId → buildingId → unitId → roomId</code> 关联。选择楼盘后动态加载栋座,再加载单元与房号;允许 <code>roomNoManual</code> 手填房号,兼容字典未建档的场景。</p>
<div class="note">
<p><strong>列表查询:</strong><code>selectListingList</code> 通过 LEFT JOIN 关联 6 张表,支持区域、栋座、单元、房号、价格区间、户型等多维筛选;新增筛选字段时需同步检查 SQL 与前端参数类型(如 <code>districtId</code> 必须为 Long)。</p>
</div>
<h2 id="customer">二、客源管理</h2>
<p>主表 <code>estate_customer</code>(36 个业务字段)+ 需求、跟进、带看、到访、匹配、分配日志、标签共 7 张子表。</p>
<h3>客户编码</h3>
<p>规则:<code>{渠道码}-{yyyyMM}-{5 位序号}</code>。渠道码包含 WL / PH / PT / WX / DY / RF / CM / NP / PP / OT 共 10 类。</p>
<h3>状态机与公客池</h3>
<div class="flow">
<span>新增 NEW</span><i>→</i><span>跟进中 FOLLOWING</span><i>→</i><span>意向 INTENT</span><i>→</i>
<span>带看中 SHOWING</span><i>→</i><span>议价中 NEGOTIATING</span><i>→</i><span class="on">成交 DEAL</span>
<span>流失 LOST</span>
</div>
<p>私客超时或手动释放进入公客池,其他经纪人可捡回;强制回收后从公客池移除。核心字段:<code>pool_status</code>、<code>private_expire</code>、<code>pool_drop_time</code>、<code>pool_drop_reason</code>、<code>prev_owner_id</code>。</p>
<h3>跟进计数联动</h3>
<table>
<thead><tr><th>操作</th><th>联动结果</th></tr></thead>
<tbody>
<tr><td>新增跟进</td><td><code>follow_count + 1</code>,刷新 <code>last_follow_time</code></td></tr>
<tr><td>首次带看</td><td><code>showing_count + 1</code>,刷新 <code>last_showing_time</code>,状态转 SHOWING</td></tr>
</tbody>
</table>
<h2 id="transaction">三、交易与合同</h2>
<p>交易主表 <code>estate_transaction</code> 串联房源、客户、合同、资金与佣金,子表覆盖节点、参与人、材料、售后等 8 类。</p>
<h3>节点推进</h3>
<p>交易以节点(<code>estate_transaction_node</code>)驱动:签约、网签、贷款、过户、缴税、交房。每个节点记录计划日期、实际日期、状态与是否关键节点;逾期天数由实际/计划日期计算,用于风险看板。</p>
<h3>合同</h3>
<p>合同记录合同编号、类型、金额、签署与生效日期。电子签场景下,签署方、签署流程、模板字段分别落在 <code>estate_contract_sign_flow</code>、<code>estate_contract_sign_party</code>、<code>estate_contract_template_field</code>。</p>
<h3>资金与应收</h3>
<p>资金台账记录收款/付款、支付方式与状态;成交报告中的 INCOME 类型佣金会自动同步到应收台账 <code>estate_commission_receivable</code>,避免二次录入。</p>
<h2 id="commission">四、薪酬结算</h2>
<p>共 8 张表:佣金规则、交易佣金、分成、折扣、折扣审批、结算单、结算明细、工资单。</p>
<h3>三级分成</h3>
<table>
<thead><tr><th>层级</th><th>splitType</th><th>接收方</th></tr></thead>
<tbody>
<tr><td>公司留存</td><td>COMPANY</td><td><code>recipientId = null</code></td></tr>
<tr><td>部门提留</td><td>DEPT</td><td><code>recipientDeptId</code></td></tr>
<tr><td>个人佣金</td><td>PERSONAL</td><td><code>recipientId</code></td></tr>
</tbody>
</table>
<p>分成状态使用 <code>'0'</code> 表示待结算;重算前先把旧记录标记为 <code>RECALCULATED</code>,再生成新分成,保留可追溯性。</p>
<h3>结算流程</h3>
<div class="flow">
<span>佣金记录 PENDING</span><i>→</i><span>已分成 SPLIT</span><i>→</i><span>已结算 SETTLED</span>
</div>
<div class="flow">
<span>结算单 DRAFT</span><i>→</i><span>待审批</span><i>→</i><span>已审批</span><i>→</i><span class="on">已支付</span>
</div>
<p>结算单生成条件:<code>split_status = '0'</code>、<code>settlement_id IS NULL</code>,按月份聚合。审批拒绝回到草稿;支付后生成工资单。</p>
<h2>五、跨模块约定</h2>
<ul>
<li>所有业务实体继承 <code>BaseEntity</code>,并显式声明 <code>tenantId</code>、<code>delFlag</code>。</li>
<li>DB 列下划线、Java 属性驼峰;Mapper XML 必须显式 <code>resultMap</code>(未开启驼峰自动转换)。</li>
<li>Date 字段必须带 <code>@JsonFormat(pattern, timezone = "GMT+8")</code>,否则日期会少一天。</li>
<li>列表查询的数据权限片段必须用 <code>&lt;if&gt;</code> 包裹,避免空条件生成 <code>WHERE AND</code>。</li>
<li>多表写入必须加 <code>@Transactional(rollbackFor = Exception.class)</code>。</li>
</ul>
</div>
</div>
</body>
</html>
-86
View File
@@ -1,86 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>外网营销 · 设计说明 | 开发文档中心</title>
<link rel="stylesheet" href="assets/devdoc.css" />
</head>
<body>
<div class="topbar">
<a class="back" href="index.html">‹ 返回文档中心</a>
<span class="crumb">开发文档中心 / <b>外网营销</b></span>
</div>
<div class="page">
<div class="paper">
<h1>外网营销 · 设计说明</h1>
<p class="subtitle">C 端获客、分享归因、企微直连与开放接口的链路设计。建档 2026-11-14,对应 <code>c-h5</code> / <code>capi</code>。</p>
<h2 id="acquire">一、C 端获客链路</h2>
<p>外网投放与转发最终都落在 C 端页面:小程序、H5、官网共用 <code>/house/c/**</code> 接口,页面侧由 <code>c-h5</code>(uni-app)承载。</p>
<table>
<thead><tr><th>页面</th><th>路由</th><th>作用</th></tr></thead>
<tbody>
<tr><td>房源/新盘列表</td><td><code>/pagesSub/newhouse/index</code></td><td>按城市、区域、关键词、价格等筛选</td></tr>
<tr><td>详情页</td><td><code>/pagesSub/newhouse/detail</code></td><td>价格、户型、配套、资质、咨询与分享</td></tr>
<tr><td>橱窗页</td><td><code>/pagesSub/newhouse/shop</code></td><td>按专员聚合的转发落地页</td></tr>
<tr><td>登录/注册</td><td><code>/pagesSub/auth/login</code></td><td>手机号 + 密码;未注册自动切注册</td></tr>
</tbody>
</table>
<h3>留资防刷</h3>
<ul>
<li>同一手机号 1 小时内最多 5 次留资(跨楼盘)。</li>
<li>同一 IP 1 小时内最多 20 次。 </li>
<li>同一手机号在同一去重窗口内对同一楼盘只记一条线索,防连点。</li>
<li><code>shareId</code> 只接受 <code>[A-Za-z0-9]{1,32}</code>,非法或已撤销直接忽略归因,但线索仍正常落库。</li>
</ul>
<div class="note">
<p><strong>开发环境:</strong><code>c-h5</code> 直连本地 capi(<code>http://localhost:8635</code>);生产同域走 Nginx 反代 <code>/house/c/</code>,前端 base 为空,避免本地 token 打到线上。</p>
</div>
<h2 id="attribution">二、分享归因</h2>
<p>分享是渠道获客的核心动作,归因必须能追溯到“谁分享、分享的什么、哪一次”。</p>
<h3>归因串规则</h3>
<pre><code>state = "channel_{cUserId}_{shareType}_{shareId}"
shareId = UUID 前 16 位(与微门店同规则)</code></pre>
<p><code>shareType</code> 区分房源/新盘/橱窗;落地页读取 <code>shareId</code> 并随咨询一并回传,线索扩展表 <code>estate_newhouse_lead_ext</code> 记录 <code>share_id</code> 与 <code>lead_code</code>。</p>
<h3>三条保护</h3>
<table>
<thead><tr><th>机制</th><th>规则</th><th>目的</th></tr></thead>
<tbody>
<tr><td>复用窗口</td><td>同一人同一对象短时间连点转发,复用同一个 shareId</td><td>避免归因被稀释</td></tr>
<tr><td>有效性校验</td><td>咨询时校验 shareId 存在且未撤销,否则忽略归因</td><td>防伪造、防过期链接分佣</td></tr>
<tr><td>主动撤销</td><td><code>/share/revoke</code> 按 shareId + 当前用户撤销</td><td>离职/换人后及时止损</td></tr>
</tbody>
</table>
<h2 id="wecom">三、企微直连</h2>
<p>客户在详情页点「加微信」时,不直接暴露手机号,而是走企微「联系我」二维码,归因串为 <code>channel_{sysUserId}</code>。</p>
<div class="flow">
<span>详情页点击加微信</span><i>→</i><span>capi 生成联系我链接</span><i>→</i>
<span>客户扫码添加</span><i>→</i><span class="on">回调按 state 建档并归属专员</span>
</div>
<p>企微未绑定或未配置时,前端自动降级为留资表单,保证联系路径始终可用。企微成员账号在 ERP「渠道用户 → 详情」中绑定/解绑,同一 userid 不允许绑定多个专员。</p>
<h2 id="openapi">四、开放 API 与外部渠道</h2>
<p>面向外部渠道/合作方提供接口时,使用独立的密钥与调用日志,不复用登录态。</p>
<table>
<thead><tr><th>能力</th><th>实现</th></tr></thead>
<tbody>
<tr><td>密钥管理</td><td><code>estate_open_api_key</code>,按租户签发,可停用</td></tr>
<tr><td>调用日志</td><td><code>estate_open_api_log</code>,记录路径、参数摘要、耗时、结果</td></tr>
<tr><td>权限</td><td><code>estate:openapi:*</code>,平台侧统一管理</td></tr>
<tr><td>数据边界</td><td>外部渠道只返回已授权字段,手机号等敏感信息脱敏</td></tr>
</tbody>
</table>
<div class="note warn">
<p><strong>边界:</strong>外部渠道账号属于「外部渠道体系」,与平台内部员工账号严格隔离;审核建号时若命中内部员工手机号会直接拒绝,防止内部账号被改挂到渠道体系。</p>
</div>
<h2>五、账号模型</h2>
<p>同一自然人可能同时拥有 C 端账号(<code>c_user</code>)与 B 端账号(<code>sys_user</code>),二者通过入驻申请单关联:C 端负责浏览、咨询与分享,B 端负责录盘、看线索与跟进。渠道数据统一落在专用租户 <strong>8</strong>,业务租户只读共享。</p>
</div>
</div>
</body>
</html>
-106
View File
@@ -1,106 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>底层设计 · 设计说明 | 开发文档中心</title>
<link rel="stylesheet" href="assets/devdoc.css" />
</head>
<body>
<div class="topbar">
<a class="back" href="index.html">‹ 返回文档中心</a>
<span class="crumb">开发文档中心 / <b>底层设计</b></span>
</div>
<div class="page">
<div class="paper">
<h1>底层设计 · 设计说明</h1>
<p class="subtitle">多租户、权限菜单、数据库迁移与构建部署的底座约定。建档 2026-11-14。</p>
<h2 id="tenant">一、多租户与数据隔离</h2>
<p>系统在一套库内通过 <code>tenant_id</code> 做逻辑隔离,三类租户职责不同:</p>
<table>
<thead><tr><th>租户</th><th>典型 ID</th><th>职责</th><th>数据可见范围</th></tr></thead>
<tbody>
<tr><td>平台</td><td>0</td><td>招募渠道、审核、全局运营</td><td>全量(查询不加租户过滤)</td></tr>
<tr><td>业务租户</td><td>3 / 7</td><td>门店经营、房源客源交易</td><td>本租户;新房广场只读共享</td></tr>
<tr><td>渠道租户</td><td>8</td><td>新房渠道专员与渠道新盘</td><td>本租户;不进入业务租户数据</td></tr>
</tbody>
</table>
<h3>写入与过滤</h3>
<ul>
<li>写:Service 层统一 <code>entity.setTenantId(当前登录用户租户)</code>,绕过 Service 直接调 Mapper 的场景也必须显式设置。</li>
<li>读:<code>injectTenantId()</code> 仅在 <code>tenantId &gt; 0</code> 时追加条件,平台管理员因此可看全量。</li>
<li>渠道账号统一落在租户 8;审核建号时若申请单租户不符,会自动纠正到 8。</li>
</ul>
<div class="note warn">
<p><strong>防越权:</strong>平台内部员工手机号不能作为渠道账号入驻;渠道账号只能复用「外部渠道体系」子树内的既有账号,避免内部账号被改挂。</p>
</div>
<h2 id="rbac">二、权限与菜单体系</h2>
<p>权限模型为 RBAC:用户 → 角色 → 菜单/按钮。后端用 <code>@PreAuthorize("@ss.hasPermi('...')")</code> 校验,前端用 <code>v-hasPermi</code> 控制按钮显隐。</p>
<table>
<thead><tr><th>菜单段</th><th>用途</th><th>授权口径</th></tr></thead>
<tbody>
<tr><td>8400-8406</td><td>新房智联(渠道用户/新盘/线索/录入/广场/区域)</td><td>平台全量;渠道租户最小权限;业务租户仅广场</td></tr>
<tr><td>9005 / 9006</td><td>佣金规则 / 我的工资</td><td>按租户与角色下发</td></tr>
<tr><td>10509-10512</td><td>AI 赋能矩阵及三类助手</td><td><code>estate:ai:*</code></td></tr>
<tr><td>10620-10623</td><td>平台配置 / 别名候选</td><td>仅超管(role_id = 1)</td></tr>
<tr><td>8200-8256</td><td>电子签(主体/经办人/合同)</td><td>平台与授权租户</td></tr>
</tbody>
</table>
<p>「平台配置 → 开发文档」同样只授予超管:文档含内部实现细节,不下发业务租户。</p>
<div class="note">
<p><strong>排查提示:</strong>若 <code>@PreAuthorize</code> 明明配了却不生效,先确认 <code>SecurityConfig</code> 的 <code>@EnableMethodSecurity(prePostEnabled)</code> 是否为 true;为 false 时所有方法级权限都会静默失效。</p>
</div>
<h2 id="migration">三、数据库迁移机制</h2>
<p>所有建表、加列、字典、菜单、种子数据都收敛在 <code>DatabaseMigration</code>,随应用启动执行,必须幂等。</p>
<table>
<thead><tr><th>场景</th><th>写法</th></tr></thead>
<tbody>
<tr><td>建表</td><td><code>CREATE TABLE IF NOT EXISTS</code></td></tr>
<tr><td>加列</td><td><code>addColumnIfAbsent(...)</code></td></tr>
<tr><td>加索引</td><td><code>addIndexIfAbsent(...)</code></td></tr>
<tr><td>字典/菜单/授权</td><td><code>INSERT IGNORE</code> + 唯一键</td></tr>
<tr><td>版本记录</td><td><code>recordVersion(...)</code>,已执行则跳过整库迁移</td></tr>
</tbody>
</table>
<h3>门禁外兜底</h3>
<p>老环境一旦记录过版本号,整库迁移会跳过。因此后续新增的菜单/字典/权限点必须放在「版本门禁之外」的幂等兜底方法里(如 <code>migrateNewHouseRegionAndDicts</code>、<code>migrateNewHousePermissionGrants</code>、<code>migrateQuickSaleAliasMenu</code>),保证老库重启也能补齐。</p>
<div class="note warn">
<p><strong>本地排查:</strong>若启动日志出现 <code>estate.migration.enabled=false, skip all startup migrations</code>,说明迁移被显式关闭,新增菜单不会自动写入,需要手工执行对应 SQL 或临时开启后重启。</p>
</div>
<h2 id="deploy">四、端口、构建与部署</h2>
<table>
<thead><tr><th>服务</th><th>端口</th><th>说明</th></tr></thead>
<tbody>
<tr><td>ruoyi-admin(后端)</td><td>8631</td><td>context-path <code>/zf</code></td></tr>
<tr><td>ruoyi-ui(WEB)</td><td>8632</td><td><code>/dev-api</code> 代理到 8631</td></tr>
<tr><td>zhenfang-uni(经纪人 H5)</td><td>8633</td><td>与 WEB 共用后端</td></tr>
<tr><td>capi(C 端接口)</td><td>8635</td><td><code>/house/c/**</code></td></tr>
<tr><td>c-h5(C 端 H5)</td><td>8637 起</td><td>被占用时自动顺延(如 8638)</td></tr>
</tbody>
</table>
<h3>发布顺序</h3>
<div class="flow">
<span>git pull 查冲突</span><i>→</i><span>commit</span><i>→</i><span>push</span><i>→</i>
<span>构建</span><i>→</i><span>上传</span><i>→</i><span class="on">部署校验</span>
</div>
<ul>
<li>前端:<code>deploy-web-zf.sh /home/ubuntu/zf-dist.zip &lt;commit&gt;</code>(只部署本项目,含品牌校验)</li>
<li>后端:<code>deploy-backend.sh /home/ubuntu/zf-jar-new.jar &lt;commit&gt;</code></li>
<li>校验:<code>version.json</code> 的 commit 与本次一致;<code>check-sites-zf.sh</code> 甄房域名全部 PASS。</li>
</ul>
<h2>五、跨端与静态资源</h2>
<ul>
<li>WEB 与经纪人 H5 共用后端接口,改动共享接口/表/字典/权限时,两端调用方都要检查。</li>
<li>C 端(c-h5 + capi)是独立链路,不复用 B 端登录态,JWT 密钥必须不同。</li>
<li>开发文档是纯静态页,放在 <code>ruoyi-ui/public/devdoc/</code>,随前端 dist 发布;菜单只挂 iframe 入口,不占用后端路由。</li>
</ul>
</div>
</div>
</body>
</html>
-300
View File
@@ -1,300 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>开发文档中心 · 甄房</title>
<style>
:root {
--ink: #1f2329;
--ink-2: #5c6670;
--ink-3: #8a939e;
--line: #e6e9ee;
--bg: #f6f7f9;
--panel: #ffffff;
--brand: #2b6de5;
--brand-soft: #eef3fe;
--nav: #ffffff;
--nav-2: #f1f4f8;
--nav-ink: #4b5563;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
font-size: 14px;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
.shell { display: flex; min-height: 100vh; align-items: stretch; }
/* ---------------- 左侧模块清单 ---------------- */
.side {
flex: 0 0 238px;
background: var(--nav);
color: var(--nav-ink);
border-right: 1px solid var(--line);
padding: 22px 12px 28px;
position: sticky;
top: 0;
align-self: flex-start;
height: 100vh;
overflow: auto;
}
.brand { padding: 0 10px 16px; border-bottom: 1px solid var(--line); }
.brand h1 { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); letter-spacing: .3px; }
.brand p { margin: 5px 0 0; font-size: 12px; color: var(--ink-3); }
.nav-label {
margin: 20px 10px 8px; font-size: 11px; letter-spacing: 1.2px;
color: var(--ink-3); text-transform: uppercase;
}
.cat {
display: flex; align-items: center; justify-content: space-between;
padding: 9px 12px; margin: 3px 0; border-radius: 7px;
color: var(--ink-2); cursor: pointer; user-select: none;
border-left: 3px solid transparent;
transition: background .15s, color .15s, border-color .15s;
}
.cat:hover { background: var(--nav-2); color: var(--ink); }
.cat.active { background: var(--brand-soft); color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.cat .name { font-size: 13.5px; }
.cat .count {
font-size: 11px; min-width: 20px; text-align: center;
padding: 1px 6px; border-radius: 10px;
background: #eef1f5; color: var(--ink-3);
}
.cat.active .count { background: #d9e6fd; color: var(--brand); }
.side-foot { margin: 22px 10px 0; font-size: 11px; color: var(--ink-3); line-height: 1.8; }
/* ---------------- 右侧文档列表 ---------------- */
.main { flex: 1 1 auto; min-width: 0; padding: 26px 30px 56px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.head .sub { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.search { position: relative; }
.search input {
width: 260px; height: 36px; padding: 0 12px 0 34px;
border: 1px solid var(--line); border-radius: 8px; background: #fff;
font-size: 13px; color: var(--ink); outline: none;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search svg { position: absolute; left: 11px; top: 10px; width: 15px; height: 15px; fill: var(--ink-3); }
.stats { display: flex; gap: 26px; margin: 18px 0 6px; padding: 14px 18px;
background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.stat b { font-size: 18px; font-weight: 600; }
.stat span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.group { margin-top: 26px; }
.group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.group-title h3 { margin: 0; font-size: 15px; font-weight: 600; }
.group-title .bar { width: 3px; height: 15px; background: var(--brand); border-radius: 2px; }
.group-title .n { font-size: 12px; color: var(--ink-3); }
.doc {
display: grid;
grid-template-columns: 112px 150px 1fr 26px;
align-items: center;
gap: 14px;
padding: 14px 18px;
margin-bottom: 8px;
background: var(--panel);
border: 1px solid var(--line);
border-radius: 10px;
cursor: pointer;
transition: border-color .15s, box-shadow .15s, transform .15s;
}
.doc:hover { border-color: #b9cdf6; box-shadow: 0 4px 14px rgba(43,109,229,.08); transform: translateY(-1px); }
.doc .date { color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.doc .module { font-size: 13px; font-weight: 600; color: var(--ink); }
.doc .summary { color: var(--ink-2); font-size: 12.8px; line-height: 1.65; }
.doc .arrow { color: #b7c0cb; font-size: 18px; text-align: right; transition: color .15s, transform .15s; }
.doc:hover .arrow { color: var(--brand); transform: translateX(2px); }
.empty { padding: 60px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
@media (max-width: 900px) {
.shell { display: block; }
.side { position: static; height: auto; width: 100%; padding: 14px; }
.brand { padding-bottom: 12px; }
.nav-label { display: none; }
.cat { display: inline-flex; gap: 8px; margin: 4px 6px 0 0; padding: 7px 12px; }
.side-foot { display: none; }
.main { padding: 18px 14px 40px; }
.search input { width: 100%; }
.doc { grid-template-columns: 96px 1fr 20px; }
.doc .summary { grid-column: 1 / -1; }
}
</style>
</head>
<body>
<div class="shell">
<aside class="side">
<div class="brand">
<h1>开发文档中心</h1>
<p>甄房 · 产品与技术设计库</p>
</div>
<div class="nav-label">模块清单</div>
<div id="nav"></div>
<div class="side-foot">
文档随前端发布,与代码同版本。<br />
仅平台管理员可见。
</div>
</aside>
<main class="main">
<div class="head">
<div>
<h2 id="pageTitle">全部文档</h2>
<p class="sub" id="pageSub">按业务模块归档的设计方案、流程说明与底层规范。</p>
</div>
<div class="search">
<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.49 4.49 0 0 1 9.5 14z"/></svg>
<input id="q" type="search" placeholder="搜索模块或关键词" autocomplete="off" />
</div>
</div>
<div class="stats">
<div class="stat"><b id="statDocs">0</b><span>文档总数</span></div>
<div class="stat"><b id="statCats">0</b><span>模块分类</span></div>
<div class="stat"><b id="statDate">—</b><span>最近建档</span></div>
</div>
<div id="list"></div>
</main>
</div>
<script>
/* 文档清单:日期 / 模块 / 说明 / 详情页 */
var CATS = [
{ id: 'base', name: '基础业务' },
{ id: 'newhouse', name: '新房业务' },
{ id: 'marketing', name: '外网营销' },
{ id: 'ai', name: 'AI 赋能' },
{ id: 'foundation',name: '底层设计' }
];
var DOCS = [
/* 基础业务 */
{ cat: 'base', date: '2026-09-20', module: '房源管理', summary: '二手房 / 商业 / 新房三态录入、状态机、楼盘四级级联、媒体与委托管理。', url: 'base-business.html#listing' },
{ cat: 'base', date: '2026-09-20', module: '客源管理', summary: '客户建档、公私客池流转、跟进与带看计数联动、标签与分配日志。', url: 'base-business.html#customer' },
{ cat: 'base', date: '2026-09-20', module: '交易与合同', summary: '交易节点推进、合同签署、资金台账与应收同步。', url: 'base-business.html#transaction' },
{ cat: 'base', date: '2026-09-20', module: '薪酬结算', summary: '佣金规则、公司/部门/个人三级分成、结算单与工资单。', url: 'base-business.html#commission' },
/* 新房业务 */
{ cat: 'newhouse', date: '2026-11-12', module: '业务全流程', summary: '入驻 → 录盘 → 审核 → 分发 → 咨询 → 线索 → 转客源,覆盖四端全链路与状态机。', url: 'newhouse-business-flows/index.html' },
{ cat: 'newhouse', date: '2026-10-10', module: '调研与设计方案', summary: '命名方案、需求拆解、行业调研、账号模型(专用租户 8)与数据模型。', url: 'newhouse-design.html' },
{ cat: 'newhouse', date: '2026-11-14', module: '渠道入驻与建号', summary: 'C 端申请、平台审核、建 sys_user 入组织架构、停用恢复与企微绑定。', url: 'newhouse-business-flows/index.html#onboarding' },
{ cat: 'newhouse', date: '2026-11-14', module: '新盘审核与上下架', summary: 'PENDING / AUDITED / OFF_SHELF / REJECTED 状态机、批量审核与回收站。', url: 'newhouse-business-flows/index.html#audit' },
{ cat: 'newhouse', date: '2026-11-14', module: '线索与转客源', summary: '两类线索来源、跟进五态、转派、转正式客源与查看日志。', url: 'newhouse-business-flows/index.html#lead' },
/* 外网营销 */
{ cat: 'marketing', date: '2026-11-14', module: 'C 端获客链路', summary: '小程序 / H5 浏览、留资、企微直连,频控与去重策略。', url: 'external-marketing.html#acquire' },
{ cat: 'marketing', date: '2026-11-14', module: '分享归因', summary: 'state 归因串、shareId 白名单校验、分享复用窗口与防伪造。', url: 'external-marketing.html#attribution' },
{ cat: 'marketing', date: '2026-11-14', module: '开放 API 与外部渠道', summary: '开放式接口密钥、调用日志、外部渠道体系与数据边界。', url: 'external-marketing.html#openapi' },
/* AI 赋能 */
{ cat: 'ai', date: '2026-11-14', module: 'AI 赋能矩阵', summary: 'AI 营销助手 / 经管助手 / 赋能助手三类场景与菜单结构。', url: 'ai-enable.html#matrix' },
{ cat: 'ai', date: '2026-11-14', module: 'NL2SQL 与语义视图', summary: '13 个 v_bi_* 视图、SQL 护栏、权限范围收口与多轮纠错。', url: 'ai-enable.html#nl2sql' },
{ cat: 'ai', date: '2026-11-14', module: '算力与定时简报', summary: '算力账户计费、报告归档、定时任务与企业微信推送。', url: 'ai-enable.html#credit' },
/* 底层设计 */
{ cat: 'foundation', date: '2026-11-14', module: '多租户与数据隔离', summary: 'tenant_id 注入、平台 / 业务租户 / 渠道租户 8 的边界与只读共享。', url: 'foundation.html#tenant' },
{ cat: 'foundation', date: '2026-11-14', module: '权限与菜单体系', summary: 'RBAC、@PreAuthorize、菜单 8400 / 10509 / 10620 的授权口径。', url: 'foundation.html#rbac' },
{ cat: 'foundation', date: '2026-11-14', module: '数据库迁移机制', summary: 'DatabaseMigration 幂等建表、字典、菜单与版本门禁。', url: 'foundation.html#migration' },
{ cat: 'foundation', date: '2026-11-14', module: '构建、端口与部署', summary: '8631 / 8632 / 8635 / 8637 端口约定、统一部署脚本与上线校验。', url: 'foundation.html#deploy' },
{ cat: 'foundation', date: '2026-11-15', module: '一级菜单图标选型', summary: '每个一级菜单 10 个候选图标,跨概念 / 跨线条风格对照,点击即复制 SVG 源码。', url: 'menu-icons/index.html' },
{ cat: 'foundation', date: '2026-11-15', module: '默认头像素材库', summary: '线框半身 20 色 + 浅色渐变背景 20 款,含色值、文件清单、随机分配与兜底规则。', url: 'avatars.html' }
];
(function () {
var state = { cat: 'all', q: '' };
var navEl = document.getElementById('nav');
var listEl = document.getElementById('list');
function esc(s) {
return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) {
return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c];
});
}
function renderNav() {
var html = '<div class="cat' + (state.cat === 'all' ? ' active' : '') + '" data-cat="all">' +
'<span class="name">全部文档</span><span class="count">' + DOCS.length + '</span></div>';
CATS.forEach(function (c) {
var n = DOCS.filter(function (d) { return d.cat === c.id; }).length;
html += '<div class="cat' + (state.cat === c.id ? ' active' : '') + '" data-cat="' + c.id + '">' +
'<span class="name">' + esc(c.name) + '</span><span class="count">' + n + '</span></div>';
});
navEl.innerHTML = html;
}
function renderList() {
var q = state.q.trim().toLowerCase();
var items = DOCS.filter(function (d) {
if (state.cat !== 'all' && d.cat !== state.cat) return false;
if (!q) return true;
return (d.module + ' ' + d.summary + ' ' + d.date).toLowerCase().indexOf(q) >= 0;
});
if (!items.length) {
listEl.innerHTML = '<div class="empty">没有匹配的文档</div>';
return;
}
var groups = state.cat === 'all' ? CATS : CATS.filter(function (c) { return c.id === state.cat; });
var html = '';
groups.forEach(function (c) {
var rows = items.filter(function (d) { return d.cat === c.id; });
if (!rows.length) return;
html += '<section class="group"><div class="group-title"><span class="bar"></span><h3>' +
esc(c.name) + '</h3><span class="n">' + rows.length + ' 篇</span></div>';
rows.forEach(function (d) {
html += '<div class="doc" data-url="' + esc(d.url) + '">' +
'<div class="date">' + esc(d.date) + '</div>' +
'<div class="module">' + esc(d.module) + '</div>' +
'<div class="summary">' + esc(d.summary) + '</div>' +
'<div class="arrow">›</div></div>';
});
html += '</section>';
});
listEl.innerHTML = html;
Array.prototype.forEach.call(listEl.querySelectorAll('.doc'), function (el) {
el.addEventListener('click', function () { window.location.href = el.getAttribute('data-url'); });
});
}
function renderHead() {
var all = state.cat === 'all';
var name = all ? '全部文档' : (CATS.filter(function (c) { return c.id === state.cat; })[0] || {}).name;
document.getElementById('pageTitle').textContent = name;
document.getElementById('pageSub').textContent = all
? '按业务模块归档的设计方案、流程说明与底层规范。'
: '当前模块下的设计文档,点击条目查看详情。';
}
navEl.addEventListener('click', function (e) {
var el = e.target.closest('.cat');
if (!el) return;
state.cat = el.getAttribute('data-cat');
renderNav(); renderHead(); renderList();
});
document.getElementById('q').addEventListener('input', function (e) {
state.q = e.target.value || '';
renderList();
});
document.getElementById('statDocs').textContent = DOCS.length;
document.getElementById('statCats').textContent = CATS.length;
document.getElementById('statDate').textContent = DOCS.map(function (d) { return d.date; }).sort().pop();
renderNav(); renderHead(); renderList();
})();
</script>
</body>
</html>
-275
View File
@@ -1,275 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>系统加载动画方案 · 甄房</title>
<style>
:root { --brand: #0070f2; --brand-bright: #2f72ff; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: #0d131c; color: #e8eef7;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}
.toolbar {
position: sticky; top: 0; z-index: 99;
display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
padding: 12px 18px; background: rgba(13, 20, 30, .94);
border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(8px);
}
.toolbar h1 { margin: 0; font-size: 15px; font-weight: 600; }
.toolbar .sub { font-size: 12px; color: #7f8ea3; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
padding: 6px 13px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
color: #aab7c7; background: rgba(255,255,255,.06); border: 1px solid transparent; transition: .16s;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.12); }
.tab.active { color: #fff; background: var(--brand); }
.toolbar button.replay {
margin-left: auto; padding: 7px 15px; border-radius: 8px; cursor: pointer;
border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; font-size: 12.5px;
}
.toolbar button.replay:hover { background: rgba(255,255,255,.16); }
main { padding: 18px; }
.stage {
position: relative; height: calc(100vh - 86px); min-height: 560px;
border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.09);
display: none; isolation: isolate;
}
.stage.active { display: block; }
/* 加载层通用 */
.loading-layer {
position: absolute; inset: 0; z-index: 5;
display: flex; flex-direction: column; align-items: center; justify-content: center;
gap: 18px;
}
.load-title { font-size: 15px; letter-spacing: 2px; opacity: .92; }
.load-sub { font-size: 11.5px; opacity: .55; letter-spacing: 1px; }
/* ========== 1. 品牌脉冲 ========== */
.s1 { background: radial-gradient(120% 120% at 50% 35%, #103a6b 0%, #0a1c33 55%, #060f1a 100%); }
.s1 .pulse-wrap { position: relative; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; }
.s1 .ring {
position: absolute; inset: 0; border-radius: 50%;
border: 2px solid rgba(80, 160, 255, .35); animation: s1ring 2s ease-out infinite;
}
.s1 .ring.r2 { animation-delay: .7s; }
.s1 .ring.r3 { animation-delay: 1.4s; }
.s1 .core {
width: 50px; height: 50px; border-radius: 15px;
background: linear-gradient(145deg, #2f72ff, #0070f2);
display: flex; align-items: center; justify-content: center;
font-size: 24px; font-weight: 700; color: #fff;
box-shadow: 0 10px 30px rgba(0,112,242,.55);
animation: s1pulse 2s ease-in-out infinite;
}
.s1 .core img { width: 28px; height: 28px; object-fit: contain; }
@keyframes s1ring { 0% { transform: scale(.75); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes s1pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
/* ========== 2. 双门帘 + 圆环(现有方案优化) ========== */
.s2 { background: #0a2b52; }
.s2 .curtain { position: absolute; top: 0; bottom: 0; width: 51%; background: linear-gradient(180deg, #0a2b52, #071a30); }
.s2 .curtain.left { left: 0; }
.s2 .curtain.right { right: 0; }
.s2 .spinner {
width: 46px; height: 46px; border-radius: 50%;
border: 3px solid rgba(255,255,255,.12); border-top-color: #4d9bff;
animation: s2spin 1s linear infinite;
}
.s2 .bar { width: 180px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.s2 .bar i { display: block; height: 100%; width: 40%; border-radius: 2px; background: linear-gradient(90deg, #0070f2, #58b6ff); animation: s2load 1.6s ease-in-out infinite; }
@keyframes s2spin { to { transform: rotate(360deg); } }
@keyframes s2load { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
/* ========== 3. 三点跳动 ========== */
.s3 { background: linear-gradient(160deg, #f4f8ff 0%, #e8f0fb 100%); color: #1f2329; }
.s3 .load-title { color: #3d4a5c; }
.s3 .load-sub { color: #8a939e; }
.s3 .dots { display: flex; gap: 10px; }
.s3 .dots i {
width: 13px; height: 13px; border-radius: 50%;
background: linear-gradient(145deg, #2f72ff, #0070f2);
animation: s3bounce 1.1s ease-in-out infinite;
}
.s3 .dots i:nth-child(2) { animation-delay: .16s; }
.s3 .dots i:nth-child(3) { animation-delay: .32s; }
.s3 .bar { width: 220px; height: 4px; border-radius: 4px; background: #dbe6f5; overflow: hidden; }
.s3 .bar i { display: block; height: 100%; width: 35%; background: linear-gradient(90deg, #0070f2, #61a9ff); animation: s3load 1.5s ease-in-out infinite; }
@keyframes s3bounce { 0%,80%,100% { transform: translateY(0); opacity: .6; } 40% { transform: translateY(-13px); opacity: 1; } }
@keyframes s3load { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
/* ========== 4. 房屋描边 ========== */
.s4 { background: linear-gradient(150deg, #081c33 0%, #0c2a4a 60%, #0a1a2b 100%); }
.s4 svg.house { width: 108px; height: 108px; }
.s4 svg.house path, .s4 svg.house polyline, .s4 svg.house rect {
fill: none; stroke: #58b6ff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
stroke-dasharray: 320; stroke-dashoffset: 320;
animation: s4draw 2.4s ease-in-out infinite;
}
.s4 svg.house .door { animation-delay: .5s; }
.s4 .glow { position: absolute; width: 260px; height: 260px; border-radius: 50%;
background: radial-gradient(circle, rgba(0,112,242,.28), transparent 65%); filter: blur(8px); }
@keyframes s4draw { 0% { stroke-dashoffset: 320; } 45%, 75% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -320; } }
/* ========== 5. 方块波浪 ========== */
.s5 { background: #071827; }
.s5 .grid { display: flex; gap: 8px; }
.s5 .grid i {
width: 14px; height: 34px; border-radius: 4px;
background: linear-gradient(180deg, #58b6ff, #0070f2);
animation: s5wave 1.2s ease-in-out infinite;
}
.s5 .grid i:nth-child(1) { animation-delay: 0s; }
.s5 .grid i:nth-child(2) { animation-delay: .1s; }
.s5 .grid i:nth-child(3) { animation-delay: .2s; }
.s5 .grid i:nth-child(4) { animation-delay: .3s; }
.s5 .grid i:nth-child(5) { animation-delay: .4s; }
@keyframes s5wave { 0%,100% { transform: scaleY(.45); opacity: .45; } 50% { transform: scaleY(1); opacity: 1; } }
/* ========== 6. 极简百分比 ========== */
.s6 { background: #f7f9fc; color: #1f2329; }
.s6 .load-title { color: #3d4a5c; font-size: 14px; }
.s6 .pct { font-size: 40px; font-weight: 300; letter-spacing: 1px; color: #0070f2; font-variant-numeric: tabular-nums; }
.s6 .pct small { font-size: 14px; font-weight: 500; margin-left: 3px; color: #8a939e; }
.s6 .bar { width: 260px; height: 3px; border-radius: 3px; background: #e2e9f3; overflow: hidden; }
.s6 .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #0070f2, #61a9ff); border-radius: 3px; animation: s6fill 2.4s ease-in-out infinite; }
@keyframes s6fill { 0% { width: 0; } 70% { width: 88%; } 100% { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .stage * { animation: none !important; } }
</style>
</head>
<body>
<header class="toolbar">
<h1>系统加载动画</h1>
<span class="sub">登录后 / 刷新时的全屏加载层 · 6 套</span>
<div class="tabs" id="tabs"></div>
<button class="replay" id="replay">重播动画</button>
</header>
<main id="stages"></main>
<script>
const THEMES = [
{ id: 1, name: '品牌脉冲', file: '1. 品牌脉冲' },
{ id: 2, name: '圆环 + 进度', file: '2. 圆环 = 现有方案优化' },
{ id: 3, name: '三点跳动', file: '3. 三点跳动(浅色)' },
{ id: 4, name: '房屋描边', file: '4. 房屋描边绘制' },
{ id: 5, name: '方块波浪', file: '5. 方块波浪' },
{ id: 6, name: '极简百分比', file: '6. 极简百分比(浅色)' }
];
function content(id) {
if (id === 1) {
return `<div class="loading-layer">
<div class="pulse-wrap"><span class="ring"></span><span class="ring r2"></span><span class="ring r3"></span>
<div class="core"><img src="/logo-loader.png" alt="甄房" /></div></div>
<div class="load-title">正在进入甄房</div>
<div class="load-sub">房源 · 客源 · 交易 · 新房智联</div>
</div>`;
}
if (id === 2) {
return `<div class="curtain left"></div><div class="curtain right"></div>
<div class="loading-layer"><div class="spinner"></div>
<div class="load-title">正在加载系统资源</div>
<div class="bar"><i></i></div>
<div class="load-sub">请耐心等待</div>
</div>`;
}
if (id === 3) {
return `<div class="loading-layer">
<div class="dots"><i></i><i></i><i></i></div>
<div class="load-title">正在加载数据</div>
<div class="bar"><i></i></div>
<div class="load-sub">甄房 · 专业房产经纪服务平台</div>
</div>`;
}
if (id === 4) {
return `<div class="glow"></div>
<div class="loading-layer">
<svg class="house" viewBox="0 0 100 100">
<path d="M12 46 L50 16 L88 46" />
<polyline points="22,44 22,84 78,84 78,44" />
<path class="door" d="M42 84 L42 62 L58 62 L58 84" />
</svg>
<div class="load-title">正在构建您的房产工作台</div>
<div class="load-sub">甄房 · ZHENFANG</div>
</div>`;
}
if (id === 5) {
return `<div class="loading-layer">
<div class="grid"><i></i><i></i><i></i><i></i><i></i></div>
<div class="load-title">系统初始化中</div>
<div class="load-sub">正在连接数据服务</div>
</div>`;
}
return `<div class="loading-layer">
<div class="pct" id="pct">0<small>%</small></div>
<div class="bar"><i></i></div>
<div class="load-title">正在加载系统资源</div>
<div class="load-sub">甄房 · 专业房产经纪服务平台</div>
</div>`;
}
const tabs = document.getElementById('tabs');
const stages = document.getElementById('stages');
THEMES.forEach((t, index) => {
const tab = document.createElement('div');
tab.className = 'tab' + (index === 0 ? ' active' : '');
tab.textContent = t.name;
tab.dataset.target = 'stage-' + t.id;
tabs.appendChild(tab);
const stage = document.createElement('section');
stage.className = 'stage s' + t.id + (index === 0 ? ' active' : '');
stage.id = 'stage-' + t.id;
stage.dataset.theme = t.id;
stage.innerHTML = content(t.id);
stages.appendChild(stage);
});
tabs.addEventListener('click', e => {
const tab = e.target.closest('.tab');
if (!tab) return;
Array.from(tabs.children).forEach(t => t.classList.toggle('active', t === tab));
Array.from(stages.children).forEach(s => s.classList.toggle('active', s.id === tab.dataset.target));
startCounter();
restart();
});
/* 百分比数字动画(方案 6) */
let counterTimer = null;
function startCounter() {
if (counterTimer) { clearInterval(counterTimer); counterTimer = null; }
const stage = document.querySelector('.stage.active');
if (!stage || stage.dataset.theme !== '6') return;
const el = stage.querySelector('#pct');
if (!el) return;
let value = 0;
counterTimer = setInterval(() => {
value = value >= 100 ? 0 : value + 1;
el.innerHTML = value + '<small>%</small>';
}, 24);
}
/* 重播:移除再插入节点,强制重启动画 */
function restart() {
const stage = document.querySelector('.stage.active');
if (!stage) return;
const layer = stage.querySelector('.loading-layer');
if (!layer) return;
const copy = layer.cloneNode(true);
layer.parentNode.replaceChild(copy, layer);
startCounter();
}
document.getElementById('replay').addEventListener('click', restart);
startCounter();
</script>
</body>
</html>
-426
View File
@@ -1,426 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>登录页动效方案预览 · 甄房</title>
<style>
:root {
--brand: #0070f2;
--brand-bright: #2f72ff;
--ink: #1f2329;
--ink-2: #5c6670;
--line: #e6e9ee;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: #0f1620;
color: #e8eef7;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}
/* ---------- 工具栏 ---------- */
.toolbar {
position: sticky; top: 0; z-index: 99;
display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
padding: 12px 18px;
background: rgba(13, 20, 30, .92);
border-bottom: 1px solid rgba(255,255,255,.08);
backdrop-filter: blur(8px);
}
.toolbar h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.toolbar .sub { font-size: 12px; color: #7f8ea3; margin-right: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
padding: 6px 13px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
color: #aab7c7; background: rgba(255,255,255,.06); border: 1px solid transparent;
transition: .16s;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.12); }
.tab.active { color: #fff; background: var(--brand); border-color: rgba(255,255,255,.2); }
/* ---------- 舞台 ---------- */
main { padding: 18px; }
.stage {
position: relative;
height: calc(100vh - 86px);
min-height: 620px;
border-radius: 16px;
overflow: hidden;
border: 1px solid rgba(255,255,255,.09);
display: none;
isolation: isolate;
}
.stage.active { display: block; }
/* ---------- 登录卡片(所有方案共用结构) ---------- */
.login-wrap {
position: relative; z-index: 5;
height: 100%;
display: flex; align-items: center; justify-content: center;
padding: 28px;
}
.login-card {
width: min(940px, 100%);
min-height: 480px;
display: grid;
grid-template-columns: 1.05fr .95fr;
border-radius: 18px;
overflow: hidden;
background: rgba(255,255,255,.97);
box-shadow: 0 30px 80px rgba(0, 18, 42, .38);
}
.brand-side {
position: relative;
padding: 46px 42px;
color: #fff;
background: linear-gradient(150deg, #0b2b56 0%, #0f4c8f 55%, #0070f2 100%);
display: flex; flex-direction: column; justify-content: center;
overflow: hidden;
}
.brand-side::after {
content: ""; position: absolute; right: -60px; bottom: -80px;
width: 260px; height: 260px; border-radius: 50%;
background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%);
}
.logo-badge {
width: 46px; height: 46px; border-radius: 13px;
display: flex; align-items: center; justify-content: center;
font-size: 22px; font-weight: 700; color: #0b2b56;
background: linear-gradient(145deg, #fff, #d7e7ff);
box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.brand-side h1 { margin: 18px 0 6px; font-size: 30px; letter-spacing: 2px; }
.brand-side .slogan { margin: 0; font-size: 13.5px; color: rgba(255,255,255,.82); letter-spacing: 1px; }
.brand-points { margin: 30px 0 0; padding: 0; list-style: none; }
.brand-points li {
display: flex; align-items: center; gap: 9px;
margin: 11px 0; font-size: 13px; color: rgba(255,255,255,.9);
}
.brand-points i {
width: 17px; height: 17px; border-radius: 50%;
background: rgba(255,255,255,.18); display: inline-flex;
align-items: center; justify-content: center; font-style: normal; font-size: 10px;
}
.form-side { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.form-side h2 { margin: 0 0 6px; font-size: 22px; color: var(--ink); }
.form-side .tip { margin: 0 0 26px; font-size: 12.5px; color: #8a939e; }
.field {
height: 44px; border: 1px solid var(--line); border-radius: 9px;
display: flex; align-items: center; padding: 0 14px; margin-bottom: 14px;
color: #98a2b0; font-size: 13px; background: #fbfcfe;
}
.field.focus { border-color: #9cc2ff; background: #fff; box-shadow: 0 0 0 3px rgba(0,112,242,.08); }
.form-row { display: flex; justify-content: space-between; font-size: 12.5px; color: #7d8794; margin: 2px 0 20px; }
.form-row a { color: var(--brand); text-decoration: none; }
.login-btn {
height: 46px; border-radius: 23px; border: 0; cursor: pointer;
color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 3px;
background: linear-gradient(90deg, #0070f2, #2f72ff);
box-shadow: 0 10px 24px rgba(0,112,242,.28);
}
.login-btn:hover { filter: brightness(1.04); }
.form-foot { margin-top: 18px; text-align: center; font-size: 11.5px; color: #a3adb9; }
@media (max-width: 860px) {
.login-card { grid-template-columns: 1fr; min-height: auto; }
.brand-side { padding: 30px 26px; }
.brand-points { display: none; }
.form-side { padding: 28px 24px 34px; }
.stage { height: auto; min-height: 0; }
}
/* ================= 方案 1:星海微光 ================= */
.stage[data-theme="1"] { background: radial-gradient(120% 120% at 15% 10%, #12325c 0%, #0a1728 45%, #060d17 100%); }
.t1-grid {
position: absolute; inset: 0;
background-image: linear-gradient(rgba(120,180,255,.07) 1px, transparent 1px),
linear-gradient(90deg, rgba(120,180,255,.07) 1px, transparent 1px);
background-size: 56px 56px;
mask-image: radial-gradient(70% 70% at 30% 20%, #000 30%, transparent 100%);
}
.t1-dots { position: absolute; inset: 0; }
.t1-dots span {
position: absolute; width: 3px; height: 3px; border-radius: 50%;
background: #bcd8ff; box-shadow: 0 0 8px 2px rgba(150,200,255,.7);
animation: twinkle 4.5s ease-in-out infinite;
}
.t1-meteor {
position: absolute; top: -10%; left: 62%; width: 2px; height: 140px;
background: linear-gradient(180deg, transparent, rgba(190,220,255,.9));
transform: rotate(28deg); filter: drop-shadow(0 0 6px rgba(160,210,255,.9));
animation: meteor 9s linear infinite;
}
.t1-glow {
position: absolute; width: 520px; height: 520px; left: -140px; top: -120px;
background: radial-gradient(circle, rgba(0,112,242,.35), transparent 65%);
filter: blur(6px); animation: breathe 9s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes meteor { 0% { transform: translate(0,0) rotate(28deg); opacity: 0; } 12% { opacity: 1; } 55% { opacity: 0; } 100% { transform: translate(-460px,620px) rotate(28deg); opacity: 0; } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }
/* ================= 方案 2:品牌渐变 + 城市剪影 ================= */
.stage[data-theme="2"] { background: linear-gradient(135deg, #eaf2ff 0%, #dbe8fb 48%, #cfe0f8 100%); }
.t2-sun {
position: absolute; right: 12%; top: 12%; width: 320px; height: 320px; border-radius: 50%;
background: radial-gradient(circle, rgba(0,112,242,.22), transparent 68%);
filter: blur(10px); animation: t2float 10s ease-in-out infinite;
}
.t2-skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; opacity: .9; }
.t2-skyline svg { width: 100%; height: 100%; }
.t2-cloud {
position: absolute; height: 60px; border-radius: 60px; background: rgba(255,255,255,.7);
filter: blur(2px); animation: t2drift 26s linear infinite;
}
.t2-cloud.c1 { width: 180px; top: 18%; left: -200px; }
.t2-cloud.c2 { width: 120px; top: 30%; left: -140px; animation-duration: 34s; animation-delay: -8s; }
@keyframes t2float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes t2drift { 0% { transform: translateX(0); } 100% { transform: translateX(140vw); } }
/* ================= 方案 3:极简渐变 + 光斑 ================= */
.stage[data-theme="3"] { background: linear-gradient(160deg, #f5f8ff 0%, #eaf1fb 60%, #e2ecfb 100%); }
.t3-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.t3-blob.b1 { width: 460px; height: 460px; background: #8fb8ff; left: -120px; top: -140px; animation: t3move1 16s ease-in-out infinite; }
.t3-blob.b2 { width: 380px; height: 380px; background: #b7d2ff; right: -100px; bottom: -120px; animation: t3move2 20s ease-in-out infinite; }
.t3-blob.b3 { width: 260px; height: 260px; background: #cfe2ff; right: 28%; top: -80px; animation: t3move1 24s ease-in-out infinite reverse; }
@keyframes t3move1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(50px,36px) scale(1.12); } }
@keyframes t3move2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-46px,-30px) scale(1.08); } }
/* ================= 方案 4:粒子连线 ================= */
.stage[data-theme="4"] { background: linear-gradient(160deg, #071a30 0%, #0a2746 55%, #06131f 100%); }
.t4-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* ================= 方案 5:光束流动 ================= */
.stage[data-theme="5"] { background: #071827; overflow: hidden; }
.t5-base {
position: absolute; inset: 0;
background: radial-gradient(90% 90% at 20% 10%, rgba(0,112,242,.35), transparent 60%),
radial-gradient(80% 80% at 90% 90%, rgba(41,196,255,.18), transparent 60%);
}
.t5-beam {
position: absolute; top: -40%; width: 180px; height: 190%;
background: linear-gradient(90deg, transparent, rgba(120,200,255,.14), transparent);
transform: rotate(18deg);
animation: t5sweep 7s linear infinite;
}
.t5-beam.b1 { left: -20%; animation-delay: 0s; }
.t5-beam.b2 { left: 18%; width: 120px; animation-delay: -2.4s; opacity: .8; }
.t5-beam.b3 { left: 58%; width: 240px; animation-delay: -5s; opacity: .55; }
@keyframes t5sweep { 0% { transform: translateX(-30vw) rotate(18deg); } 100% { transform: translateX(120vw) rotate(18deg); } }
/* ================= 方案 6:天际线视差 ================= */
.stage[data-theme="6"] { background: linear-gradient(180deg, #0a1c33 0%, #123a63 48%, #1d5c93 100%); }
.t6-moon {
position: absolute; right: 16%; top: 12%; width: 96px; height: 96px; border-radius: 50%;
background: radial-gradient(circle at 35% 35%, #fff, #cfe4ff 60%, #9fc4f0);
box-shadow: 0 0 50px 14px rgba(180,220,255,.28);
}
.t6-stars span {
position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #dceaff;
animation: twinkle 5s ease-in-out infinite;
}
.t6-layer { position: absolute; left: 0; right: 0; bottom: 0; }
.t6-layer svg { display: block; width: 100%; }
.t6-far { opacity: .5; animation: t6parallax 22s ease-in-out infinite; }
.t6-near { opacity: .95; animation: t6parallax 14s ease-in-out infinite reverse; }
@keyframes t6parallax { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-18px); } }
/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
.stage * { animation: none !important; }
}
</style>
</head>
<body>
<header class="toolbar">
<h1>登录页动效方案</h1>
<span class="sub">点击切换预览 · 6 套</span>
<div class="tabs" id="tabs"></div>
</header>
<main id="stages"></main>
<script>
const THEMES = [
{ id: 1, name: '星海微光', desc: '深色星空 + 细网格 + 少量流星,科技感但克制' },
{ id: 2, name: '品牌渐变 · 城市剪影', desc: '浅色品牌渐变 + 城市轮廓 + 漂浮云,稳重商务' },
{ id: 3, name: '极简光斑', desc: '浅色渐变 + 柔和光斑缓慢移动,最轻量' },
{ id: 4, name: '粒子连线', desc: 'Canvas 粒子 + 邻近连线,经典科技感' },
{ id: 5, name: '光束流动', desc: '深蓝底 + 斜向光束扫过,速度感强' },
{ id: 6, name: '夜幕天际线', desc: '夜空月亮 + 双层城市视差,沉浸感强' }
];
function loginCard(theme) {
return `
<div class="login-wrap">
<div class="login-card">
<div class="brand-side">
<div class="logo-badge">甄</div>
<h1>甄房</h1>
<p class="slogan">专业房产经纪服务平台</p>
<ul class="brand-points">
<li><i>✓</i> 房源 · 客源 · 交易全流程数字化</li>
<li><i>✓</i> 新房智联,渠道直连案场</li>
<li><i>✓</i> AI 赋能,开单更高效</li>
</ul>
</div>
<div class="form-side">
<h2>欢迎登录</h2>
<p class="tip">${theme.name} · ${theme.desc}</p>
<div class="field focus">请输入手机号</div>
<div class="field">请输入密码</div>
<div class="form-row"><span>记住账号</span><a>忘记密码?</a></div>
<button class="login-btn">登 录</button>
<div class="form-foot">登录即代表同意《用户协议》与《隐私政策》</div>
</div>
</div>
</div>`;
}
function bg(theme) {
const id = theme.id;
if (id === 1) {
const dots = Array.from({ length: 26 }, () => {
const left = (Math.random() * 100).toFixed(1);
const top = (Math.random() * 100).toFixed(1);
const delay = (Math.random() * 5).toFixed(1);
return `<span style="left:${left}%;top:${top}%;animation-delay:-${delay}s"></span>`;
}).join('');
return `<div class="t1-glow"></div><div class="t1-grid"></div><div class="t1-dots">${dots}</div><div class="t1-meteor"></div>`;
}
if (id === 2) {
return `
<div class="t2-sun"></div>
<div class="t2-cloud c1"></div><div class="t2-cloud c2"></div>
<div class="t2-skyline">
<svg viewBox="0 0 1440 380" preserveAspectRatio="none">
<defs><linearGradient id="g2" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#4d8fd6" stop-opacity=".55"/><stop offset="1" stop-color="#1f5fa8" stop-opacity=".75"/>
</linearGradient></defs>
<path fill="url(#g2)" d="M0 320h60V210h40v110h50V160h36v160h54V240h44v80h52V120h34v200h60V190h40v130h70V150h30v170h58V230h46v90h64V170h36v150h60V210h42v110h70V140h32v180h56V200h44v120h62V160h38v160h66V220h44v100h70V180h34v140h60V240h46v80h62V200h36v120h56V160h40v160h64V220h46v100h60V180h36v140h58V240h44v80h62V200h38v120h56V170h40v150h60V210h44v110h70V180h34v140h58V240h46v80h62V200h36v120h50v40H0z"/>
</svg>
</div>`;
}
if (id === 3) return `<div class="t3-blob b1"></div><div class="t3-blob b2"></div><div class="t3-blob b3"></div>`;
if (id === 4) return `<canvas class="t4-canvas" data-particles></canvas>`;
if (id === 5) return `<div class="t5-base"></div><div class="t5-beam b1"></div><div class="t5-beam b2"></div><div class="t5-beam b3"></div>`;
if (id === 6) {
const stars = Array.from({ length: 34 }, () => {
const left = (Math.random() * 100).toFixed(1);
const top = (Math.random() * 62).toFixed(1);
const delay = (Math.random() * 6).toFixed(1);
return `<span style="left:${left}%;top:${top}%;animation-delay:-${delay}s"></span>`;
}).join('');
return `
<div class="t6-moon"></div>
<div class="t6-stars">${stars}</div>
<div class="t6-layer t6-far">
<svg viewBox="0 0 1440 260" preserveAspectRatio="none" height="260">
<path fill="#12395c" d="M0 220h80V150h50v70h70V120h40v100h60v-80h44v80h70V100h36v120h60v-70h46v70h64V140h40v80h70v-50h44v50h60V110h38v110h66v-70h46v70h62V150h40v70h70v-40h44v40h60V120h38v100h66v-60h46v60h62V160h40v60h70v-40h44v40h60V130h38v90h70v-50h44v50z"/>
</svg>
</div>
<div class="t6-layer t6-near">
<svg viewBox="0 0 1440 200" preserveAspectRatio="none" height="200">
<path fill="#071a2c" d="M0 190h90V120h60v70h80V90h46v100h70v-60h50v60h80V110h40v80h70v-50h52v50h80V100h44v90h70v-60h50v60h80V120h42v70h70v-40h54v40h80V90h44v100h70v-50h50v50h80V110h42v80h70v-40h54v40h80V120h46v70h70v-40h50v40h70v30H0z"/>
</svg>
</div>`;
}
return '';
}
const tabs = document.getElementById('tabs');
const stages = document.getElementById('stages');
THEMES.forEach((theme, index) => {
const tab = document.createElement('div');
tab.className = 'tab' + (index === 0 ? ' active' : '');
tab.textContent = `方案 ${theme.id} · ${theme.name}`;
tab.dataset.target = `stage-${theme.id}`;
tabs.appendChild(tab);
const stage = document.createElement('section');
stage.className = 'stage' + (index === 0 ? ' active' : '');
stage.id = `stage-${theme.id}`;
stage.dataset.theme = theme.id;
stage.innerHTML = bg(theme) + loginCard(theme);
stages.appendChild(stage);
});
tabs.addEventListener('click', e => {
const tab = e.target.closest('.tab');
if (!tab) return;
Array.prototype.forEach.call(tabs.children, t => t.classList.toggle('active', t === tab));
Array.prototype.forEach.call(stages.children, s => s.classList.toggle('active', s.id === tab.dataset.target));
startCanvas();
});
/* ---------- 方案 4:粒子连线(仅在激活时运行) ---------- */
let rafId = null;
function stopCanvas() {
if (rafId) { cancelAnimationFrame(rafId); rafId = null; }
}
function startCanvas() {
stopCanvas();
const stage = document.querySelector('.stage.active');
if (!stage || stage.dataset.theme !== '4') return;
const canvas = stage.querySelector('[data-particles]');
if (!canvas) return;
const ctx = canvas.getContext('2d');
let width = 0, height = 0, particles = [];
const DPR = Math.min(window.devicePixelRatio || 1, 2);
const COUNT = 46;
function resize() {
width = canvas.clientWidth;
height = canvas.clientHeight;
canvas.width = width * DPR;
canvas.height = height * DPR;
ctx.setTransform(DPR, 0, 0, DPR, 0, 0);
}
function init() {
particles = Array.from({ length: COUNT }, () => ({
x: Math.random() * width,
y: Math.random() * height,
vx: (Math.random() - 0.5) * 0.32,
vy: (Math.random() - 0.5) * 0.32,
r: Math.random() * 1.6 + 0.8
}));
}
function draw() {
ctx.clearRect(0, 0, width, height);
particles.forEach(p => {
p.x += p.vx; p.y += p.vy;
if (p.x < 0 || p.x > width) p.vx *= -1;
if (p.y < 0 || p.y > height) p.vy *= -1;
ctx.beginPath();
ctx.arc(p.x, p.y, p.r, 0, Math.PI * 2);
ctx.fillStyle = 'rgba(160, 210, 255, .9)';
ctx.fill();
});
for (let i = 0; i < particles.length; i++) {
for (let j = i + 1; j < particles.length; j++) {
const a = particles[i], b = particles[j];
const dx = a.x - b.x, dy = a.y - b.y;
const dist = Math.sqrt(dx * dx + dy * dy);
if (dist < 128) {
ctx.beginPath();
ctx.moveTo(a.x, a.y);
ctx.lineTo(b.x, b.y);
ctx.strokeStyle = `rgba(90, 160, 240, ${(1 - dist / 128) * 0.34})`;
ctx.lineWidth = 0.7;
ctx.stroke();
}
}
}
rafId = requestAnimationFrame(draw);
}
resize(); init(); draw();
window.addEventListener('resize', () => { resize(); init(); }, { passive: true });
}
startCanvas();
</script>
</body>
</html>
File diff suppressed because it is too large Load Diff
@@ -1,694 +0,0 @@
:root {
--page: #ffffff;
--ink: #2f302d;
--muted: #6b7280;
--faint: #9aa1ad;
--line: #e6e8ec;
--line-strong: #d4d8df;
--soft: #f7f8fa;
--soft-2: #f1f4f7;
--accent: #2563eb;
--teal: #0f766e;
--rose: #b83f58;
--gold: #b7791f;
}
* {
box-sizing: border-box;
}
html {
background: var(--page);
scroll-behavior: smooth;
}
body {
margin: 0;
background: var(--page);
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
font-size: 16px;
line-height: 1.72;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
a {
color: var(--accent);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.doc-page {
width: min(780px, calc(100vw - 48px));
margin: 0 auto;
padding: 72px 0 96px;
}
.doc-title {
margin-bottom: 32px;
}
.doc-title h1 {
margin: 0;
color: var(--ink);
font-size: 36px;
line-height: 1.18;
font-weight: 650;
letter-spacing: 0;
text-wrap: balance;
}
.doc-subtitle {
margin: 18px 0 0;
color: var(--muted);
font-size: 18px;
line-height: 1.7;
}
.doc-block {
margin: 36px 0;
scroll-margin-top: 28px;
}
.doc-block h2,
.doc-chart h2,
.doc-table h2,
.doc-diagram h2 {
margin: 0 0 12px;
color: var(--ink);
font-size: 23px;
line-height: 1.35;
font-weight: 620;
letter-spacing: 0;
text-wrap: balance;
}
.doc-block p,
.doc-chart p,
.doc-table p,
.doc-diagram p {
margin: 10px 0 16px;
color: #4b5059;
text-wrap: pretty;
}
.doc-block ul,
.doc-block ol {
margin: 10px 0 0;
padding-left: 24px;
}
.doc-block li {
margin: 8px 0;
}
.doc-block strong,
.doc-callout strong,
.doc-note strong {
color: var(--ink);
font-weight: 620;
}
.doc-callout {
margin: 28px 0 34px;
padding: 16px 18px;
border: 1px solid #dfe5e2;
border-radius: 16px;
background: #f7faf8;
}
.doc-callout p {
margin: 6px 0 0;
color: #46534f;
}
.doc-note {
margin: 22px 0;
padding: 13px 15px;
border-left: 3px solid var(--line-strong);
border-radius: 0 16px 16px 0;
background: var(--soft);
color: #535a66;
}
.doc-note p {
margin: 0;
}
.doc-metrics {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
margin: 30px 0 42px;
border: 1px solid var(--line);
border-radius: 16px;
overflow: hidden;
background: #fff;
}
.doc-metric {
min-width: 0;
padding: 16px 17px;
}
.doc-metric + .doc-metric {
border-left: 1px solid var(--line);
}
.doc-metric span {
display: block;
color: var(--muted);
font-size: 13px;
line-height: 1.35;
}
.doc-metric strong {
display: block;
margin: 6px 0 3px;
color: var(--ink);
font-size: 23px;
line-height: 1.18;
font-weight: 640;
}
.doc-metric small {
display: block;
color: var(--muted);
font-size: 13px;
line-height: 1.35;
}
.doc-chart,
.doc-table,
.doc-diagram {
margin: 46px 0;
scroll-margin-top: 28px;
}
.chart-frame,
.table-frame,
.diagram-frame {
position: relative;
margin-top: 18px;
}
.mermaid-frame {
padding: 20px;
border: 1px solid var(--line);
border-radius: 16px;
background: #fff;
}
.mermaid {
min-width: 680px;
margin: 0;
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
.mermaid svg {
display: block;
width: 100%;
max-width: none;
height: auto;
}
.diagram-zoom-trigger {
position: absolute;
top: 9px;
right: 9px;
z-index: 3;
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border: 1px solid var(--line-strong);
border-radius: 999px;
background: rgba(255, 255, 255, 0.94);
color: var(--muted);
cursor: pointer;
padding: 0;
box-shadow: 0 1px 2px rgba(32, 33, 36, 0.04);
opacity: 0;
transition: opacity 140ms ease, color 140ms ease, background 140ms ease;
}
.lucide-icon {
width: 14px;
height: 14px;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
pointer-events: none;
}
.mermaid-frame:hover .diagram-zoom-trigger,
.mermaid-frame:focus-within .diagram-zoom-trigger {
opacity: 1;
}
.diagram-zoom-trigger:hover,
.diagram-zoom-trigger:focus-visible {
background: #fff;
color: var(--ink);
outline: none;
}
.diagram-lightbox {
position: fixed;
inset: 0;
z-index: 100;
display: none;
padding: 34px;
background: rgba(25, 28, 34, 0.62);
}
.diagram-lightbox.open {
display: flex;
align-items: center;
justify-content: center;
}
.diagram-lightbox-panel {
position: relative;
width: min(1120px, calc(100vw - 48px));
max-height: calc(100vh - 48px);
overflow: auto;
border: 1px solid var(--line-strong);
border-radius: 16px;
background: #fff;
box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
padding: 28px;
}
.diagram-lightbox-content {
min-width: 880px;
padding-top: 6px;
}
.diagram-lightbox-content svg {
display: block;
width: 100%;
height: auto;
}
.diagram-lightbox-close {
position: absolute;
top: 12px;
right: 12px;
z-index: 4;
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border: 0;
border-radius: 999px;
background: transparent;
color: var(--muted);
cursor: pointer;
padding: 0;
}
.diagram-lightbox-close:hover,
.diagram-lightbox-close:focus-visible {
background: var(--soft);
color: var(--ink);
outline: none;
}
.chart-menu {
position: absolute;
top: 10px;
right: 10px;
z-index: 3;
opacity: 0;
transition: opacity 140ms ease;
}
.chart-frame:hover .chart-menu,
.chart-frame:focus-within .chart-menu {
opacity: 1;
}
.chart-menu-trigger {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 3px;
width: 30px;
height: 30px;
border: 1px solid var(--line-strong);
border-radius: 999px;
background: rgba(255, 255, 255, 0.94);
color: var(--muted);
cursor: pointer;
padding: 0;
box-shadow: 0 1px 2px rgba(32, 33, 36, 0.04);
}
.chart-menu-trigger span {
display: block;
width: 3px;
height: 3px;
border-radius: 50%;
background: currentColor;
}
.chart-menu-trigger:hover,
.chart-menu-trigger:focus-visible {
background: #fff;
color: var(--ink);
outline: none;
}
.chart-menu-popover {
display: none;
position: absolute;
right: 0;
top: 34px;
width: 156px;
padding: 6px;
border: 1px solid var(--line-strong);
border-radius: 8px;
background: #fff;
box-shadow: 0 8px 18px rgba(32, 33, 36, 0.12);
}
.chart-menu:hover .chart-menu-popover,
.chart-menu:focus-within .chart-menu-popover {
display: block;
}
.chart-menu-popover button {
display: block;
width: 100%;
border: 0;
border-radius: 6px;
background: transparent;
color: var(--ink);
font: inherit;
font-size: 13px;
text-align: left;
padding: 8px 10px;
cursor: pointer;
}
.chart-menu-popover button.active,
.chart-menu-popover button:hover,
.chart-menu-popover button:focus-visible {
background: var(--soft-2);
color: var(--ink);
outline: none;
}
.chart-canvas {
width: 100%;
height: 390px;
border: 1px solid var(--line);
border-radius: 16px;
background: #fff;
}
.figure-caption {
margin-top: 9px;
color: var(--muted);
font-size: 14px;
line-height: 1.48;
}
.figure-caption strong {
display: block;
color: #343941;
font-weight: 620;
}
.figure-caption span {
display: block;
margin-top: 2px;
}
.table-scroll {
overflow-x: auto;
border: 1px solid var(--line);
border-radius: 16px;
background: #fff;
}
.doc-data-table {
width: 100%;
min-width: 720px;
border-collapse: collapse;
font-size: 14px;
line-height: 1.45;
}
.doc-data-table th,
.doc-data-table td {
padding: 11px 12px;
border-bottom: 1px solid var(--line);
text-align: left;
vertical-align: top;
}
.doc-data-table th {
background: var(--soft);
color: #566173;
font-weight: 620;
}
.doc-data-table tbody tr:last-child td {
border-bottom: 0;
}
.doc-data-table .num {
text-align: right;
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.diagram-flow {
display: grid;
grid-template-columns: 1fr auto 1fr auto 1fr;
gap: 10px;
align-items: stretch;
min-width: 640px;
}
.diagram-node {
padding: 15px;
border: 1px solid var(--line);
border-radius: 16px;
background: #fff;
}
.diagram-node strong {
display: block;
margin-bottom: 4px;
color: var(--ink);
font-weight: 620;
}
.diagram-node span {
color: var(--muted);
font-size: 14px;
line-height: 1.5;
}
.diagram-arrow {
display: flex;
align-items: center;
color: var(--faint);
font-size: 22px;
}
.doc-sources {
margin-top: 48px;
padding-top: 4px;
}
.source-links {
margin: 16px 0 0;
padding-left: 22px;
color: #535a66;
font-size: 14px;
line-height: 1.6;
}
.source-links li {
margin: 7px 0;
}
.toc-rail {
position: fixed;
left: 18px;
top: 50%;
z-index: 10;
width: 320px;
transform: translateY(-50%);
}
.toc-lines {
display: flex;
flex-direction: column;
gap: 4px;
width: 28px;
padding: 8px 5px;
}
.toc-line {
position: relative;
display: block;
width: 18px;
height: 8px;
color: #c3c6cd;
}
.toc-line::before {
content: "";
position: absolute;
left: 0;
top: 50%;
width: 18px;
height: 2px;
border-radius: 999px;
background: currentColor;
transform: translateY(-50%);
}
.toc-line.active,
.toc-line:hover {
color: var(--ink);
}
.toc-popup {
position: absolute;
left: 0;
top: 50%;
width: 310px;
padding: 12px;
border: 1px solid var(--line-strong);
border-radius: 16px;
background: rgba(255, 255, 255, 0.98);
box-shadow: 0 16px 36px rgba(35, 37, 42, 0.13);
opacity: 0;
pointer-events: none;
transform: translateY(-50%) translateX(-4px);
transition: opacity 140ms ease, transform 140ms ease;
}
.toc-rail:hover .toc-popup,
.toc-rail:focus-within .toc-popup {
opacity: 1;
pointer-events: auto;
transform: translateY(-50%) translateX(0);
}
.toc-popup a {
display: block;
padding: 7px 9px;
border-radius: 6px;
color: var(--ink);
font-size: 14px;
line-height: 1.35;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.toc-popup a:hover,
.toc-popup a.active {
background: var(--soft);
text-decoration: none;
}
@media (max-width: 1040px) {
.toc-rail {
display: none;
}
}
@media (max-width: 820px) {
.doc-page {
width: min(100vw - 32px, 780px);
padding-top: 44px;
}
.doc-title h1 {
font-size: 30px;
}
.doc-subtitle {
font-size: 16px;
}
.doc-metrics {
grid-template-columns: 1fr 1fr;
}
.doc-metric:nth-child(odd) {
border-left: 0;
}
.doc-metric:nth-child(n + 3) {
border-top: 1px solid var(--line);
}
.chart-canvas {
height: 360px;
}
.diagram-lightbox {
padding: 18px;
}
.diagram-lightbox-panel {
width: calc(100vw - 24px);
max-height: calc(100vh - 24px);
padding: 22px;
}
.diagram-lightbox-content {
min-width: 760px;
}
}
@media (max-width: 560px) {
.doc-page {
width: min(100vw - 24px, 780px);
}
.doc-title h1 {
font-size: 27px;
}
.doc-block h2,
.doc-chart h2,
.doc-table h2,
.doc-diagram h2 {
font-size: 21px;
}
.doc-metrics {
grid-template-columns: 1fr;
}
.doc-metric,
.doc-metric + .doc-metric {
border-left: 0;
}
.doc-metric + .doc-metric {
border-top: 1px solid var(--line);
}
.chart-canvas {
height: 320px;
}
}
@@ -1,350 +0,0 @@
(function () {
const palette = {
blue: "#2563eb",
teal: "#0f766e",
rose: "#b83f58",
gold: "#b7791f",
line: "#e6ebf0",
axis: "#475569"
};
const chartColors = [palette.blue, palette.teal, palette.gold, palette.rose, "#64748b", "#7c3aed"];
function readJson(id) {
const el = document.getElementById(id);
if (!el) return null;
try {
return JSON.parse(el.textContent || "null");
} catch (error) {
console.warn("Invalid JSON block", id, error);
return null;
}
}
function pct(value) {
return Number(value).toFixed(1) + "%";
}
function grid() {
return { left: 58, right: 48, top: 52, bottom: 58, containLabel: true };
}
function marketOption(rows, type) {
if (type === "bar") {
return {
animation: false,
color: [palette.blue, palette.gold],
tooltip: { trigger: "axis" },
legend: { top: 8 },
grid: grid(),
xAxis: { type: "category", data: rows.map((row) => row.year) },
yAxis: [
{ type: "value", name: "销量 百万辆", splitLine: { lineStyle: { color: palette.line } } },
{ type: "value", name: "渗透率", axisLabel: { formatter: (value) => value + "%" } }
],
series: [
{ name: "销量", type: "bar", data: rows.map((row) => row.sales_m) },
{
name: "渗透率",
type: "line",
yAxisIndex: 1,
data: rows.map((row) => row.penetration),
lineStyle: { width: 3 }
}
]
};
}
return {
animation: false,
color: [palette.blue, palette.gold],
tooltip: { trigger: "axis" },
legend: { top: 8 },
grid: grid(),
xAxis: { type: "category", data: rows.map((row) => row.year) },
yAxis: [
{ type: "value", name: "销量 百万辆", splitLine: { lineStyle: { color: palette.line } } },
{ type: "value", name: "渗透率", axisLabel: { formatter: (value) => value + "%" } }
],
series: [
{
name: "销量",
type: "line",
smooth: true,
data: rows.map((row) => row.sales_m),
lineStyle: { width: 3 }
},
{
name: "渗透率",
type: "line",
yAxisIndex: 1,
smooth: true,
data: rows.map((row) => row.penetration),
lineStyle: { width: 3, type: "dashed" }
}
]
};
}
function shareOption(rows, type) {
if (type === "pie") {
return {
animation: false,
color: chartColors,
tooltip: { trigger: "item", valueFormatter: (value) => pct(value) },
legend: { bottom: 8, type: "scroll" },
series: [
{
type: "pie",
radius: ["42%", "70%"],
center: ["50%", "42%"],
data: rows.map((row) => ({ name: row.brand, value: row.share })),
label: { formatter: (params) => params.name + "\n" + pct(params.value) }
}
]
};
}
const reversed = rows.slice().reverse();
return {
animation: false,
color: [palette.teal],
tooltip: {
trigger: "axis",
axisPointer: { type: "shadow" },
valueFormatter: (value) => pct(value)
},
grid: { left: 92, right: 42, top: 28, bottom: 24, containLabel: true },
xAxis: {
type: "value",
axisLabel: { formatter: (value) => value + "%" },
splitLine: { lineStyle: { color: palette.line } }
},
yAxis: { type: "category", data: reversed.map((row) => row.brand) },
series: [
{
name: "份额",
type: "bar",
data: reversed.map((row) => ({
value: row.share,
itemStyle: {
color:
row.brand === "比亚迪"
? palette.teal
: row.brand === "特斯拉中国"
? palette.rose
: palette.blue
}
})),
label: { show: true, position: "right", formatter: (params) => pct(params.value) }
}
]
};
}
function setupToc() {
const nav = document.querySelector(".toc-rail");
const page = document.querySelector(".doc-page");
if (!nav || !page) return;
const targets = Array.from(
page.querySelectorAll("header[id], section[id]")
).filter((block) => block.querySelector("h1, h2"));
const lines = document.createElement("div");
const popup = document.createElement("div");
lines.className = "toc-lines";
popup.className = "toc-popup";
targets.forEach((target) => {
const heading = target.querySelector("h1, h2");
const label = heading.textContent.trim();
const line = document.createElement("a");
const link = document.createElement("a");
line.className = "toc-line";
line.href = "#" + target.id;
line.dataset.target = target.id;
line.setAttribute("aria-label", label);
link.href = "#" + target.id;
link.dataset.target = target.id;
link.textContent = label;
lines.appendChild(line);
popup.appendChild(link);
});
nav.replaceChildren(lines, popup);
const links = Array.from(nav.querySelectorAll("a[data-target]"));
function setActive(id) {
links.forEach((link) => link.classList.toggle("active", link.dataset.target === id));
}
if ("IntersectionObserver" in window) {
const observer = new IntersectionObserver(
(entries) => {
const visible = entries
.filter((entry) => entry.isIntersecting)
.sort((a, b) => Math.abs(a.boundingClientRect.top) - Math.abs(b.boundingClientRect.top))[0];
if (visible) setActive(visible.target.id);
},
{ rootMargin: "-22% 0px -62% 0px", threshold: 0.01 }
);
targets.forEach((target) => observer.observe(target));
} else if (links[0]) {
links[0].classList.add("active");
}
}
function setupCharts() {
if (!window.echarts) return;
const instances = [];
document.querySelectorAll("[data-chart]").forEach((block) => {
const canvas = block.querySelector(".chart-canvas");
const dataId = block.getAttribute("data-data");
const chartKind = block.getAttribute("data-chart");
const initialType = block.getAttribute("data-type") || "line";
const rows = readJson(dataId);
if (!canvas || !rows) return;
const chart = echarts.init(canvas, null, { renderer: "canvas" });
function optionFor(type) {
if (chartKind === "market-trend") return marketOption(rows, type);
if (chartKind === "share-ranking") return shareOption(rows, type);
return {};
}
chart.setOption(optionFor(initialType), true);
instances.push(chart);
block.querySelectorAll("[data-chart-type]").forEach((button) => {
button.classList.toggle("active", button.dataset.chartType === initialType);
button.addEventListener("click", () => {
block
.querySelectorAll("[data-chart-type]")
.forEach((item) => item.classList.toggle("active", item === button));
chart.setOption(optionFor(button.dataset.chartType), true);
});
});
});
window.addEventListener("resize", () => {
instances.forEach((chart) => chart.resize());
});
}
function setupMermaid() {
if (!window.mermaid || !document.querySelector(".mermaid")) return;
window.mermaid.initialize({
startOnLoad: true,
securityLevel: "loose",
theme: "base",
themeVariables: {
fontFamily: "-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, sans-serif",
primaryColor: "#eef4ff",
primaryBorderColor: "#b9cdfd",
primaryTextColor: "#2f302d",
lineColor: "#9aa1ad",
textColor: "#2f302d",
mainBkg: "#ffffff",
clusterBkg: "#f7f8fa",
clusterBorder: "#e6e8ec"
},
flowchart: {
htmlLabels: true,
curve: "basis",
padding: 14,
nodeSpacing: 42,
rankSpacing: 58
}
});
}
const lucideIcons = {
maximize2: [
["path", { d: "M15 3h6v6" }],
["path", { d: "m21 3-7 7" }],
["path", { d: "m3 21 7-7" }],
["path", { d: "M9 21H3v-6" }]
],
x: [
["path", { d: "M18 6 6 18" }],
["path", { d: "m6 6 12 12" }]
]
};
function lucideIcon(name) {
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svg.setAttribute("class", "lucide-icon");
svg.setAttribute("viewBox", "0 0 24 24");
svg.setAttribute("aria-hidden", "true");
svg.setAttribute("focusable", "false");
(lucideIcons[name] || []).forEach(([tag, attrs]) => {
const child = document.createElementNS("http://www.w3.org/2000/svg", tag);
Object.entries(attrs).forEach(([key, value]) => child.setAttribute(key, value));
svg.appendChild(child);
});
return svg;
}
function setupDiagramZoom() {
const frames = Array.from(document.querySelectorAll(".mermaid-frame"));
if (!frames.length) return;
const lightbox = document.createElement("div");
const panel = document.createElement("div");
const close = document.createElement("button");
const content = document.createElement("div");
lightbox.className = "diagram-lightbox";
panel.className = "diagram-lightbox-panel";
close.className = "diagram-lightbox-close";
close.type = "button";
close.title = "Close";
close.setAttribute("aria-label", "Close enlarged diagram");
close.appendChild(lucideIcon("x"));
content.className = "diagram-lightbox-content";
panel.append(close, content);
lightbox.appendChild(panel);
document.body.appendChild(lightbox);
function closeLightbox() {
lightbox.classList.remove("open");
content.replaceChildren();
document.body.style.overflow = "";
}
function openLightbox(frame) {
const svg = frame.querySelector("svg");
const mermaidSource = frame.querySelector(".mermaid");
const clone = svg ? svg.cloneNode(true) : mermaidSource ? mermaidSource.cloneNode(true) : null;
if (!clone) return;
content.replaceChildren(clone);
lightbox.classList.add("open");
document.body.style.overflow = "hidden";
close.focus();
}
close.addEventListener("click", closeLightbox);
lightbox.addEventListener("click", (event) => {
if (event.target === lightbox) closeLightbox();
});
document.addEventListener("keydown", (event) => {
if (event.key === "Escape" && lightbox.classList.contains("open")) closeLightbox();
});
frames.forEach((frame) => {
if (frame.querySelector(".diagram-zoom-trigger")) return;
const button = document.createElement("button");
button.className = "diagram-zoom-trigger";
button.type = "button";
button.title = "Enlarge";
button.setAttribute("aria-label", "Enlarge diagram");
button.appendChild(lucideIcon("maximize2"));
button.addEventListener("click", () => openLightbox(frame));
frame.appendChild(button);
});
}
document.addEventListener("DOMContentLoaded", () => {
setupToc();
setupMermaid();
setupDiagramZoom();
setupCharts();
});
})();
File diff suppressed because one or more lines are too long
@@ -1,455 +0,0 @@
<!-- Generated by Trae Work -->
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>新房智联 · 业务全流程说明</title>
<link rel="stylesheet" href="assets/doc.css">
</head>
<body>
<aside class="toc-rail" aria-label="目录"></aside>
<main class="doc-page">
<header class="doc-title" id="top">
<h1>新房智联 · 业务全流程说明</h1>
<p class="doc-subtitle">从渠道入驻、新盘录入与审核,到 C 端分发、咨询获客与线索转化。整理时间 2026-11-12,对应代码基线 <code>f9c0d8c</code>。</p>
</header>
<section class="doc-block" id="intro">
<h2>这份文档解决什么问题</h2>
<p>新房智联不是单一页面,而是一条跨四个端的业务链路:渠道人员在小程序申请入驻并录入新盘,平台运营在 ERP 完成审核与上下架,C 端客户在小程序、H5、官网浏览与咨询,最终沉淀为可跟进的营销客线索。任何一个环节的状态、归属或权限判断出错,都会直接表现为“盘看不到、线索丢了、客户加不上微信”。</p>
<p>下面按业务发生的先后顺序展开:先看全局,再依次拆解入驻、录盘、审核、分发、线索、权限与数据模型,最后附接口清单和边界说明。</p>
<div class="doc-callout">
<p><strong>主线:</strong>入驻 → 录盘 → 审核 → 分发 → 咨询 → 线索 → 转客源。每一步都有明确的状态机,渠道数据统一落在专用租户 <strong>8</strong>。</p>
</div>
</section>
<section class="doc-block" id="roles">
<h2>一、角色、入口与职责</h2>
<p>系统里实际存在五类参与者。理解“谁在哪个端、能做什么”,是后面所有流程的前提。</p>
<div class="doc-table table-scroll">
<table class="doc-data-table">
<thead>
<tr>
<th>角色</th>
<th>主要入口</th>
<th>核心职责</th>
<th>关键边界</th>
</tr>
</thead>
<tbody>
<tr>
<td>普通客户(C 端用户)</td>
<td>小程序 / H5 / 官网</td>
<td>浏览新盘、查看详情、在线咨询、加微信、转发</td>
<td>浏览与咨询无需登录;分享与海报仅限新盘归属人</td>
</tr>
<tr>
<td>渠道专员</td>
<td>小程序;ERP(应急)</td>
<td>提交入驻申请、录入新盘、转发获客、查看本人线索</td>
<td>角色 <code>newhouse_channel_agent</code>,只能操作本人数据</td>
</tr>
<tr>
<td>渠道主管</td>
<td>小程序;ERP</td>
<td>管理本公司专员、查看本公司新盘与线索</td>
<td>角色 <code>newhouse_channel_leader</code>,可见范围为本部门及以下</td>
</tr>
<tr>
<td>平台运营</td>
<td>ERP 后台</td>
<td>审核入驻、审核新盘、上下架、线索看板、企微绑定</td>
<td>平台管理员(租户 0),可跨租户</td>
</tr>
<tr>
<td>系统能力</td>
<td>后台服务</td>
<td>AI 笔记解析、企微回调、站内信、分享归因</td>
<td>渠道数据固定写入租户 8</td>
</tr>
</tbody>
</table>
<p class="figure-caption"><strong>表 1:角色与入口。</strong><span>同一自然人可能同时拥有 C 端账号(c_user)和 B 端账号(sys_user),两者通过申请单关联。</span></p>
</div>
</section>
<section class="doc-block" id="overview">
<h2>二、端到端总览</h2>
<p>把四个端放在一张图里,可以看到业务不是单向发布,而是一个闭环:平台审核决定哪些盘可以被看到,C 端行为又反过来生成线索回到渠道端和运营端。</p>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
flowchart LR
subgraph CLIENT["C 端客户"]
U["普通客户"] --> MINI["小程序 / H5 / 官网"]
end
subgraph CHANNEL["渠道端"]
AG["渠道专员"] --> APP["小程序:入驻 / 录盘 / 我的新盘 / 线索"]
LD["渠道主管"] --> ERP2["ERP:团队与新盘管理"]
end
subgraph PLATFORM["平台端"]
OP["平台运营"] --> ERP["ERP:审核 / 上下架 / 线索看板"]
end
MINI --> P["新盘广场 / 详情 / 橱窗"]
APP --> P
ERP --> P
P --> ACT["咨询 / 加微信 / 转发"]
ACT --> LEAD["线索(营销客)"]
LEAD --> ERP
LEAD --> APP
</pre>
</div>
<figcaption class="figure-caption"><strong>图 1:端到端业务闭环。</strong><span>平台控制“可见性”,渠道端提供“供给与分发”,C 端行为产生“线索”,线索再回到渠道端与运营端跟进。</span></figcaption>
</figure>
</section>
<section class="doc-block" id="onboarding">
<h2>三、渠道入驻与账号生命周期</h2>
<p>渠道能力是叠加在 C 端账号之上的:所有人先注册小程序账号(c_user),入驻申请审核通过后,平台才会为其创建或复用 ERP 账号(sys_user),并挂到“外部渠道体系”的公司部门下。</p>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
flowchart TD
S["小程序登录"] --> Q{"是否已入驻"}
Q -- "未申请" --> F["填写入驻申请<br/>姓名 / 公司 / 团队 / 城市 / 职务"]
F --> PENDING["申请单 PENDING"]
PENDING --> RV{"平台审核"}
RV -- "驳回" --> REJ["REJECTED + 驳回原因"]
REJ --> F
RV -- "通过" --> ACC["创建或复用 sys_user<br/>租户 8 + 外部渠道体系部门"]
ACC --> ROLE["绑定渠道角色<br/>生成一次性随机初始口令"]
ROLE --> FIRST["首次登录 ERP<br/>强制修改密码"]
FIRST --> WX["绑定企业微信<br/>userid 唯一性校验"]
WX --> OK["APPROVED:可录盘 / 转发 / 看线索"]
OK --> DIS{"运营停用"}
DIS -- "停用" --> OFF["DISABLED"]
DIS -- "恢复" --> OK
</pre>
</div>
<figcaption class="figure-caption"><strong>图 2:渠道入驻与账号生命周期。</strong><span>驳回或停用后重新申请会复用原申请行;审核通过时一次性返回随机口令,不再使用手机号后 6 位。</span></figcaption>
</figure>
<p>这条链路上有三个容易被忽略的细节:</p>
<ul>
<li><strong>申请单唯一性:</strong>同一手机号只保留一条有效申请;<code>PENDING</code>、<code>APPROVED</code> 不允许重复提交,<code>REJECTED</code>、<code>DISABLED</code> 可复用原行重新申请。</li>
<li><strong>账号是“复用”而不是“重建”:</strong>手机号已存在 sys_user 时直接复用并补绑角色,避免同一人出现两套组织架构账号。</li>
<li><strong>首登强制改密:</strong>租户 8 账号若从未改密(<code>pwd_update_date</code> 为空),或当前密码等于手机号后 6 位,登录后只允许访问个人信息、路由、修改密码和登出,其余接口一律拦截。</li>
</ul>
<div class="doc-table table-scroll">
<table class="doc-data-table">
<thead>
<tr><th>申请单状态</th><th>含义</th><th>可执行动作</th></tr>
</thead>
<tbody>
<tr><td><code>NONE</code></td><td>尚未申请</td><td>提交入驻申请</td></tr>
<tr><td><code>PENDING</code></td><td>审核中</td><td>等待平台审核,不可重复提交</td></tr>
<tr><td><code>APPROVED</code></td><td>已入驻</td><td>录盘、转发、查看本人线索</td></tr>
<tr><td><code>REJECTED</code></td><td>已驳回</td><td>查看原因并重新申请</td></tr>
<tr><td><code>DISABLED</code></td><td>已停用</td><td>由运营恢复或重新申请</td></tr>
</tbody>
</table>
<p class="figure-caption"><strong>表 2:申请单状态字典。</strong><span>状态变更均带条件更新,避免并发审核产生重复建号或重复通知。</span></p>
</div>
</section>
<section class="doc-block" id="publish">
<h2>四、新盘录入:三条入口</h2>
<p>新盘可以来自渠道专员的小程序录入、平台运营的 ERP 代录,或运营把微信笔记导入后由 AI 解析成结构化内容。三条入口最后都落到同一张表 <code>estate_newhouse_project</code>,初始状态统一为 <code>PENDING</code>。</p>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
flowchart LR
A["渠道专员(APPROVED)"] --> B["小程序录盘"]
A --> C["ERP 后台代录"]
A --> D["笔记导入:粘贴 / 上传 docx"]
D --> AI["AI 结构化解析<br/>文本 + 图片按序抽取"]
AI --> FORM["人工核对表单"]
B --> FORM
C --> FORM
FORM --> V{"统一校验<br/>名称 / 价格区间 / 经纬度 / JSON / 图片"}
V -- "不通过" --> FORM
V -- "通过" --> P["estate_newhouse_project<br/>status = PENDING"]
P --> T["进入 ERP 待审核列表"]
</pre>
</div>
<figcaption class="figure-caption"><strong>图 3:新盘录入的三条入口。</strong><span>入口不同,但落库字段、状态和后续审核完全一致;ERP 代录会自动回填对应的 C 端账号。</span></figcaption>
</figure>
<ul>
<li><strong>小程序录入:</strong>要求入驻状态为 <code>APPROVED</code>;编辑时必须成功加载原数据,加载失败会禁止提交,避免空表单覆盖线上房源。</li>
<li><strong>ERP 代录:</strong>租户强制为 8;录入人写入 <code>user_id</code>,并按其申请单自动回填 <code>c_user_id</code>,保证渠道专员在小程序“我的新盘/橱窗”里能看到。</li>
<li><strong>笔记导入:</strong>AI 先输出结构化字段与图文块,运营核对后再保存;单张图片超过 2MB 或最长边超过 1920px 会先压缩为 JPEG,远程图片抓取失败会计入失败清单,不再把外链直接入库。</li>
</ul>
<p>统一校验覆盖:总价下限不得大于上限、经纬度范围、绿化率/容积率上限、图片/户型/配套 JSON 的结构与长度。前端会先做同样的数值边界校验,避免非法值被静默丢弃。</p>
</section>
<section class="doc-block" id="audit">
<h2>五、审核、上下架与重新提审</h2>
<p>新盘状态机是平台控盘的核心。只有 <code>PENDING</code> 能被审核,只有 <code>AUDITED</code> 能被下架,只有 <code>OFF_SHELF</code> 或 <code>REJECTED</code> 能重新提审。</p>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
stateDiagram-v2
[*] --> PENDING: 提交 / 重新提审
PENDING --> AUDITED: 审核通过
PENDING --> REJECTED: 驳回并填写原因
REJECTED --> PENDING: 修改后重新提审
AUDITED --> OFF_SHELF: 平台或归属人下架
OFF_SHELF --> AUDITED: 重新上架
AUDITED --> [*]: 删除
</pre>
</div>
<figcaption class="figure-caption"><strong>图 4:新盘状态机。</strong><span>审核与上下架都使用条件更新(CAS),并发操作时只有第一个请求成功,其余会提示“状态已变更,请刷新”。</span></figcaption>
</figure>
<ul>
<li><strong>审核通过:</strong>清空驳回原因,刷新提审/上架时间;<strong>驳回:</strong>写入原因,C 端归属人可在详情中看到。</li>
<li><strong>重新提审:</strong>C 端把 <code>OFF_SHELF</code> 或 <code>REJECTED</code> 改回 <code>PENDING</code>,并刷新 <code>publish_time</code>,方便运营判断最近一次提审时间。</li>
<li><strong>可见性:</strong>广场与公开详情只返回 <code>AUDITED</code>;新盘归属人通过“我的新盘”可以查看自己的全部状态。</li>
</ul>
</section>
<section class="doc-block" id="distribution">
<h2>六、展示、分发与分享</h2>
<p>审核通过后,新盘会出现在三个展示面:新盘广场、归属人的“我的新盘”、以及渠道专员的橱窗。三者最终都指向同一个详情页,但入口和权限不同。</p>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
flowchart TD
L["新盘广场<br/>租户 8 + AUDITED"] --> D["新盘详情"]
M["我的新盘<br/>按 c_user_id"] --> D
S["橱窗 shop?userId="] --> D
D --> A{"访客动作"}
A -- "转发 / 海报" --> SH["仅归属人 + AUDITED<br/>30 分钟内复用 shareId"]
A -- "加微信" --> WX["contactWay<br/>二维码或联系我链接"]
A -- "在线咨询" --> C["咨询表单"]
SH --> LAND["落地页携带 shareId / shareAgentId"]
LAND --> C
C --> LEAD["生成线索"]
</pre>
</div>
<figcaption class="figure-caption"><strong>图 5:展示与分发路径。</strong><span>分享是归因入口:落地页携带的 shareId 会一路带到咨询提交,用于统计分享带来的线索。</span></figcaption>
</figure>
<ul>
<li><strong>广场筛选:</strong>关键词(楼盘名/地址/开发商)、区域、销售状态、总价区间;列表只取展示字段,不拉图片、户型、配套等大字段。</li>
<li><strong>详情权限:</strong>公开详情只返回已上架新盘;归属人可看全部状态与驳回原因;佣金政策仅归属人可见。</li>
<li><strong>转发限制:</strong><code>/share</code> 要求当前账号是新盘归属人且状态为 <code>AUDITED</code>,其他访客点击转发会降级为复制当前链接。</li>
<li><strong>分享归因:</strong>同一人同一新盘在 30 分钟内复用同一个 <code>shareId</code>,避免连点产生多条分享记录、稀释转化数据。</li>
<li><strong>加微信:</strong>后端返回 <code>qrCode</code> 时展示二维码;只返回 <code>contactUrl</code>(企微“联系我”网页)时新窗口打开,不再当图片渲染。</li>
</ul>
</section>
<section class="doc-block" id="lead">
<h2>七、线索闭环</h2>
<p>咨询是 C 端行为转化为业务资产的唯一入口。C 端详情咨询和 ERP 广场咨询最终都会创建“营销客”,并写入新房线索扩展表,完成楼盘、分享与归属专员的归因。</p>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
flowchart LR
A["C 端详情咨询"] --> API["capi contact"]
B["ERP 广场咨询"] --> API2["ERP publicContact"]
API --> D1{"同盘 + 同手机号<br/>10 分钟内"}
API2 --> D2{"同盘 + 同手机号<br/>10 分钟内"}
D1 -- "是" --> DUP["返回既有线索<br/>duplicate = true"]
D2 -- "是" --> DUP
D1 -- "否" --> C1["创建营销客<br/>CHANNEL_NEWHOUSE"]
D2 -- "否" --> C2["创建营销客<br/>CHANNEL_NEWHOUSE_B2B"]
C1 --> EXT["线索扩展表<br/>lead_id / project_id / share_id"]
C2 --> EXT
EXT --> CNT["project.lead_count + 1"]
CNT --> BOARD["线索看板<br/>按归属专员 / 部门"]
BOARD --> CONV["转客源跟进"]
</pre>
</div>
<figcaption class="figure-caption"><strong>图 6:咨询到线索的完整链路。</strong><span>C 端与 B 端共用同一套去重与计数口径,避免两个入口的数据对不上。</span></figcaption>
</figure>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
sequenceDiagram
participant U as C 端用户
participant API as capi
participant DB as MySQL
participant IS as InteractService
U->>API: 提交咨询(楼盘 / 姓名 / 手机号 / shareId)
API->>DB: 校验楼盘为 AUDITED
API->>DB: 查询 10 分钟内同盘同手机号线索
alt 命中重复
API-->>U: 提交成功(duplicate = true)
else 新建线索
API->>IS: submit(来源 CHANNEL_NEWHOUSE,归属专员)
IS->>DB: 写营销客 + 站内信
API->>DB: 写线索扩展 + lead_count + 1
API-->>U: 提交成功
end
</pre>
</div>
<figcaption class="figure-caption"><strong>图 7:C 端咨询时序。</strong><span>去重发生在创建之前;命中后直接返回成功,不再重复建线索、不再重复发通知。</span></figcaption>
</figure>
<ul>
<li><strong>归属规则:</strong>线索归属新盘的渠道专员(sys_user id);扩展表同时记录 <code>project_id</code>、<code>share_id</code>、<code>channel_user_id</code> 和咨询类型。</li>
<li><strong>看板权限:</strong>专员看本人、主管看本部门及以下、平台看全量;列表手机号脱敏,详情做记录级校验并强制过滤新房来源。</li>
<li><strong>转客源:</strong>线索看板可跳转客源管理,按手机号或姓名自动筛选,进入正式跟进流程。</li>
<li><strong>分享计次:</strong>咨询携带合法 <code>shareId</code> 时,会同时累加分享记录的线索数,用于评估转发效果。</li>
</ul>
</section>
<section class="doc-block" id="permissions">
<h2>八、权限、租户与安全边界</h2>
<p>渠道体系的核心风险是“跨公司越权”。系统采用三层判定:平台身份 → 租户一致性 → 记录归属(本人或本部门子树)。角色本身不再直接放行。</p>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
flowchart TD
R["业务请求"] --> P{"平台管理员 / 租户 0"}
P -- "是" --> OK["允许"]
P -- "否" --> T{"同租户?"}
T -- "否" --> NO["拒绝"]
T -- "是" --> O{"本人记录?"}
O -- "是" --> OK
O -- "否" --> L{"渠道主管且归属人<br/>在本人部门子树?"}
L -- "是" --> OK
L -- "否" --> NO
</pre>
</div>
<figcaption class="figure-caption"><strong>图 8:记录级权限判定。</strong><span>未建号的申请单没有部门归属,只允许平台查看,避免主管跨公司读取证件号。</span></figcaption>
</figure>
<div class="doc-table table-scroll">
<table class="doc-data-table">
<thead>
<tr><th>边界</th><th>当前处理</th></tr>
</thead>
<tbody>
<tr><td>租户隔离</td><td>渠道数据统一租户 8;平台管理员可跨租户</td></tr>
<tr><td>记录归属</td><td>本人或本部门子树;主管不能仅凭角色跨公司操作</td></tr>
<tr><td>企微绑定</td><td>按申请单校验归属;同一 <code>wecom_userid</code> 只能绑定一个专员</td></tr>
<tr><td>弱口令</td><td>租户 8 账号未改密或密码等于手机号后 6 位 → 登录后强制改密,后端拦截其他接口</td></tr>
<tr><td>管理员重置</td><td>重置渠道账号密码会清空改密时间,下次登录重新强制修改</td></tr>
<tr><td>申请单详情</td><td>列表手机号与身份证脱敏;完整信息仅平台审核时读取</td></tr>
</tbody>
</table>
<p class="figure-caption"><strong>表 3:安全边界。</strong><span>审核、上下架、停用、驳回等写操作全部带条件更新,防止并发覆盖。</span></p>
</div>
</section>
<section class="doc-block" id="data">
<h2>九、数据模型</h2>
<p>新房模块自身有五张核心表,另外复用系统用户、营销客与企微绑定表。理解这些关系,才能看懂“为什么后台代录的盘,小程序里看不到”这类问题。</p>
<figure class="doc-diagram">
<div class="diagram-frame table-scroll mermaid-frame">
<pre class="mermaid">
erDiagram
SYS_USER ||--o| ESTATE_NEWHOUSE_USER : "审核建号"
SYS_USER ||--o{ ESTATE_NEWHOUSE_PROJECT : "归属专员"
ESTATE_NEWHOUSE_USER ||--o{ ESTATE_NEWHOUSE_PROJECT : "C 端账号"
ESTATE_NEWHOUSE_PROJECT ||--o{ ESTATE_NEWHOUSE_LEAD_EXT : "楼盘线索"
ESTATE_CUSTOMER_LEAD ||--|| ESTATE_NEWHOUSE_LEAD_EXT : "lead_code"
SYS_USER ||--o| ESTATE_AGENT_WECOM : "企微绑定"
ESTATE_NEWHOUSE_USER ||--o{ ESTATE_NEWHOUSE_SHARE_LOG : "分享记录"
</pre>
</div>
<figcaption class="figure-caption"><strong>图 9:核心数据关系。</strong><span>申请单是 C 端账号与 B 端账号的桥梁;线索扩展表是“新盘—分享—专员”的归因载体。</span></figcaption>
</figure>
<div class="doc-table table-scroll">
<table class="doc-data-table">
<thead>
<tr><th>表</th><th>关键字段</th><th>作用</th></tr>
</thead>
<tbody>
<tr><td><code>estate_newhouse_user</code></td><td>apply_id、c_user_id、sys_user_id、phone、auth_status、tenant_id</td><td>入驻申请单与账号映射</td></tr>
<tr><td><code>estate_newhouse_project</code></td><td>project_id、user_id、c_user_id、status、total_price_min/max、publish_time、view_count、lead_count</td><td>新盘主表与运营计数</td></tr>
<tr><td><code>estate_newhouse_lead_ext</code></td><td>lead_id、lead_code、project_id、share_id、channel_user_id、contact_type</td><td>线索的楼盘与分享归因</td></tr>
<tr><td><code>estate_newhouse_share_log</code></td><td>share_id、user_id、project_id、share_type、lead_count</td><td>分享链接与转化统计</td></tr>
<tr><td><code>estate_agent_wecom</code></td><td>agent_id、wecom_userid、tenant_id</td><td>专员企微绑定</td></tr>
<tr><td><code>estate_customer_lead</code></td><td>lead_code、customer_phone、source_channel、owner_id</td><td>营销客主表(与客源管理共用)</td></tr>
</tbody>
</table>
<p class="figure-caption"><strong>表 4:核心表与字段。</strong><span>所有渠道表都以 <code>tenant_id = 8</code> 为运行前提。</span></p>
</div>
</section>
<section class="doc-block" id="api">
<h2>十、关键接口与权限点</h2>
<p>接口按端划分。C 端由 <code>capi</code> 提供,ERP 由 <code>ruoyi-estate</code> 提供;两边共享同一套状态与归属规则。</p>
<div class="doc-table table-scroll">
<table class="doc-data-table">
<thead>
<tr><th>端</th><th>接口</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td>C 端</td><td><code>GET /house/c/newhouse/list</code></td><td>广场列表:租户 8、仅 AUDITED、关键词/区域/状态/总价筛选</td></tr>
<tr><td>C 端</td><td><code>GET /house/c/newhouse/detail</code></td><td>详情:公开仅 AUDITED;归属人可看全部状态与驳回原因</td></tr>
<tr><td>C 端</td><td><code>POST /house/c/newhouse/contact</code></td><td>咨询:10 分钟幂等、创建线索、计数与站内信</td></tr>
<tr><td>C 端</td><td><code>POST /house/c/newhouse/share</code></td><td>分享:仅归属人且 AUDITED,30 分钟复用 shareId</td></tr>
<tr><td>C 端</td><td><code>GET /house/c/newhouse/contact-way</code></td><td>企微联系:返回二维码或联系我链接</td></tr>
<tr><td>C 端</td><td><code>POST /house/c/newhouse/publish</code></td><td>录入/编辑:需 APPROVED,提交即 PENDING</td></tr>
<tr><td>C 端</td><td><code>POST /house/c/newhouse/offline</code> / <code>online</code></td><td>下架 / 重新提审,带状态机校验</td></tr>
<tr><td>ERP</td><td><code>POST /estate/newhouse/user/audit/{id}</code></td><td>入驻审核:建号、绑角色、返回一次性口令</td></tr>
<tr><td>ERP</td><td><code>POST /estate/newhouse/project/audit/{id}</code></td><td>新盘审核:PENDING → AUDITED / REJECTED(CAS)</td></tr>
<tr><td>ERP</td><td><code>POST /estate/newhouse/project/publish/{id}</code> / <code>unpublish/{id}</code></td><td>上下架:AUDITED ↔ OFF_SHELF(CAS)</td></tr>
<tr><td>ERP</td><td><code>GET /estate/newhouse/lead/list</code></td><td>线索看板:按来源、归属、部门、时间筛选</td></tr>
<tr><td>ERP</td><td><code>GET /estate/newhouse/plaza/list</code></td><td>运营广场:只读,租户 8 + AUDITED</td></tr>
</tbody>
</table>
<p class="figure-caption"><strong>表 5:关键接口。</strong><span>ERP 接口权限点统一为 <code>estate:newhouse:*</code>,菜单按钮与角色绑定。</span></p>
</div>
</section>
<section class="doc-block" id="edge">
<h2>十一、边界、异常与已知取舍</h2>
<div class="doc-table table-scroll">
<table class="doc-data-table">
<thead>
<tr><th>场景</th><th>当前处理</th><th>目的</th></tr>
</thead>
<tbody>
<tr><td>重复咨询 / 连点</td><td>同盘 + 同手机号 10 分钟内复用既有线索</td><td>防止刷线索、重复站内信</td></tr>
<tr><td>并发审核 / 上下架</td><td>状态条件更新,失败提示刷新</td><td>避免重复通知、状态覆盖</td></tr>
<tr><td>编辑时详情加载失败</td><td>禁止提交并提示重试</td><td>防止空表单覆盖线上房源</td></tr>
<tr><td>分享连点</td><td>30 分钟内复用 shareId</td><td>保证分享转化数据可信</td></tr>
<tr><td>大图上传</td><td>超过 2MB 或 1920px 先压缩</td><td>避免几十 MB 原图超时/超限</td></tr>
<tr><td>远程图抓取失败</td><td>计入失败清单,不直接入库外链</td><td>防止外链过期后详情图裂图</td></tr>
<tr><td>弱口令</td><td>登录即强制改密;管理员重置后再次强制</td><td>消除手机号后 6 位可被猜测的风险</td></tr>
<tr><td>改密后的旧会话</td><td>不主动踢出其他设备(已知取舍)</td><td>如需全端失效,可后续按 userId 清理会话</td></tr>
<tr><td>官网首屏</td><td>列表/详情使用 SSR 取数</td><td>保证爬虫与分享卡片能拿到真实楼盘信息</td></tr>
</tbody>
</table>
<p class="figure-caption"><strong>表 6:边界与取舍。</strong><span>前六项已经实现;最后两项属于有意保留的产品取舍。</span></p>
</div>
</section>
<section class="doc-block" id="code">
<h2>十二、代码入口</h2>
<p>需要继续排查时,按端定位最快:C 端看 <code>capi/newhouse</code>,ERP 看 <code>ruoyi-estate</code>,前端分别看三个目录。</p>
<div class="doc-table table-scroll">
<table class="doc-data-table">
<thead>
<tr><th>层</th><th>路径</th></tr>
</thead>
<tbody>
<tr><td>C 端服务</td><td><code>capi/src/main/java/com/ruyizu/capi/newhouse/</code>(Controller / Service / Mapper)</td></tr>
<tr><td>ERP 后端</td><td><code>ruoyi-estate/src/main/java/com/ruoyi/estate/service/impl/EstateNewHouseServiceImpl.java</code></td></tr>
<tr><td>ERP SQL</td><td><code>ruoyi-estate/src/main/resources/mapper/estate/EstateNewHouseMapper.xml</code></td></tr>
<tr><td>C 端 H5</td><td><code>c-h5/src/pagesSub/newhouse/</code>(广场 / 详情 / 录入 / 我的 / 橱窗 / 线索 / 申请)</td></tr>
<tr><td>C 端官网</td><td><code>c-web/pages/newhouse/</code>(列表 / 详情 / 专员橱窗)</td></tr>
<tr><td>ERP 前端</td><td><code>ruoyi-ui/src/views/estate/newhouse/</code>(项目 / 渠道用户 / 线索 / 广场 / 笔记导入)</td></tr>
<tr><td>认证与强制改密</td><td><code>ruoyi-framework/.../SysLoginService.java</code>、<code>JwtAuthenticationTokenFilter.java</code></td></tr>
</tbody>
</table>
<p class="figure-caption"><strong>表 7:代码入口。</strong><span>数据库迁移集中在 <code>ruoyi-estate/.../config/DatabaseMigration.java</code>。</span></p>
</div>
</section>
<section class="doc-block" id="sources">
<h2>资料来源与版本</h2>
<ul>
<li>代码基线:<code>f9c0d8c</code>(包含渠道记录级权限、强制改密、线索幂等与 ERP 列表治理)。</li>
<li>数据结构:<code>zhenos_sh</code> 库中 <code>estate_newhouse_*</code>、<code>estate_customer_lead</code>、<code>estate_agent_wecom</code>。</li>
<li>整理日期:2026-11-12。若后续状态机、权限点或接口路径调整,请同步更新本页图 4、图 8 与表 5。</li>
</ul>
</section>
</main>
<script src="assets/mermaid.min.js"></script>
<script src="assets/doc.js"></script>
</body>
</html>
-919
View File
@@ -1,919 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>新房智联(NewHouse Link)—— 调研与设计方案</title>
<style>
:root {
--ink: #1f2329;
--ink-2: #5c6670;
--line: #e5e8ec;
--bg: #ffffff;
--bg-soft: #f7f8fa;
--brand: #2b6de5;
--brand-soft: #eef3fe;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
font-size: 14px; line-height: 1.78;
-webkit-font-smoothing: antialiased;
}
.layout { display: flex; align-items: flex-start; gap: 32px; padding: 24px 32px 64px; }
.toc {
position: sticky; top: 16px; flex: 0 0 236px; max-height: calc(100vh - 48px);
overflow: auto; padding: 14px 16px; border: 1px solid var(--line);
border-radius: 8px; background: var(--bg-soft); font-size: 13px;
}
.toc > ul { padding-left: 16px; margin: 0; }
.toc ul ul { padding-left: 14px; }
.toc li { margin: 3px 0; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--brand); }
.doc { flex: 1 1 auto; min-width: 0; max-width: 1000px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.4; font-weight: 600; }
h1 { font-size: 26px; margin: 8px 0 20px; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
h2 { font-size: 20px; margin: 34px 0 14px; padding-left: 10px; border-left: 4px solid var(--brand); }
h3 { font-size: 16px; margin: 24px 0 10px; }
h4 { font-size: 14px; margin: 18px 0 8px; color: var(--ink-2); }
p { margin: 10px 0; }
ul, ol { margin: 8px 0; padding-left: 24px; }
li { margin: 4px 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
blockquote {
margin: 12px 0; padding: 10px 16px; color: var(--ink-2);
background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 4px;
}
blockquote p { margin: 4px 0; }
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-size: 12.5px; background: #f2f4f7; border-radius: 3px; padding: 1px 5px;
}
pre {
margin: 12px 0; padding: 14px 16px; overflow: auto; background: #1f2430;
border-radius: 8px; line-height: 1.6;
}
pre code {
background: transparent; color: #e6e9ef; padding: 0; font-size: 12.5px;
white-space: pre;
}
table {
width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px;
display: table; overflow-x: auto;
}
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: #fbfcfd; }
img { max-width: 100%; }
@media (max-width: 900px) {
.layout { display: block; padding: 16px; }
.toc { position: static; max-height: none; margin-bottom: 20px; }
}
@media print {
.toc { display: none; }
.layout { display: block; padding: 0; }
}
</style>
</head>
<body>
<div class="layout">
<aside class="toc"><div class="toc">
<ul>
<li><a href="#_1">一、命名方案</a><ul>
<li><a href="#11-newhouse-link">1.1 名称:新房智联(英文/代码标识:NewHouse Link)</a></li>
<li><a href="#12">1.2 一句话定位</a></li>
</ul>
</li>
<li><a href="#_2">二、需求拆解与产品形态</a></li>
<li><a href="#_3">三、市场最佳实践调研(开发参考)</a><ul>
<li><a href="#31-c-web">3.1 C 端新房展示页(小程序端 / WEB 端)</a></li>
<li><a href="#32-erp">3.2 ERP 后台:新房列表管理 + 渠道管理</a></li>
</ul>
</li>
<li><a href="#_4">四、系统融合方案(与现有模块的完美融合)</a><ul>
<li><a href="#41">4.1 账号模型:组织架构落位 + 双入口(核心决策)</a></li>
<li><a href="#42">4.2 五端职责与复用映射</a></li>
<li><a href="#43">4.3 核心链路设计(融合现有机制)</a></li>
<li><a href="#44">4.4 与「微门店」的边界(防功能打架)</a></li>
<li><a href="#45-c">4.5 注册与入驻设计(双客群同小程序:C 端客户 + 渠道人员)</a></li>
</ul>
</li>
<li><a href="#databasemigration">五、数据模型(DatabaseMigration 新增)</a><ul>
<li><a href="#51-b-zhenos_sh">5.1 表清单(B 端库 zhenos_sh)</a></li>
<li><a href="#52">5.2 新盘状态机</a></li>
<li><a href="#53-estate_customer_lead">5.3 与 estate_customer_lead 的关联</a></li>
</ul>
</li>
<li><a href="#erp">六、ERP 端联通与权限设计</a><ul>
<li><a href="#61-sys_menu8400">6.1 菜单规划(sys_menu,8400 段——当前空闲)</a></li>
<li><a href="#62-sys_role_permission_scope">6.2 角色与数据域(sys_role_permission_scope 原生生效)</a></li>
<li><a href="#63-erp">6.3 审核建号流程(ERP 侧)</a></li>
<li><a href="#64">6.4 防污染与安全约束(组织架构方案的配套代价)</a></li>
<li><a href="#65">6.5 后端联通</a></li>
</ul>
</li>
<li><a href="#ux">七、分端页面设计(UX 规格)</a><ul>
<li><a href="#71-c-h5-pagessubnewhouse">7.1 小程序(c-h5 pagesSub/newhouse/)</a></li>
<li><a href="#72-webc-web">7.2 WEB(c-web)</a></li>
<li><a href="#73-erpruoyi-ui-viewsestatenewhouse">7.3 ERP(ruoyi-ui views/estate/newhouse/)</a></li>
</ul>
</li>
<li><a href="#_5">八、实施顺序建议(供后续开发排期参考)</a></li>
<li><a href="#_6">九、已知缺口与风险清单</a></li>
<li><a href="#_7">十、变更后必办事项(进入编码阶段时)</a></li>
</ul>
</div></aside>
<main class="doc">
<h1 id="newhouse-link">新房智联(NewHouse Link)—— 新房渠道模块 调研与设计方案</h1>
<blockquote>
<p>日期:2026-10-10 | 阶段:调研 + 方案设计(未进入编码)
需求来源:H5 新房功能模块,覆盖「渠道销售注册录入新盘 → 小程序录入 → 转发获客 → 微信直连渠道专员 → WEB 展示 → ERP 渠道用户/新房管理」全链路。
<strong>账号模型(2026-10-11 定稿):平台招募 + 专用租户 8 + 业务租户只读</strong>
渠道只由平台统一招募:渠道账号与新房数据统一归专用租户 <strong>8「新房智联」</strong>(新增 <code>capi.newhouse-tenant-id=8</code>,与 <code>capi.tenant-id</code> 解耦);平台租户 0 负责审核与线索跟进;业务租户(3/7)仅通过「新房广场」只读共享已上架新盘;C 端 H5/WEB 固定读租户 8。</p>
</blockquote>
<hr />
<h2 id="_1">一、命名方案</h2>
<h3 id="11-newhouse-link">1.1 名称:新房智联(英文/代码标识:NewHouse Link)</h3>
<table>
<thead>
<tr>
<th>层面</th>
<th>命名</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>产品名</td>
<td><strong>新房智联</strong></td>
<td>「新房」明确业务域,「智联」= 智慧直连(渠道专员 ↔ 客户 ↔ 案场),呼应"通过微信直接联系该渠道专员"的核心体验</td>
</tr>
<tr>
<td>菜单目录</td>
<td>新房智联</td>
<td>ERP 一级目录显示名</td>
</tr>
<tr>
<td>权限标识</td>
<td><code>estate:newhouse:*</code></td>
<td>遵循 <code>estate:模块[:业务]:操作</code> 规范</td>
</tr>
<tr>
<td>数据库表</td>
<td><code>estate_newhouse_*</code></td>
<td>遵循 <code>estate_</code> 前缀规范</td>
</tr>
<tr>
<td>小程序页面</td>
<td><code>pagesSub/newhouse/**</code></td>
<td>与 <code>pagesSub/mstore/</code>(微门店)并列</td>
</tr>
<tr>
<td>capi 路由</td>
<td><code>/house/c/newhouse/**</code></td>
<td>遵循 <code>/house/c/**</code> 契约</td>
</tr>
<tr>
<td>ERP 管理路由</td>
<td><code>/estate/newhouse/**</code></td>
<td>遵循 <code>/estate/**</code> 契约</td>
</tr>
</tbody>
</table>
<p>候选曾评估:盘客通(B端味过重)、新盘官(传播好但偏 C 端称号)、云案场(与明源概念撞车)、盘友圈(偏社交)。<strong>最终采用「新房智联」</strong>,兼顾两端语感与"直连"卖点。</p>
<h3 id="12">1.2 一句话定位</h3>
<blockquote>
<p>面向新房渠道销售的"注册即入驻"平台:渠道销售在小程序申请注册,后台审核通过后进入 ERP 组织架构,可在<strong>小程序或后台双入口</strong>录入新盘、转发自己的新盘橱窗;经纪人公司或 C 端客户扫码/点击即可通过微信直连该渠道专员;所有渠道的新盘与人员在 WEB 聚合展示、在 ERP 统一管理。</p>
</blockquote>
<hr />
<h2 id="_2">二、需求拆解与产品形态</h2>
<table>
<thead>
<tr>
<th>#</th>
<th>用户需求</th>
<th>产品形态</th>
<th>落地端</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>新房渠道销售注册后可录入新盘</td>
<td>小程序申请注册 → 后台审核通过 → <strong>建号入组织架构</strong>(「外部渠道体系」部门 + 渠道角色)→ 录入新盘</td>
<td>小程序(c-h5)+ ERP</td>
</tr>
<tr>
<td>2</td>
<td>渠道从小程序录入</td>
<td><code>pagesSub/newhouse/publish</code> 新盘录入页(发布即提审,复用 sharem 模式);<strong>后台同步提供录入页</strong>(双入口同表单)</td>
<td>小程序 + ruoyi-ui</td>
</tr>
<tr>
<td>3</td>
<td>录入后可转发自己的新房(类似微门店)</td>
<td>个人新盘橱窗页 + 分享海报/小程序卡片/链接(带归因)</td>
<td>小程序 + B端H5</td>
</tr>
<tr>
<td>4</td>
<td>经纪人公司/C 端客户可微信联系渠道专员</td>
<td>详情页/橱窗页「加微信」按钮 → 企微联系我二维码(state 归因)→ 回调建档</td>
<td>capi + 企业微信</td>
</tr>
<tr>
<td>5</td>
<td>WEB 端所有渠道发的新房展示页</td>
<td>c-web 新盘频道(列表 + 详情 + 按专员聚合的橱窗页)</td>
<td>c-web(Nuxt3 SSR)</td>
</tr>
<tr>
<td>6</td>
<td>ERP 端渠道注册用户列表</td>
<td>「新房智联 → 渠道用户」管理页(审核建号/停用/启用/导出)</td>
<td>ruoyi-ui</td>
</tr>
<tr>
<td>7</td>
<td>ERP 端渠道发的新房列表</td>
<td>「新房智联 → 渠道新盘」管理页(审核/上下架/推荐/导出)</td>
<td>ruoyi-ui</td>
</tr>
</tbody>
</table>
<hr />
<h2 id="_3">三、市场最佳实践调研(开发参考)</h2>
<h3 id="31-c-web">3.1 C 端新房展示页(小程序端 / WEB 端)</h3>
<p>调研对象:贝壳找房、安居客、幸福里等头部新房频道,及行业改版案例。</p>
<p><strong>详情页信息架构(行业共识):</strong></p>
<ol>
<li><strong>头图区</strong>:楼盘大图轮播/航拍/宣传视频,第一屏即"均价 + 价格区间 + 在售状态 + 核心卖点标签"</li>
<li><strong>价格透明</strong>:均价、总价区间、单价基准;进阶做法附"一房一价"公示表/备案价查询入口(安居客模式),显著增强信任</li>
<li><strong>户型模块合一</strong>:户型图 + 户型分析 + 样板间图集中在一个模块内浏览,避免用户在头图与户型区来回跳转(行业改版核心结论)</li>
<li><strong>配套独立成块</strong>:交通(地铁/驾车)、教育、商业、医疗分列展示,含距离/步行时间</li>
<li><strong>资质与信任</strong>:开发商、预售许可证、物业公司、产权年限、交房时间</li>
<li><strong>地图找房</strong>:楼盘位置 POI + 周边配套可视化(安居客/百度地图合作模式)</li>
<li><strong>动态资讯</strong>:楼盘动态、取证/开盘信息</li>
<li><strong>底部行动栏(Action Bar)</strong>:在线咨询 / 电话 / 预约看房 / 分享,常驻吸底</li>
</ol>
<p><strong>对本模块的启示:</strong>
- 渠道录入表单按上述信息架构切分为「基础信息 → 价格 → 户型 → 配套 → 资质 → 图片」分步录入,<strong>只录必填,选填可后补</strong>(降低外部渠道录入门槛)
- 详情页优先展示<strong>价格 + 户型 + 联系专员</strong>三要素(转化路径最短)
- 信任要素(预售证/备案价)是 C 端新房转化差异点,表单中做结构化字段而非纯文本</p>
<h3 id="32-erp">3.2 ERP 后台:新房列表管理 + 渠道管理</h3>
<p>调研对象:明源云「分销通」「渠道管家」、华拓云渠道管家、鼎尖新房分销报备等。</p>
<table>
<thead>
<tr>
<th>能力</th>
<th>行业做法</th>
<th>本模块取舍</th>
</tr>
</thead>
<tbody>
<tr>
<td>一键报备</td>
<td>微信/APP 报备直通案场</td>
<td><strong>一期不做报备/判客</strong>(本模块定位是"渠道发盘+获客",不做案场判客)</td>
</tr>
<tr>
<td>实时判客 / 客户归属唯一</td>
<td>API 判客、防撞客纠纷</td>
<td>线索归属沿用现有 <code>estate_customer_lead</code> 归属机制(houseId→agentId→deptId),<strong>归属唯一由线索表天然保证</strong></td>
</tr>
<tr>
<td>全流程管理</td>
<td>报备→判客→带看→分配→纠纷 全线上</td>
<td>一期:注册审核→录入→审核→上架→转发→线索→微信直连;带看/判客列为二期</td>
</tr>
<tr>
<td>佣金结算引擎</td>
<td>成交同步、规则核算、一键结算</td>
<td><strong>二期</strong>,一期只在新盘上挂"佣金说明"文本字段</td>
</tr>
<tr>
<td>渠道洞察</td>
<td>渠道业绩/费效看板</td>
<td>一期做基础统计(渠道数/新盘数/线索数),深度看板二期</td>
</tr>
</tbody>
</table>
<p><strong>对本模块的启示:</strong>
- ERP 新房列表必备列:楼盘名、区域、均价/总价区间、状态(待审核/已上架/已下架/已驳回)、渠道专员、公司、发布时间、线索数
- 渠道管理必备能力:注册审核、启用/停用、所属公司、手机号(脱敏显示)、新盘数、线索数、最后活跃
- 「客户归属唯一」「全程留痕」是行业刚性诉求 → 必须有分享归因 + 线索落库(复用现有机制)</p>
<hr />
<h2 id="_4">四、系统融合方案(与现有模块的完美融合)</h2>
<h3 id="41">4.1 账号模型:组织架构落位 + 双入口(核心决策)</h3>
<p><strong>决策:渠道账号 = sys_user,审核通过后入驻独立部门树「外部渠道体系」;小程序登录与后台登录是同一身份的两个入口。</strong></p>
<pre><code>小程序申请(capi /register, register_channel=NEWHOUSE_CHANNEL)→ c_user + 申请单(estate_newhouse_user, auth_status=PENDING)
│
├─ 审核通过 → 自动建号:sys_user(status='0',入驻「外部渠道体系/xx渠道公司」)
│ + 分配角色「新房渠道专员」(仅 estate:newhouse:*,data_scope=5 仅本人)
│ + estate_user_notice 站内通知
│
├─ 小程序入口:capi 短信登录(c_user 登录态)→ 身份解析 findByPhone → sys_user(微门店同款机制)
│
└─ 后台入口:sys_login(zf.zhuig.com / zfapp.zhuig.com)→ 仅见「新房智联」菜单,双入口录入同一套 estate_newhouse_* 表
拒绝/停用 = auth_status=REJECTED/DISABLED + sys_user.status='1'(禁登录即时生效)
</code></pre>
<p><strong>为什么比双轨方案(c_user + 影像表,不进 sys_user)更好(评估结论):</strong></p>
<table>
<thead>
<tr>
<th>维度</th>
<th>双轨方案</th>
<th>组织架构方案(采用)</th>
</tr>
</thead>
<tbody>
<tr>
<td>权限控制</td>
<td>自建身份判定,ERP 权限另写一套</td>
<td>原生 <code>@PreAuthorize</code> + 角色 + 菜单,零新建机制</td>
</tr>
<tr>
<td>数据域</td>
<td>影像表无部门,主管/专员数据域做不了</td>
<td><code>sys_role_permission_scope</code> data_scope 1-5 直接生效</td>
</tr>
<tr>
<td>组织层级</td>
<td>company_name 仅文本</td>
<td>部门树天然表达「渠道公司→团队→专员」,主管看本部门及以下免费得</td>
</tr>
<tr>
<td>归属链路</td>
<td>线索/分享/企微/提醒全靠 phone→userId 映射(换手机即断)</td>
<td>agentId=userId 直连,微门店整套机制原样复用</td>
</tr>
<tr>
<td>审核/停用</td>
<td>自建 auth_status + 双处同步</td>
<td>申请单状态 + <code>sys_user.status</code> 一处控制</td>
</tr>
<tr>
<td>租户隔离</td>
<td>capi 固定租户,口径要对齐</td>
<td>tenant_id + TenantInterceptor/injectTenantId 双防线自动覆盖</td>
</tr>
<tr>
<td>后台录入</td>
<td>无登录态,做不了</td>
<td>天然支持(需求"渠道进后台录入"的唯一可行解)</td>
</tr>
</tbody>
</table>
<p><strong>代价(必须配套处理,详见 §6.4):</strong> 外部账号进入组织架构会污染用户下拉与人效统计,且外部账号可登录后台扩大敏感面——用「独立部门 + 下拉过滤 + 最小权限角色」三件事对冲。</p>
<h3 id="42">4.2 五端职责与复用映射</h3>
<table>
<thead>
<tr>
<th>端</th>
<th>职责</th>
<th>复用(关键)</th>
<th>新增</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>c-h5(小程序)</strong></td>
<td>渠道申请注册/录入新盘/我的新盘/橱窗转发/联系</td>
<td>注册登录(<code>api/auth.ts</code>)、UGC 录入+我的管理(<code>pagesSub/sharem/</code> 模式)、海报生成(<code>utils/poster.ts</code> PosterData)、橱窗页(<code>pagesSub/mstore/index.vue</code> 结构)</td>
<td><code>pagesSub/newhouse/{index,publish,detail,my}.vue</code></td>
</tr>
<tr>
<td><strong>c-web(官网)</strong></td>
<td>全渠道新盘展示页(列表/详情/专员橱窗)</td>
<td><code>agent/[id]</code> 橱窗模板、HouseCard 组件、SEO/SSR 路由</td>
<td><code>newhouse/</code> 频道(列表 + 详情 + [agentId] 橱窗)</td>
</tr>
<tr>
<td><strong>capi(C 端服务 8635)</strong></td>
<td>渠道申请注册、新盘 CRUD、分享归因、线索、企微联系</td>
<td><code>AuthController</code> 注册登录、<code>AgentMapper.findByPhone</code>(身份解析)、<code>InteractService.writeLead</code>、<code>WecomContactController.contactWay</code></td>
<td><code>/house/c/newhouse/**</code> 一组接口 + <code>NewHouseController</code></td>
</tr>
<tr>
<td><strong>ruoyi-estate(B 端)</strong></td>
<td>ERP 管理:申请审核建号、新盘审核/上下架、统计;后台录入接口</td>
<td><code>EstateStoreController</code>(管理页+接口模板)、<code>SysUser</code> 建号/角色分配(system 服务)、DatabaseMigration 幂等建表</td>
<td><code>EstateNewHouseController</code> + Service/Mapper + <strong>审核建号流程</strong></td>
</tr>
<tr>
<td><strong>ruoyi-ui(ERP 前端)</strong></td>
<td>渠道用户(申请审核建号)、新盘管理、后台录入页</td>
<td><code>views/estate/sharem/post/</code>、<code>views/estate/store/</code> 页面模板、<code>api/estate/</code> 模式、列偏好(right-toolbar)</td>
<td><code>views/estate/newhouse/{user,project,publish}/</code> + <code>api/estate/newhouse.js</code></td>
</tr>
</tbody>
</table>
<h3 id="43">4.3 核心链路设计(融合现有机制)</h3>
<pre><code>渠道销售 客户/经纪人公司 ERP
│ │ │
├─ 小程序申请注册 → c_user + 申请单 ────────────────────────────────→│ 审核
│ │ ├─ 通过 → 建 sys_user 入「外部渠道体系」部门
│ │ │ + 角色「新房渠道专员」+ 站内通知
│ │ │
├─ 录入新盘(小程序 或 后台双入口) │ │
│ → estate_newhouse_project ──────────────→│ │
│ (幂等写 B 端表,含 tenant_id) │ │
│ │ │
├─ 转发橱窗/新盘(海报/小程序卡片/链接) │ │
│ 分享归因 state=`channel_{userId}_{shareType}_{shareId}` │
│ → estate_newhouse_share_log ─────────→│ │
│ │ │
│ 客户浏览详情(c-web / c-h5) │
│ ├─ 「加微信」→ 企微联系我二维码
│ │ state 归因 → estate_customer_wecom 回调建档
│ 咨询/留电 → InteractService.writeLead │
│ │ → estate_customer_lead(MK+yyyyMM+4位)
│ │ → estate_user_notice 站内提醒 ──→│
│ │ ├─ 渠道用户管理(审核建号/停用)
└────────────────────────────────────────────┴────────────────────────┤ 新盘管理(审核/上下架/推荐)
└─ 线索查看(归属专员/部门)
</code></pre>
<p><strong>关键融合点(12 条复用能力):</strong></p>
<ol>
<li><strong>身份模型</strong>:渠道用户即 sys_user(外部渠道部门),归属/分享/企微/站内提醒全部 <strong>userId 直连</strong>;小程序登录态仍走 capi(c_user),身份解析沿用 <code>AgentMapper.findByPhone</code>(<code>c_user.phone</code> ↔ <code>sys_user.phonenumber</code>,微门店同款),<strong>双登录面同一身份</strong></li>
<li><strong>注册登录</strong>:复用 <code>AuthController</code>(/register /loginBySms /loginByWechat),<code>register_channel</code> 增加 <code>NEWHOUSE_CHANNEL</code>;审核通过后由 B 端服务自动建 sys_user + 分配角色(复用 system 的用户/角色服务)</li>
<li><strong>UGC 录入形态</strong>:照搬 sharem「发布即提审」交互,<strong>内容默认审核制</strong>(外部渠道内容需审核,见 §5.2)</li>
<li><strong>橱窗/货架</strong>:照搬 <code>estate_store_listing_pin</code> 增量货架模式 → <code>estate_newhouse_shelf</code>(专员的转发橱窗可置顶/隐藏新盘)</li>
<li><strong>分享归因</strong>:沿用 <code>estate_store_share_log</code> 双轨归因(B端 <code>shareAgentId</code> 参数 / capi <code>state</code> 归因串),新盘分享 shareId 同规则(UUID 前 16 位)</li>
<li><strong>海报/二维码</strong>:PosterData 扩 <code>kind: 'NEWHOUSE'</code>,qrContent = 带归因的新盘分享链接(c-h5/zhenfang-uni/ruoyi-ui 三处海报工具同步)</li>
<li><strong>线索闭环</strong>:咨询/留电走 <code>InteractService.submit</code>(source 扩为 <code>CHANNEL_NEWHOUSE</code>),自动写 <code>estate_customer_lead</code> + <code>estate_user_notice</code> → B 端营销客转正(convert_status 机制不变);<strong>归属 agentId 直接取渠道专员的 sys_user id,无需映射</strong></li>
<li><strong>企微直连</strong>:<code>WecomContactController.contactWay</code> state 前缀扩 <code>channel_</code>(现 <code>mstore_</code>),回调经 <code>estate_customer_wecom</code> 建档;会话存档沿用 <code>estate_store_chat_record</code> 定时拉取</li>
<li><strong>多租户</strong>:渠道专员按真实租户入驻(如 tenant 3 上海房聚缘),<code>injectTenantId</code> 双防线自动覆盖新盘/线索数据;capi 写 B 端表的租户取渠道专员所属租户(不再是固定 capi.tenant-id)</li>
<li><strong>ERP 菜单权限</strong>:复制 8300 微门店菜单模式(M 目录 → C 菜单 → F 按钮)→ 8400 段</li>
<li><strong>数据域精细化</strong>:<code>sys_role_permission_scope</code> 原生生效——渠道主管 data_scope=4(本部门及以下)、渠道专员 data_scope=5(仅本人)、运营 data_scope=1(数据域口径:1全部/2自定义部门/3本部门/4本部门及以下/5仅本人)</li>
<li><strong>上架判定</strong>:WEB/H5 展示沿用 <code>publish_platform LIKE '%SELF%' AND listing_status IN (...)</code> 风格的状态过滤(新盘用自身状态机:DRAFT/PENDING/AUDITED/REJECTED/OFF_SHELF)</li>
</ol>
<h3 id="44">4.4 与「微门店」的边界(防功能打架)</h3>
<table>
<thead>
<tr>
<th></th>
<th>微门店(mstore)</th>
<th>新房智联</th>
</tr>
</thead>
<tbody>
<tr>
<td>用户</td>
<td>内部经纪人(sys_user,内部部门)</td>
<td>外部渠道销售(sys_user,<strong>外部渠道体系部门</strong>,最小权限角色)</td>
</tr>
<tr>
<td>货</td>
<td>二手房/租房(estate_listing)</td>
<td>新盘(estate_newhouse_project,独立表)</td>
</tr>
<tr>
<td>入口</td>
<td>B端 H5 微门店页</td>
<td>小程序 newhouse 页 + 后台录入页</td>
</tr>
<tr>
<td>共享</td>
<td>归因/海报/企微/线索基础设施</td>
<td>同左(同构复用,不共享货架表)</td>
</tr>
</tbody>
</table>
<p><strong>决策:新盘不复用 <code>estate_listing</code></strong>。原因:estate_listing 57 字段 + 11 子表 + 四级级联(项目→栋座→单元→房号)不适配外部渠道轻量录入;字典值 <code>NEW</code> 已于 2026-08-10 下线(<code>V20260810__remove_new_property.sql</code>)。新盘是"楼盘级"信息(一个盘可由多名渠道销售各发一条),与二手房"房源级"模型本质不同。</p>
<h3 id="45-c">4.5 注册与入驻设计(双客群同小程序:C 端客户 + 渠道人员)</h3>
<p><strong>核心决策:注册不分叉,渠道入驻是登录后的"叠加能力"。</strong> 不在注册环节问"你是谁"——所有人注册统一走现有 C 端流程(零改动、零摩擦),渠道入驻是登录后的一个「申请认证」动作,与已定账号模型(申请单 → 审核 → 建 sys_user)无缝衔接。</p>
<table>
<thead>
<tr>
<th>方案</th>
<th>结论</th>
</tr>
</thead>
<tbody>
<tr>
<td>A. 注册时选身份(找房客户/渠道销售)</td>
<td>❌ 注册是 C 端转化最高危环节,多一步即流失;身份判断前置,但一个渠道销售自己也可能找房,两种身份本可共存</td>
</tr>
<tr>
<td>B. 统一注册 + 登录后申请入驻(<strong>采用</strong>)</td>
<td>✅ C 端注册完全不动;渠道申请带实名+审核天然防刷;账号叠加不互斥</td>
</tr>
<tr>
<td>C. 拆双小程序(找房端/渠道工作台)</td>
<td>❌ 行业惯例(贝壳找房 vs 贝壳经纪人)但成本翻倍且<strong>分享链路断裂</strong>——渠道转发的橱窗必须落在客户所在的小程序里</td>
</tr>
<tr>
<td>D. 邀请码注册</td>
<td>非独立方案,作为 B 的增强(绑定归属公司/团队、白名单快速过审)</td>
</tr>
</tbody>
</table>
<p><strong>注册/入驻完整流程:</strong></p>
<pre><code>① 注册(现状不动):/register 或 /loginBySms 首登自动注册 → c_user(短信验证即手机实名一级)
② 渠道入驻申请(新增):填表 → estate_newhouse_user 申请单(auth_status=PENDING)
表单最小集:姓名 + 登录手机号(默认当前手机)+ 渠道公司 + 门店/团队 + 常驻城市
选填:职位 / 名片工牌照片(提通过率)/ 邀请码(有则自动绑定部门归属)
③ ERP「渠道用户」审核通过 → 自动建 sys_user 入「外部渠道体系/xx公司」+ 渠道角色 → 站内通知
④ 身份解锁:小程序「我的」出现渠道专区,新盘录入入口开放
</code></pre>
<p><strong>入驻申请的 4 个入口:</strong></p>
<ol>
<li>「我的」页 →「渠道入驻」banner/列表项(对未入驻用户显示)</li>
<li>新盘录入页 <code>publish</code> 门控:无渠道身份 → 跳申请页(mstore「无权限提示」同款先例)</li>
<li><strong>分享/邀请直达</strong>:已入驻渠道转发橱窗带 <code>invite={userId}</code>、运营邀请海报带邀请码 → 落地申请页并预填归属公司(渠道拉新主路径)</li>
<li>首页金刚区可选入口(运营配置开关)</li>
</ol>
<p><strong>「我的」页身份态门控(运行时按 auth_status 渲染,<code>GET /house/c/newhouse/my/status</code> 统一查询):</strong></p>
<table>
<thead>
<tr>
<th>状态</th>
<th>UI</th>
</tr>
</thead>
<tbody>
<tr>
<td>普通 C 端用户</td>
<td>找房足迹/收藏/委托 + 「渠道入驻」入口</td>
</tr>
<tr>
<td>申请中</td>
<td>入口变为状态卡「入驻审核中」</td>
</tr>
<tr>
<td>已入驻</td>
<td>渠道专区:我的新盘 / 我的橱窗 / 线索数 / 录入入口解锁</td>
</tr>
<tr>
<td>已驳回</td>
<td>状态卡 + 驳回原因 + 重新申请</td>
</tr>
<tr>
<td>已停用</td>
<td>提示联系运营</td>
</tr>
</tbody>
</table>
<p><strong>3 个集成细节(易漏):</strong></p>
<ol>
<li><strong><code>registerCustomerIntoB</code> 处置</strong>(<code>AuthController</code> 注册/首登自动注册后幂等写 <code>estate_customer</code> 营销客):渠道来源注册也会建 C 端客户——<strong>保留</strong>(无害且渠道销售也可能找房),但 <code>register_channel=NEWHOUSE_CHANNEL</code> 落标记,客源统计可筛选排除</li>
<li><strong>重复身份防重</strong>:申请时 findByPhone 命中内部 sys_user 经纪人 → 提示「您已是平台经纪人,无需入驻」;同手机号仅允许一个有效申请(唯一约束);一个 c_user 可叠加渠道身份,与 C 端客户身份不互斥</li>
<li><strong>微信类目审核</strong>:房产类目需资质(C 端找房已涉及);渠道工作台属工具功能混排一般可行,渠道入口保留运营开关以备审核调整</li>
</ol>
<hr />
<h2 id="databasemigration">五、数据模型(DatabaseMigration 新增)</h2>
<blockquote>
<p>版本串:<code>2026.10.11.v33-newhouse-wecom-bind</code>(全局唯一,带业务后缀;上一版为 <code>2026.10.10.v32-newhouse-link</code> 建表,v33 追加菜单 8413 企微绑定权限)
建表走 <code>DatabaseMigration.migrateNewHouseModule()</code>,<code>CREATE TABLE IF NOT EXISTS</code> 幂等。</p>
</blockquote>
<h3 id="51-b-zhenos_sh">5.1 表清单(B 端库 zhenos_sh)</h3>
<table>
<thead>
<tr>
<th>表</th>
<th>作用</th>
<th>关键字段</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>estate_newhouse_user</code></td>
<td>渠道<strong>申请单 + 业务扩展</strong>(账号主体是 sys_user,本表存审核状态与渠道业务信息)</td>
<td>apply_id(PK)、sys_user_id(审核建号后回填)、c_user_id、phone、name、company_name、id_card(加密/可选)、auth_status(PENDING/APPROVED/REJECTED/DISABLED)、reject_reason、wecom_state、tenant_id、del_flag</td>
</tr>
<tr>
<td><code>estate_newhouse_project</code></td>
<td>渠道新盘(一盘一条录入记录)</td>
<td>project_id(PK)、user_id(录入专员=sys_user_id)、project_name、city_id、district_id、address、avg_price/total_price_min/max、sale_status、developer、presale_permit_no、open_time、handover_time、property_right_years、feature_tags、cover_image、images(JSON)、house_types(JSON)、supporting(JSON 交通/教育/商业/医疗)、commission_note、status(DRAFT/PENDING/AUDITED/REJECTED/OFF_SHELF)、reject_reason、publish_platform、tenant_id、del_flag</td>
</tr>
<tr>
<td><code>estate_newhouse_shelf</code></td>
<td>专员转发橱窗货架(复用 pin 模式)</td>
<td>shelf_id、user_id、project_id、pin_type(NORMAL/TOP/HIDE)、sort</td>
</tr>
<tr>
<td><code>estate_newhouse_share_log</code></td>
<td>分享归因</td>
<td>share_id(UUID前16)、user_id、project_id、share_type(HOUSE/STORE)、state、channel(MINI/H5/WEB/POSTER)、view_count、lead_count</td>
</tr>
<tr>
<td><code>estate_newhouse_lead_ext</code></td>
<td>线索扩展(主线索仍落 estate_customer_lead)</td>
<td>lead_id、project_id、share_id、channel_user_id(追溯"谁的分享带来的线索")</td>
</tr>
</tbody>
</table>
<p><strong>账号侧(复用现有表,不新建):</strong>
- <code>sys_user</code> / <code>sys_user_role</code> / <code>sys_dept</code>:审核通过后自动建号入「外部渠道体系/xx渠道公司」部门 + 分配「新房渠道专员」角色
- <code>c_user</code>(zhenos_c):小程序登录态照旧,<code>register_channel</code> 增加 <code>NEWHOUSE_CHANNEL</code> 值;身份解析 findByPhone → sys_user
- 渠道身份判定 = <code>estate_newhouse_user.auth_status=APPROVED</code> 且 sys_user.status='0'</p>
<h3 id="52">5.2 新盘状态机</h3>
<pre><code>草稿(DRAFT) → 待审核(PENDING) → 已上架(AUDITED) ──┬─→ 已下架(OFF_SHELF) → 重新提审(PENDING)
└→ 已驳回(REJECTED) → 可编辑后重新提审
</code></pre>
<ul>
<li>录入发布即进 PENDING(外部渠道内容默认审核制,配置开关 <code>newhouse.autoAudit</code> 可关)</li>
<li>WEB/小程序仅展示 AUDITED;ERP 可见全部</li>
<li>审核通过后同步写 <code>estate_user_notice</code> 通知专员</li>
</ul>
<h3 id="53-estate_customer_lead">5.3 与 estate_customer_lead 的关联</h3>
<p>沿用 <code>InteractService.writeLead</code>,不改主表结构:
- <code>source_channel</code> 增加 <code>CHANNEL_NEWHOUSE</code>(渠道新盘)
- <code>house_id</code> 字段复用为 project_id 语义不可行 → <strong>扩展表 <code>estate_newhouse_lead_ext</code></strong> 按 lead_id 关联(避免污染现有字段语义)
- 归属计算:channel_user_id 即 sys_user id → agentId/deptId 直接落库(无映射环节);异常兜底 DEFAULT_OWNER</p>
<hr />
<h2 id="erp">六、ERP 端联通与权限设计</h2>
<h3 id="61-sys_menu8400">6.1 菜单规划(sys_menu,8400 段——当前空闲)</h3>
<table>
<thead>
<tr>
<th>menu_id</th>
<th>类型</th>
<th>名称</th>
<th>perms</th>
</tr>
</thead>
<tbody>
<tr>
<td>8400</td>
<td>M</td>
<td>新房智联</td>
<td>—</td>
</tr>
<tr>
<td>8401</td>
<td>C</td>
<td>渠道用户</td>
<td><code>estate:newhouse:user:list</code></td>
</tr>
<tr>
<td>8402</td>
<td>C</td>
<td>渠道新盘</td>
<td><code>estate:newhouse:project:list</code></td>
</tr>
<tr>
<td>8403</td>
<td>C</td>
<td>线索看板</td>
<td><code>estate:newhouse:lead:list</code></td>
</tr>
<tr>
<td>8404</td>
<td>C</td>
<td>新盘录入(后台录入入口)</td>
<td><code>estate:newhouse:project:add</code></td>
</tr>
<tr>
<td>8405</td>
<td>C</td>
<td>新房广场(业务租户只读)</td>
<td><code>estate:newhouse:public:list</code></td>
</tr>
<tr>
<td>8411~8417</td>
<td>F(渠道用户按钮)</td>
<td>查询/新增/修改/删除/导出/审核建号/停用</td>
<td><code>estate:newhouse:user:{query|add|edit|remove|export|audit|disable}</code></td>
</tr>
<tr>
<td>8421~8428</td>
<td>F(渠道新盘按钮)</td>
<td>查询/修改/删除/导出/审核/上架/下架/推荐</td>
<td><code>estate:newhouse:project:{query|edit|remove|export|audit|publish|unpublish|recommend}</code></td>
</tr>
<tr>
<td>8431~8433</td>
<td>F(线索按钮)</td>
<td>查询/导出/转客</td>
<td><code>estate:newhouse:lead:{query|export|convert}</code></td>
</tr>
</tbody>
</table>
<p>权限标识严格遵循 <code>estate:模块:业务:操作</code>(操作后缀:list/query/add/edit/remove/export/import + 业务动词 audit/publish/…)。</p>
<h3 id="62-sys_role_permission_scope">6.2 角色与数据域(sys_role_permission_scope 原生生效)</h3>
<table>
<thead>
<tr>
<th>角色</th>
<th>菜单权限</th>
<th>data_scope</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>平台运营/超管(租户 0)</td>
<td>8400~8404 全部 + system:user 管理</td>
<td>1(全部数据)</td>
<td>审核渠道/新盘、跟进线索、绑定企微</td>
</tr>
<tr>
<td><strong>新房渠道专员</strong>(租户 8 专属角色)</td>
<td>8400/8402/8403/8404 + 本人新盘/线索</td>
<td>5(仅本人)</td>
<td>小程序为主,可登录 ERP 但只见到新房菜单</td>
</tr>
<tr>
<td>业务租户(3/7)</td>
<td>仅 8405「新房广场」</td>
<td>—</td>
<td>只读已上架新盘,无审核/渠道/线索权限</td>
</tr>
</tbody>
</table>
<blockquote>
<p>🚨 前置核对:<code>SecurityConfig</code> 的 <code>@EnableMethodSecurity(prePostEnabled)</code> 必须为 <code>true</code>,否则 <code>@PreAuthorize</code> 全部失效(安全规则红线)。</p>
</blockquote>
<h3 id="63-erp">6.3 审核建号流程(ERP 侧)</h3>
<ol>
<li>「渠道用户」页出现 PENDING 申请(姓名/手机号/公司/渠道来源)</li>
<li>点「审核通过」→ 后端同一事务:建 sys_user(userName=手机号、昵称=姓名、password 随机初始化)、入「外部渠道体系/xx渠道公司」部门(公司不存在则建部门)、绑定「新房渠道专员」角色、回填 <code>estate_newhouse_user.sys_user_id</code>、<code>auth_status=APPROVED</code>、写 <code>estate_user_notice</code> 通知</li>
<li>「驳回」→ 填原因,小程序端可见;「停用」→ sys_user.status='1' + auth_status=DISABLED(登录即时失效)</li>
<li>首次登录:小程序短信登录直接可用(登录态走 capi);后台入口需密码重置/短信找回(复用 RuoYi 找回密码或后台重置)</li>
</ol>
<h3 id="64">6.4 防污染与安全约束(组织架构方案的配套代价)</h3>
<ol>
<li><strong>用户下拉过滤</strong>(已核实问题):ERP 多处业务页用 <code>listUser({pageSize: 999~9999})</code> 全量拉用户做下拉(<code>estate/transaction/task</code>、<code>estate/transaction/report</code>、<code>estate/statistics/transaction</code>、<code>system/dept</code> 等)→ 渠道账号会混入经办人/负责人下拉。处置:
- 部门隔离:独立顶级部门「<strong>外部渠道体系</strong>」,与内部部门平行
- <code>selectUserList</code> 及下拉接口按 <code>dept_id NOT IN (外部渠道体系)</code> 过滤(或 DatabaseMigration 给 sys_user 加 <code>account_kind</code> 扩展列,按列过滤更稳)</li>
<li><strong>敏感面管控</strong>:渠道角色只挂 <code>estate:newhouse:*</code>,薪酬/客源/房源/交易/系统管理菜单绝不进渠道角色;渠道角色配置变更需运营复核(权限审计留痕 <code>@Log</code>)</li>
<li><strong>统计口径</strong>:业务日报/人效统计/登录日志按部门排除外部渠道体系,避免污染内部 KPI</li>
<li><strong>双登录面一致性</strong>:小程序身份解析 findByPhone → sys_user 后,与后台登录同一 userId,分享归因/线索归属/站内提醒两端一致;换绑手机号需走申请单更新(同步 sys_user.phonenumber 与 c_user.phone)</li>
<li><strong>账号安全</strong>:后台登录走 sys_login(验证码),渠道账号纳入登录日志监控;导出操作走 <code>export</code> 权限留痕</li>
</ol>
<h3 id="65">6.5 后端联通</h3>
<ul>
<li>ERP 管理接口:<code>/estate/newhouse/**</code>(<code>EstateNewHouseController extends BaseController</code>,<code>@PreAuthorize("@ss.hasPermi('estate:newhouse:...')")</code>,增删改加 <code>@Log</code>);审核建号调用 system 用户服务(不直改框架核心,经 <code>ISysUserService</code>)</li>
<li>capi 接口:<code>/house/c/newhouse/**</code>(JWT header <code>token</code>,走 C 端鉴权,渠道身份校验 = findByPhone → sys_user + <code>estate_newhouse_user.auth_status</code> 双查)</li>
<li>跨端契约:capi 写 B 端表与 ruoyi-estate 读同一套 <code>estate_newhouse_*</code> 表(同库 zhenos_sh,与 sharem/customer_lead 同模式),<strong>无需同步服务</strong></li>
<li>双前端检查清单(跨端守则):本模块改动均为新增接口/新增页面,不触碰共享接口;共享变更点是 <code>InteractService</code> 的 source 枚举、<code>WecomContactController</code> state 前缀、<code>selectUserList</code> 下拉过滤——第三项属共享查询接口,改动前 grep WEB(<code>api/estate/</code>) 与 H5(<code>zhenfang-uni/src/services/</code>) 确认两端下拉不受影响</li>
</ul>
<hr />
<h2 id="ux">七、分端页面设计(UX 规格)</h2>
<h3 id="71-c-h5-pagessubnewhouse">7.1 小程序(c-h5 <code>pagesSub/newhouse/</code>)</h3>
<table>
<thead>
<tr>
<th>页面</th>
<th>内容</th>
<th>复用参考</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>index</code></td>
<td>新盘广场:城市/价格/状态筛选 + 新盘卡片(图/名/均价/标签/专员)</td>
<td>sharem/index</td>
</tr>
<tr>
<td><code>detail</code></td>
<td>新盘详情:头图→均价区间→卖点→户型合一→配套→资质(预售证)→动态→地图→吸底行动栏(咨询/加微信/电话/分享)</td>
<td>行业详情页架构 §3.1</td>
</tr>
<tr>
<td><code>publish</code></td>
<td>分步录入:基础→价格→户型→配套→资质→图片(必填最少化)</td>
<td>sharem/publish</td>
</tr>
<tr>
<td><code>my</code></td>
<td>我的新盘:状态标签(待审/已上架/已驳回)、编辑/下架/转发</td>
<td>sharem/my</td>
</tr>
<tr>
<td><code>shop/[userId]</code></td>
<td>我的橱窗(转发落地页):专员名片 + 转发货架新盘 + 四按钮(分享/电话/加企微/咨询)</td>
<td>mstore/index 整页结构</td>
</tr>
<tr>
<td><code>apply</code></td>
<td>渠道申请注册页(未审核/被驳回状态入口)</td>
<td>auth 注册页扩展</td>
</tr>
</tbody>
</table>
<p>转发能力:<code>onShareAppMessage/onShareTimeline</code> 带 <code>channel={userId}_{shareId}</code>;海报 PosterData <code>kind:'NEWHOUSE'</code>;H5 链接 <code>?shareAgentId=</code> 双轨归因。</p>
<h3 id="72-webc-web">7.2 WEB(c-web)</h3>
<ul>
<li><code>/newhouse</code> 列表(SSR,SEO):城市切换 + 筛选 + 卡片流(HouseCard 复用,扩新房字段)</li>
<li><code>/newhouse/[id]</code> 详情:同小程序详情架构(大屏两栏:左媒体右信息 + 底部联系卡)</li>
<li><code>/newhouse/agent/[userId]</code> 专员橱窗页:对应 mstore 的 WEB 版(c-web 已有 <code>agent/[id]</code> 模板可复用)</li>
<li>「加微信」= 企微联系我二维码弹层(<code>/house/c/wecom/contactWay</code> state=channel_ 归因)</li>
</ul>
<h3 id="73-erpruoyi-ui-viewsestatenewhouse">7.3 ERP(ruoyi-ui <code>views/estate/newhouse/</code>)</h3>
<ul>
<li><code>user/index.vue</code>:渠道用户列表(<strong>申请审核建号</strong>/停用/启用/详情抽屉含其新盘+线索)</li>
<li><code>project/index.vue</code>:渠道新盘列表(筛选:状态/城市/专员;操作:审核弹窗/上下架/推荐/驳回填原因)</li>
<li><code>publish/index.vue</code>:后台新盘录入页(与小程序同表单结构,渠道专员/运营双角色可用)</li>
<li><code>lead/index.vue</code>:线索看板(来源=渠道新盘,含分享归因链路:share_id → project → user)</li>
</ul>
<hr />
<h2 id="_5">八、实施顺序建议(供后续开发排期参考)</h2>
<ol>
<li><strong>M1 数据层 + 账号链路</strong>:DatabaseMigration v32/v33 建表与菜单、capi 申请注册接口、ERP 审核建号流程(sys_user 自动建号+角色+部门)</li>
<li><strong>M2 小程序</strong>:newhouse 六个页面 + 海报/转发归因 + 线索落库</li>
<li><strong>M3 后台录入 + 防污染</strong>:ruoyi-ui 新盘录入页、<code>selectUserList</code> 下拉过滤/<code>account_kind</code> 扩展、统计口径排除</li>
<li><strong>M4 企微直连</strong>:contactWay state 扩 <code>channel_</code> + 回调建档 + 详情页/橱窗页「加微信」</li>
<li><strong>M5 ERP 管理</strong>:菜单 8400 段 SQL + <code>/estate/newhouse/**</code> + ruoyi-ui 管理页 + 角色/数据域配置</li>
<li><strong>M6 WEB 展示</strong>:c-web newhouse 频道(列表/详情/专员橱窗)</li>
<li><strong>M7 验证</strong>:E2E(申请→审核建号→双入口录入→审核→转发→线索→企微直连→停用失效)+ 跨端检查清单 + <code>npm run kg:sync</code>/<code>kg:health</code></li>
</ol>
<p>二期(本方案不含):报备/判客/带看、佣金结算引擎、渠道业绩看板、一房一价结构化、微信登录真打通后的免密注册。</p>
<hr />
<h2 id="_6">九、已知缺口与风险清单</h2>
<table>
<thead>
<tr>
<th>#</th>
<th>风险/缺口</th>
<th>影响</th>
<th>处置建议</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>微信登录 <code>loginByWechat</code> openid 为 mock,未真打通</td>
<td>小程序微信一键注册不可用</td>
<td>一期以短信注册为主,微信登录打通列为前置依赖</td>
</tr>
<tr>
<td>2</td>
<td><code>estate_agent_wecom</code> 只读无写接口(企微绑定手工)</td>
<td>渠道专员企微联系我二维码需人工绑定</td>
<td>增加绑定接口或后台录入页(M4 一并处理)</td>
</tr>
<tr>
<td>3</td>
<td>企微客服(kf)一期空实现</td>
<td>「在线咨询」仅能走线索留言</td>
<td>沿用线索模式,kf 留二期</td>
</tr>
<tr>
<td>4</td>
<td>sharem 的 B 端管理 Controller 缺失(<code>views/estate/sharem/post</code> 孤儿前端)</td>
<td>先例警示:前端页面+API+后端+菜单 SQL 四处必须齐全</td>
<td>本模块按 §8 顺序逐一交付,禁止只落前端</td>
</tr>
<tr>
<td>5</td>
<td><strong>外部账号污染用户下拉/统计</strong>(<code>listUser</code> 全量拉取,多处业务页)</td>
<td>经办人/负责人下拉混入渠道账号;人效统计失真</td>
<td>§6.4 防污染三件套:独立部门 + 下拉过滤(account_kind)+ 统计口径排除</td>
</tr>
<tr>
<td>6</td>
<td><strong>外部账号扩大敏感面</strong>(可登录 ERP/B端H5)</td>
<td>角色配置失误即泄露内部业务数据</td>
<td>渠道角色仅 <code>estate:newhouse:*</code>;核对 <code>@EnableMethodSecurity(prePostEnabled)=true</code>;权限变更审计</td>
</tr>
<tr>
<td>7</td>
<td>本项目 SysUser 无 <code>user_type</code> 字段</td>
<td>外部账号无原生标识列</td>
<td>靠部门隔离为主;建议 DatabaseMigration 加 <code>account_kind</code> 扩展列</td>
</tr>
<tr>
<td>8</td>
<td>手机号明文存储/展示合规风险</td>
<td>渠道用户手机号在 ERP/WEB 展示</td>
<td>ERP 列表脱敏显示(<code>138****5678</code>),导出需 <code>export</code> 权限留痕</td>
</tr>
<tr>
<td>9</td>
<td>外部 UGC 内容合规(虚假楼盘/价格)</td>
<td>展示页内容风险</td>
<td>审核制默认开启 + 驳回原因 + 状态留痕</td>
</tr>
<tr>
<td>10</td>
<td>新盘表字段与录入表单一致性(resultMap/SELECT/INSERT/UPDATE 四处)</td>
<td>字段漏映射值恒 null</td>
<td>按 backend_rules §五检查清单执行</td>
</tr>
</tbody>
</table>
<blockquote>
<p>原风险「capi 固定租户 capi.tenant-id=2」在组织架构方案下已消除主因:渠道专员按真实租户入驻,新盘/线索租户取自专员所属租户;仅游客浏览/留电仍走 capi 固定租户,上线前统一口径即可。</p>
</blockquote>
<hr />
<h2 id="_7">十、变更后必办事项(进入编码阶段时)</h2>
<ol>
<li><code>npx @colbymchenry/codegraph sync</code></li>
<li>三轨捕获:<code>.githooks/post-commit</code> 自动跑 <code>tools/kg/capture.mjs</code></li>
<li>结构变更:生成 <code>.trae/kg-sync/{时间}_newhouse_module.sql</code>(<code>INSERT ... ON DUPLICATE KEY UPDATE</code>,历史 CONCAT 追加),<code>npm run kg:sync -- &lt;单文件&gt;</code>,完成后 <code>npm run kg:health</code>(孤立 0/悬空 0/旧前缀 0/同名重复 0)</li>
<li>实体命名:<code>ZhenosSH:EstateNewHouseUser</code> 等带前缀,新增后补关系(belongs_to / maps_to_table / renders_in)</li>
</ol>
</main>
</div>
</body>
</html>