Files
wiki/金鹿商城电商小程序需求分析/报告/jinlu-deer-mall-requirements-analysis.html
2026-05-14 16:56:48 +08:00

750 lines
34 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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>
:root {
--color-primary: #B8860B;
--color-primary-hover: #D4A520;
--color-primary-active: #9A7209;
--color-primary-bg: #F9F0D8;
--color-success: #52C41A;
--color-warning: #FAAD14;
--color-error: #FF4D4F;
--color-info: #1677FF;
--bg: #F5F5F5;
--bg-container: #FFFFFF;
--bg-elevated: #FAFAFA;
--border: #D9D9D9;
--border-light: #F0F0F0;
--text-primary: #141414;
--text-secondary: #595959;
--text-tertiary: #8C8C8C;
--radius-sm: 6px;
--radius-md: 8px;
--radius-lg: 12px;
--shadow-sm: 0 1px 2px rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02);
--shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 4px 12px -2px rgba(0,0,0,0.04);
--header-h: 64px;
--content-max: 1200px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
'Helvetica Neue', Helvetica, Arial, sans-serif;
background: var(--bg);
color: var(--text-primary);
line-height: 1.57;
font-size: 14px;
}
.header-bar {
position: sticky; top: 0; height: var(--header-h);
background: rgba(255,255,255,0.85);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border-light);
display: flex; align-items: center; padding: 0 40px; z-index: 100;
}
.header-bar .brand { display: flex; align-items: baseline; gap: 12px; }
.header-bar h1 {
font-size: 18px; font-weight: 700;
background: linear-gradient(135deg, var(--color-primary) 0%, #722ED1 100%);
-webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.header-bar .tagline { font-size: 12px; color: var(--text-tertiary); }
.layout { display: flex; gap: 24px; }
.sidebar {
width: 260px; flex-shrink: 0; position: sticky; top: calc(var(--header-h) + 32px);
max-height: calc(100vh - var(--header-h) - 64px); overflow-y: auto;
background: var(--bg-container); border: 1px solid var(--border);
border-radius: var(--radius-md); padding: 20px 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-section { padding: 0 20px; margin-bottom: 16px; }
.sidebar-title {
font-size: 11px; font-weight: 600; color: var(--text-tertiary);
letter-spacing: 0.5px; margin-bottom: 8px; padding: 0 12px;
}
.sidebar-link {
display: block; padding: 6px 12px; color: var(--text-secondary);
text-decoration: none; border-radius: var(--radius-sm); font-size: 13px;
transition: all 0.15s ease;
}
.sidebar-link:hover { background: var(--color-primary-bg); color: var(--color-primary); }
.sidebar-link--active { background: var(--color-primary-bg); color: var(--color-primary); font-weight: 600; }
.sidebar-divider { height: 1px; background: var(--border-light); margin: 12px 20px; }
.main { flex: 1; min-width: 0; padding-bottom: 64px; }
.section {
background: var(--bg-container);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 32px 36px;
margin-bottom: 20px;
box-shadow: var(--shadow-sm);
}
.section h2 {
font-size: 20px; font-weight: 700; margin-bottom: 20px;
padding-bottom: 12px; border-bottom: 2px solid var(--color-primary-bg);
color: var(--text-primary);
}
.section h3 {
font-size: 16px; font-weight: 600; margin: 24px 0 12px; color: var(--text-primary);
}
.section h4 {
font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--text-secondary);
}
p { margin-bottom: 12px; }
ul, ol { padding-left: 20px; margin-bottom: 12px; }
li { margin-bottom: 6px; }
/* ===== Tables ===== */
table {
width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px;
}
th, td {
padding: 10px 14px; border: 1px solid var(--border); text-align: left;
}
th {
background: var(--bg-elevated); font-weight: 600; color: var(--text-secondary);
font-size: 12px; white-space: nowrap;
}
td { color: var(--text-primary); }
/* ===== Status Badges ===== */
.badge {
display: inline-block; padding: 2px 10px; border-radius: 12px;
font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge--full { background: #F6FFED; color: #52C41A; border: 1px solid #B7EB8F; }
.badge--partial { background: #FFFBE6; color: #FAAD14; border: 1px solid #FFE58F; }
.badge--none { background: #FFF1F0; color: #FF4D4F; border: 1px solid #FFCCC7; }
.badge--info { background: #E6F4FF; color: #1677FF; border: 1px solid #91CAFF; }
.badge--amber { background: #F9F0D8; color: #B8860B; border: 1px solid #E8D5A0; }
/* ===== Callout ===== */
.callout {
padding: 14px 18px; border-radius: var(--radius-sm); margin: 16px 0;
border-left: 4px solid var(--color-primary); background: var(--color-primary-bg);
}
.callout--warn {
border-left-color: var(--color-warning); background: #FFFBE6;
}
.callout--error {
border-left-color: var(--color-error); background: #FFF1F0;
}
.callout--success {
border-left-color: var(--color-success); background: #F6FFED;
}
.callout-title { font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.callout-body { font-size: 13px; color: var(--text-secondary); }
/* ===== Code ===== */
code {
background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px;
font-family: 'SF Mono', 'Menlo', 'Courier New', monospace; font-size: 13px;
}
.footer {
margin-top: 48px; padding-top: 16px;
border-top: 1px solid var(--border-light);
font-size: 12px; color: var(--text-tertiary); text-align: center;
}
@media (max-width: 900px) {
.header-bar { padding: 0 16px; }
.layout { flex-direction: column; }
.sidebar { width: 100%; position: static; max-height: none; }
.section { padding: 20px; }
table { font-size: 12px; }
th, td { padding: 8px 10px; }
}
</style>
</head>
<body>
<header class="header-bar">
<div class="brand">
<h1>金鹿商城电商小程序 — 需求分析与差异对比报告</h1>
<span class="tagline">基于 CRMEB 现有功能的增量开发评估</span>
</div>
</header>
<div class="layout">
<aside class="sidebar">
<div class="sidebar-section">
<div class="sidebar-title">概览</div>
<a class="sidebar-link sidebar-link--active" href="#overview">项目概述</a>
<a class="sidebar-link" href="#summary">差异总览</a>
</div>
<div class="sidebar-divider"></div>
<div class="sidebar-section">
<div class="sidebar-title">需求解读</div>
<a class="sidebar-link" href="#req-product">商品销售</a>
<a class="sidebar-link" href="#req-lottery">限时抢签</a>
<a class="sidebar-link" href="#req-coin">活动币体系</a>
<a class="sidebar-link" href="#req-points">积分商城</a>
<a class="sidebar-link" href="#req-rules">硬性规则</a>
</div>
<div class="sidebar-divider"></div>
<div class="sidebar-section">
<div class="sidebar-title">功能对比</div>
<a class="sidebar-link" href="#cmp-full">完全覆盖</a>
<a class="sidebar-link" href="#cmp-partial">部分覆盖</a>
<a class="sidebar-link" href="#cmp-none">完全缺失</a>
</div>
<div class="sidebar-divider"></div>
<div class="sidebar-section">
<div class="sidebar-title">实施方案</div>
<a class="sidebar-link" href="#new-tables">新增数据表</a>
<a class="sidebar-link" href="#phases">分阶段实施</a>
<a class="sidebar-link" href="#effort">工作量评估</a>
<a class="sidebar-link" href="#risks">风险与建议</a>
</div>
</aside>
<main class="main">
<!-- ===== 1. 项目概述 ===== -->
<div class="section" id="overview">
<h2 id="s-overview">1. 项目概述</h2>
<p>金鹿商城是一个面向微信生态的<strong>鹿酒销售电商小程序</strong>,在标准电商能力基础上叠加了三大特色模块:<strong>限时抢签(摇号)</strong><strong>活动币体系</strong><strong>积分商城组合支付</strong>。项目以 CRMEB Java 多端电商系统为基座,需进行增量开发。</p>
<h3>1.1 核心业务模块</h3>
<table>
<thead><tr><th>模块</th><th>核心能力</th><th>优先级</th></tr></thead>
<tbody>
<tr><td>商品销售</td><td>小程序商品浏览、下单、支付、物流、售后</td><td>P0 — 基础</td></tr>
<tr><td>限时抢签</td><td>定时开放、实名摇号、中签后购买</td><td>P0 — 核心特色</td></tr>
<tr><td>活动币</td><td>购买赠币、中签赠币、48h 过期</td><td>P1 — 增强粘性</td></tr>
<tr><td>积分商城</td><td>活动币 + 积分组合支付、实名发货</td><td>P1 — 积分消耗闭环</td></tr>
</tbody>
</table>
<h3>1.2 关键约束</h3>
<ul>
<li>仅面向<strong>微信小程序</strong>,不独立开发 App / H5</li>
<li>积分商城<strong>不支持单独支付</strong>,仅支持活动币 + 积分组合</li>
<li>活动币<strong>强制 48 小时过期</strong>,不可手动延期</li>
<li>积分商城下单<strong>必须实名认证(身份证)</strong></li>
<li>限时抢签仅在规定时间段内可报名参与</li>
</ul>
</div>
<!-- ===== 2. 差异总览 ===== -->
<div class="section" id="summary">
<h2 id="s-summary">2. 差异总览</h2>
<table>
<thead><tr><th>需求项</th><th>CRMEB 现有</th><th>覆盖度</th><th>说明</th></tr></thead>
<tbody>
<tr><td>商品管理</td><td></td><td><span class="badge badge--full">完全覆盖</span></td><td>商品 CRUD、分类、品牌、规格、库存均已具备</td></tr>
<tr><td>订单流程</td><td></td><td><span class="badge badge--full">完全覆盖</span></td><td>下单、支付、发货、收货、退款退货完整</td></tr>
<tr><td>微信支付</td><td></td><td><span class="badge badge--full">完全覆盖</span></td><td>小程序微信支付已接入</td></tr>
<tr><td>微信登录</td><td></td><td><span class="badge badge--full">完全覆盖</span></td><td>小程序微信授权登录已实现</td></tr>
<tr><td>用户管理</td><td></td><td><span class="badge badge--full">完全覆盖</span></td><td>用户信息、等级、地址管理已具备</td></tr>
<tr><td>现有积分体系</td><td></td><td><span class="badge badge--partial">部分覆盖</span></td><td>已有积分获取/消费/记录,需扩展组合支付</td></tr>
<tr><td>用户身份证字段</td><td>部分</td><td><span class="badge badge--partial">部分覆盖</span></td><td>数据库有相关字段但缺少实名认证校验逻辑</td></tr>
<tr><td>限时抢签(摇号)</td><td></td><td><span class="badge badge--none">完全缺失</span></td><td>全新模块,需从零开发</td></tr>
<tr><td>活动币体系</td><td></td><td><span class="badge badge--none">完全缺失</span></td><td>全新虚拟货币,含过期机制</td></tr>
<tr><td>积分商城 + 组合支付</td><td></td><td><span class="badge badge--none">完全缺失</span></td><td>需新建独立商城入口与结算逻辑</td></tr>
<tr><td>48 小时定时过期</td><td></td><td><span class="badge badge--none">完全缺失</span></td><td>需定时任务清理过期活动币</td></tr>
<tr><td>身份证实名校验</td><td></td><td><span class="badge badge--none">完全缺失</span></td><td>需接入公安实名验证或第三方 API</td></tr>
</tbody>
</table>
<div class="callout callout--warn">
<div class="callout-title">核心结论</div>
<div class="callout-body">基础电商能力(商品、订单、支付、物流)100% 复用 CRMEB 现有模块。新增工作量集中在三大模块:限时抢签、活动币、积分商城组合支付,属于增量开发而非系统重写。</div>
</div>
</div>
<!-- ===== 3. 需求详细解读 ===== -->
<div class="section" id="req-product">
<h2 id="s-req-product">3.1 商品销售(基础电商)</h2>
<h3>需求描述</h3>
<p>小程序端支持用户浏览商品、加入购物车、下单支付、查看物流、申请售后。</p>
<h3>现有能力匹配</h3>
<ul>
<li><code>StoreProduct</code> — 商品模型:SPU/SKU、分类、品牌、详情图文、库存、价格</li>
<li><code>StoreOrder</code> — 订单模型:下单、支付状态、物流跟踪、售后退款</li>
<li><code>Cart</code> — 购物车:添加、修改数量、删除、结算</li>
<li><code>WeChatPaymentService</code> — 微信支付统一下单、回调、退款</li>
<li><code>ExpressService</code> — 物流查询(阿里云接口)</li>
</ul>
<div class="callout callout--success">
<div class="callout-title">结论:无需开发</div>
<div class="callout-body">CRMEB 已覆盖完整电商交易链路,小程序端前端代码在 <code>single_uniapp</code> 中已有现成实现。</div>
</div>
</div>
<div class="section" id="req-lottery">
<h2 id="s-req-lottery">3.2 限时抢签(摇号抽签)</h2>
<h3>需求描述</h3>
<p>类似茅台抢签模式,在指定时间段内用户可报名参与抢购摇号,中签后获得购买资格。</p>
<h4>核心规则</h4>
<ul>
<li>每个商品配置抢签时间段,如 09:0009:30、17:0017:30</li>
<li>用户在开放时段内可报名参与(需微信登录授权)</li>
<li>报名截止后系统自动摇号,按配置的中签率计算中签用户</li>
<li>中签用户获得限时购买资格(通常 30 分钟内有效)</li>
<li>未中签用户不产生订单,不影响后续批次</li>
</ul>
<h4>后台管理</h4>
<ul>
<li>抢签活动管理:创建/编辑/删除活动,关联商品、时间段、中签率</li>
<li>报名记录查看:用户列表、报名状态、中签结果</li>
<li>中签率配置:可手动设置固定中签率,也可按报名人数自动计算</li>
</ul>
<h3>现有能力匹配</h3>
<p>CRMEB <strong>无任何秒杀/抢购/摇号相关模块</strong>。现有的优惠券、限时折扣与抢签业务模式完全不同,无法复用。</p>
<div class="callout callout--error">
<div class="callout-title">结论:全新开发</div>
<div class="callout-body">需从 0 到 1 开发抢签系统,涉及前端报名界面、后台活动管理、定时摇号算法、中签结果通知等多个子系统。核心难点在于摇号公平性(随机算法)与高并发报名处理。</div>
</div>
</div>
<div class="section" id="req-coin">
<h2 id="s-req-coin">3.3 活动币体系</h2>
<h3>需求描述</h3>
<p>活动币是一种临时性虚拟货币,用于积分商城的组合支付,与现有积分系统独立。</p>
<h4>获取规则</h4>
<ul>
<li><strong>购买指定商品</strong>:每完成一笔符合条件的订单,赠送 1 个活动币</li>
<li><strong>抢签中签成功</strong>:摇号中签后额外赠送 1 个活动币</li>
</ul>
<h4>过期规则</h4>
<ul>
<li>从获得时刻起,<strong>48 小时后自动过期</strong></li>
<li>过期后活动币数量清零,不可恢复</li>
<li>不可手动延期或兑换</li>
</ul>
<h4>使用场景</h4>
<ul>
<li>仅在积分商城中使用,与普通订单支付无关</li>
<li>与积分组合支付,无单独使用场景</li>
</ul>
<h3>现有能力匹配</h3>
<p>CRMEB 已有 <code>IntegralRecord</code> 积分记录表和积分获取/消费机制,但活动币在业务含义、过期机制、使用场景上与积分完全不同,<strong>不可复用积分模块</strong>,需独立建表。</p>
<div class="callout callout--error">
<div class="callout-title">结论:全新开发</div>
<div class="callout-body">需新建活动币账户表、流水记录表、48 小时定时清理任务(Quartz),并在订单完成支付/中签时触发赠送逻辑。可参考积分模块的架构模式但需独立实现。</div>
</div>
</div>
<div class="section" id="req-points">
<h2 id="s-req-points">3.4 积分商城(组合支付)</h2>
<h3>需求描述</h3>
<p>独立的积分商城入口,商品仅支持「活动币 + 积分」组合兑换,不支持现金支付。</p>
<h4>核心规则</h4>
<ul>
<li>积分获取:仅通过普通订单购买获得(消费 100 元 = 1 积分)</li>
<li>积分商城商品<strong>必须同时消耗活动币 + 积分</strong>,二者缺一不可</li>
<li>积分商城<strong>不支持现金支付</strong>,无微信支付入口</li>
<li>下单时强制校验身份证信息(姓名 + 身份证号),未实名用户不可下单</li>
</ul>
<h3>现有能力匹配</h3>
<ul>
<li>积分体系已有:积分获取(下单赠送)、积分消费(积分商品兑换)、积分记录</li>
<li>积分商品模型 <code>StoreIntegral</code> 已存在</li>
<li><strong>缺少</strong>:组合支付逻辑(活动币 + 积分)、身份证实名校验、独立积分商城入口</li>
</ul>
<div class="callout callout--warn">
<div class="callout-title">结论:需改造现有积分模块</div>
<div class="callout-body">现有积分商城的下单流程需增加活动币校验与扣减逻辑,同时新增身份证实名校验环节。前端需改造小程序端积分商城页面 UI,明确组合支付方式。</div>
</div>
</div>
<div class="section" id="req-rules">
<h2 id="s-req-rules">3.5 硬性规则汇总</h2>
<table>
<thead><tr><th>规则</th><th>约束类型</th><th>影响范围</th></tr></thead>
<tbody>
<tr><td>活动币 48 小时强制过期</td><td>定时任务</td><td>活动币清理、用户资产展示</td></tr>
<tr><td>积分商城不可单独支付</td><td>结算逻辑</td><td>订单创建、支付页面</td></tr>
<tr><td>积分商城下单必须实名</td><td>校验逻辑</td><td>结算页面、用户中心</td></tr>
<tr><td>抢签仅定时段报名</td><td>时间控制</td><td>前端按钮显隐、后端接口校验</td></tr>
<tr><td>中签率后台可配</td><td>配置管理</td><td>抢签活动编辑页面</td></tr>
<tr><td>仅微信小程序</td><td>平台限制</td><td>无需适配 App/H5/PC</td></tr>
</tbody>
</table>
</div>
<!-- ===== 4. 功能对比详情 ===== -->
<div class="section" id="cmp-full">
<h2 id="s-cmp-full">4.1 完全覆盖的功能</h2>
<p>以下功能在 CRMEB 中已完整实现,可直接复用:</p>
<table>
<thead><tr><th>功能</th><th>后端文件</th><th>前端文件</th><th>备注</th></tr></thead>
<tbody>
<tr><td>商品 CRUD</td><td><code>StoreProductController/Service</code></td><td><code>single_uniapp/pages/goods</code></td><td>含 SPU/SKU、分类、品牌、图文详情</td></tr>
<tr><td>购物车</td><td><code>StoreCartController/Service</code></td><td><code>single_uniapp/pages/users/cart</code></td><td>增删改查、选中结算</td></tr>
<tr><td>订单流程</td><td><code>StoreOrderController/Service</code></td><td><code>single_uniapp/pages/users/order</code></td><td>创建、支付、发货、收货、退款</td></tr>
<tr><td>微信支付</td><td><code>WeChatPaymentService</code></td><td>uni-app 支付组件</td><td>统一下单、回调处理、退款</td></tr>
<tr><td>微信登录</td><td><code>WeChatLoginService</code></td><td><code>single_uniapp/pages/login</code></td><td>小程序授权登录</td></tr>
<tr><td>物流查询</td><td><code>LogisticsService</code></td><td>订单详情页</td><td>阿里云物流 API 对接</td></tr>
<tr><td>用户中心</td><td><code>UserCenterController</code></td><td><code>single_uniapp/pages/users/user</code></td><td>个人信息、地址、订单列表</td></tr>
<tr><td>优惠券</td><td><code>CouponController/Service</code></td><td>领券中心、我的优惠券</td><td>可预留后续活动使用</td></tr>
</tbody>
</table>
</div>
<div class="section" id="cmp-partial">
<h2 id="s-cmp-partial">4.2 部分覆盖的功能</h2>
<h3>4.2.1 积分体系</h3>
<table>
<thead><tr><th>维度</th><th>CRMEB 现有</th><th>金鹿需求</th><th>差异</th></tr></thead>
<tbody>
<tr><td>积分获取</td><td>订单赠送(比例可配)</td><td>消费 100 元 = 1 积分</td><td><span class="badge badge--info">配置调整</span></td></tr>
<tr><td>积分消费</td><td>积分商品兑换(纯积分)</td><td>活动币 + 积分组合</td><td><span class="badge badge--partial">需改造</span> 新增组合支付逻辑</td></tr>
<tr><td>积分记录</td><td><code>IntegralRecord</code> 表 + 流水</td><td>同现有</td><td><span class="badge badge--full">可复用</span></td></tr>
<tr><td>积分商品</td><td><code>StoreIntegral</code> 模型</td><td>同现有</td><td><span class="badge badge--full">可复用</span></td></tr>
</tbody>
</table>
<h3>4.2.2 用户实名认证</h3>
<table>
<thead><tr><th>维度</th><th>CRMEB 现有</th><th>金鹿需求</th><th>差异</th></tr></thead>
<tbody>
<tr><td>身份证字段</td><td>用户表可能有预留字段</td><td>姓名 + 身份证号</td><td><span class="badge badge--info">字段确认</span> 确认数据库是否有现成字段</td></tr>
<tr><td>实名校验</td><td></td><td>身份证号合法性校验</td><td><span class="badge badge--none">需开发</span> 校验算法 + 可选第三方 API</td></tr>
<tr><td>实名状态</td><td></td><td>未实名不可下单</td><td><span class="badge badge--none">需开发</span> 下单前置校验</td></tr>
</tbody>
</table>
</div>
<div class="section" id="cmp-none">
<h2 id="s-cmp-none">4.3 完全缺失的功能</h2>
<h3>4.3.1 限时抢签系统</h3>
<table>
<thead><tr><th>子模块</th><th>说明</th><th>复杂度</th></tr></thead>
<tbody>
<tr><td>抢签活动管理</td><td>CRUD、关联商品、时间段配置、中签率配置</td><td></td></tr>
<tr><td>用户报名</td><td>微信小程序端报名界面、报名状态展示</td><td></td></tr>
<tr><td>摇号算法</td><td>基于中签率的随机分配,需保证公平性</td><td></td></tr>
<tr><td>定时任务</td><td>报名截止后自动触发摇号(Quartz</td><td></td></tr>
<tr><td>购买资格</td><td>中签用户在有效期内拥有专属购买通道</td><td></td></tr>
<tr><td>结果通知</td><td>微信订阅消息通知中签/未中签结果</td><td></td></tr>
</tbody>
</table>
<h3>4.3.2 活动币体系</h3>
<table>
<thead><tr><th>子模块</th><th>说明</th><th>复杂度</th></tr></thead>
<tbody>
<tr><td>活动币账户</td><td>用户维度的活动币余额管理</td><td></td></tr>
<tr><td>流水记录</td><td>获取/消费/过期的完整流水</td><td></td></tr>
<tr><td>赠送触发</td><td>订单完成支付后赠币、中签后赠币</td><td></td></tr>
<tr><td>48h 过期</td><td>定时任务扫描过期并清零(Quartz</td><td></td></tr>
<tr><td>前端展示</td><td>用户中心显示活动币余额及明细</td><td></td></tr>
</tbody>
</table>
<h3>4.3.3 积分商城组合支付</h3>
<table>
<thead><tr><th>子模块</th><th>说明</th><th>复杂度</th></tr></thead>
<tbody>
<tr><td>组合结算</td><td>活动币 + 积分联合扣减,余额不足拦截</td><td></td></tr>
<tr><td>实名校验</td><td>下单前校验身份证号,未实名拦截</td><td></td></tr>
<tr><td>订单类型</td><td>新建积分商城订单类型,与普通订单区分</td><td></td></tr>
<tr><td>前端改造</td><td>积分商城商品详情页、结算页、支付方式页</td><td></td></tr>
</tbody>
</table>
</div>
<!-- ===== 5. 新增数据表 ===== -->
<div class="section" id="new-tables">
<h2 id="s-new-tables">5. 新增数据表设计</h2>
<p>以下为需要新增的核心数据表(基于 CRMEB 现有命名规范 <code>eb_</code> 前缀):</p>
<h3>5.1 限时抢签模块</h3>
<table>
<thead><tr><th>表名</th><th>说明</th><th>核心字段</th></tr></thead>
<tbody>
<tr>
<td><code>eb_lottery_activity</code></td>
<td>抢签活动主表</td>
<td>id, product_id, activity_name, start_time, end_time, lottery_time, win_rate, status, create_time, update_time</td>
</tr>
<tr>
<td><code>eb_lottery_record</code></td>
<td>用户报名记录表</td>
<td>id, activity_id, uid, status(报名/中签/未中签), lottery_result, order_id(中签后下单的订单), create_time</td>
</tr>
<tr>
<td><code>eb_lottery_purchase_qualification</code></td>
<td>中签购买资格表</td>
<td>id, record_id, uid, activity_id, expire_time, used(是否已使用)</td>
</tr>
</tbody>
</table>
<h3>5.2 活动币模块</h3>
<table>
<thead><tr><th>表名</th><th>说明</th><th>核心字段</th></tr></thead>
<tbody>
<tr>
<td><code>eb_activity_coin_account</code></td>
<td>用户活动币账户表</td>
<td>id, uid, balance, total_earned, total_spent, total_expired</td>
</tr>
<tr>
<td><code>eb_activity_coin_record</code></td>
<td>活动币流水记录表</td>
<td>id, uid, change_amount, balance_after, type(获取/消费/过期), source(订单/抢签/兑换), expire_time, source_id, create_time</td>
</tr>
</tbody>
</table>
<h3>5.3 积分商城改造</h3>
<table>
<thead><tr><th>表名</th><th>说明</th><th>核心字段</th></tr></thead>
<tbody>
<tr>
<td><code>eb_store_integral_order</code></td>
<td>积分商城订单表(扩展现有或新建)</td>
<td>增加 activity_coin_amount 字段,记录消耗活动币数量</td>
</tr>
<tr>
<td><code>eb_user_identity</code></td>
<td>用户实名信息表</td>
<td>id, uid, real_name, id_card, verified(是否已校验), verify_time, create_time</td>
</tr>
</tbody>
</table>
<div class="callout">
<div class="callout-title">设计建议</div>
<div class="callout-body">活动币流水表采用与现有积分流水表类似的设计模式,便于后续维护和审计。每条流水记录包含 expire_time 字段,定时任务基于此字段批量清理过期活动币。</div>
</div>
</div>
<!-- ===== 6. 分阶段实施计划 ===== -->
<div class="section" id="phases">
<h2 id="s-phases">6. 分阶段实施计划</h2>
<h3>Phase 1:基础电商能力确认(1-2 天)</h3>
<ul>
<li>确认 CRMEB 小程序端商品浏览、下单、支付、物流流程正常运行</li>
<li>确认微信支付、微信登录正常</li>
<li>确认现有积分获取/消费机制正常工作</li>
<li>品牌替换(CRMEB → 金鹿商城),清除遗留的一号通等无用功能</li>
</ul>
<h3>Phase 2:活动币体系(3-5 天)</h3>
<ul>
<li>新建活动币账户表 + 流水记录表</li>
<li>实现活动币赠送逻辑:订单完成支付后触发、中签后触发</li>
<li>实现 48 小时定时清理任务(Quartz 定时任务)</li>
<li>用户中心展示活动币余额及明细</li>
<li>后台活动币管理:查看用户流水、统计数据</li>
</ul>
<h3>Phase 3:限时抢签系统(5-8 天)</h3>
<ul>
<li>抢签活动管理后台:CRUD、商品关联、时间段/中签率配置</li>
<li>小程序端抢签页面:活动列表、报名按钮、报名状态展示</li>
<li>摇号算法实现(基于随机数 + 中签率计算)</li>
<li>定时摇号任务(Quartz 在报名截止时自动执行)</li>
<li>中签购买资格管理:有效期、专属购买通道</li>
<li>微信订阅消息通知:中签/未中签结果推送</li>
</ul>
<h3>Phase 4:积分商城改造(3-5 天)</h3>
<ul>
<li>积分商城订单增加活动币消耗逻辑</li>
<li>组合支付结算:校验活动币 + 积分余额,联合扣减</li>
<li>用户实名认证:身份证录入 + 合法性校验</li>
<li>积分商城下单强制实名校验拦截</li>
<li>小程序端积分商城页面改造:组合支付展示</li>
</ul>
<h3>Phase 5:联调测试与上线(3-5 天)</h3>
<ul>
<li>端到端功能测试:商品浏览 → 下单支付 → 获得活动币 → 抢签报名 → 摇号中签 → 积分商城兑换</li>
<li>活动币过期定时任务验证</li>
<li>高并发报名场景压测</li>
<li>小程序提审准备</li>
</ul>
</div>
<!-- ===== 7. 工作量评估 ===== -->
<div class="section" id="effort">
<h2 id="s-effort">7. 工作量评估</h2>
<table>
<thead><tr><th>阶段</th><th>后端(天)</th><th>前端(天)</th><th>联调(天)</th><th>合计(天)</th></tr></thead>
<tbody>
<tr><td>Phase 1:基础确认</td><td>1</td><td>1</td><td>0.5</td><td>1.5</td></tr>
<tr><td>Phase 2:活动币</td><td>3</td><td>1.5</td><td>1</td><td>5.5</td></tr>
<tr><td>Phase 3:限时抢签</td><td>5</td><td>2.5</td><td>1.5</td><td>9</td></tr>
<tr><td>Phase 4:积分商城</td><td>3</td><td>2</td><td>1</td><td>6</td></tr>
<tr><td>Phase 5:联调上线</td><td>1</td><td>1</td><td>2</td><td>4</td></tr>
<tr><td><strong>合计</strong></td><td><strong>13</strong></td><td><strong>8</strong></td><td><strong>6</strong></td><td><strong>26</strong></td></tr>
</tbody>
</table>
<div class="callout">
<div class="callout-title">说明</div>
<div class="callout-body">以上为单人开发预估,基于 CRMEB 现有代码基础之上增量开发。若对 CRMEB 代码不够熟悉,需额外增加 3-5 天的熟悉时间。</div>
</div>
</div>
<!-- ===== 8. 风险与建议 ===== -->
<div class="section" id="risks">
<h2 id="s-risks">8. 风险与建议</h2>
<h3>8.1 技术风险</h3>
<table>
<thead><tr><th>风险项</th><th>影响</th><th>缓解措施</th></tr></thead>
<tbody>
<tr>
<td>抢签高并发</td>
<td>大量用户同时报名可能导致数据库压力</td>
<td>报名接口使用 Redis 队列削峰,异步写入数据库;摇号在低峰期执行</td>
</tr>
<tr>
<td>摇号公平性</td>
<td>随机算法被质疑不公正</td>
<td>使用 JDK SecureRandom + 公示摇号逻辑;可引入第三方随机种子</td>
</tr>
<tr>
<td>活动币过期清理</td>
<td>大批量过期数据导致定时任务执行时间过长</td>
<td>分页批量处理,每次处理 1000 条;设置合理的 Cron 频率(每 10 分钟执行一次)</td>
</tr>
<tr>
<td>身份证信息安全</td>
<td>身份证号属于敏感信息,存储需符合法规</td>
<td>身份证号加密存储(AES),展示时脱敏(如 3301***********1234);数据库访问权限控制</td>
</tr>
<tr>
<td>积分商城订单与普通订单区分</td>
<td>现有订单逻辑可能受到改造影响</td>
<td>新建独立的积分商城订单处理流程,复用现有订单模型但不修改核心逻辑</td>
</tr>
</tbody>
</table>
<h3>8.2 合规风险</h3>
<ul>
<li><strong>摇号活动合规</strong>:需确保抢签活动不构成"抽奖/赌博"性质,建议在用户协议中明确说明为"限量商品公平购买方式"</li>
<li><strong>个人信息保护</strong>:身份证号收集需在小程序中取得用户明确授权,符合《个人信息保护法》要求</li>
<li><strong>虚拟资产合规</strong>:活动币虽有过期机制,但应在用户协议中明确说明其非货币属性</li>
</ul>
<h3>8.3 架构建议</h3>
<ul>
<li>抢签、活动币模块应作为<strong>独立的 Service 层</strong>实现,与现有电商模块解耦</li>
<li>定时任务统一由现有的 <strong>Quartz 调度器</strong> 管理,避免重复引入调度框架</li>
<li>所有新增 Controller 统一在 <code>crmeb-admin</code>(后台管理)和 <code>crmeb-front</code>(小程序 API)中按模块分包</li>
<li>小程序前端代码在 <code>single_uniapp</code> 中新增独立页面目录:<code>pages/lottery</code><code>pages/integral-mall</code></li>
</ul>
<h3>8.4 可选优化方向</h3>
<ul>
<li><strong>Redis 缓存</strong>:抢签活动的报名名单可缓存在 Redis Set 中,摇号时一次性读取,减少数据库压力</li>
<li><strong>消息队列</strong>:订单完成支付后通过消息队列异步赠送活动币,避免阻塞订单主流程</li>
<li><strong>第三方实名校验</strong>:如需要严格实名验证,可接入阿里云/腾讯云的身份证实名认证 API</li>
<li><strong>数据看板</strong>:后台增加抢签活动数据看板(报名人数、中签率趋势、活动币发放/消耗统计)</li>
</ul>
</div>
<!-- ===== 9. 总结 ===== -->
<div class="section">
<h2>9. 总结</h2>
<p>金鹿商城电商小程序项目基于 CRMEB 现有电商系统进行增量开发,核心差异在于 <strong>限时抢签</strong><strong>活动币</strong><strong>积分商城组合支付</strong> 三大模块。</p>
<table>
<thead><tr><th>维度</th><th>评估</th></tr></thead>
<tbody>
<tr><td>复用程度</td><td><span class="badge badge--full">基础电商 80%+ 复用</span></td></tr>
<tr><td>新增工作量</td><td><span class="badge badge--partial">约 26 人天</span></td></tr>
<tr><td>技术难度</td><td><span class="badge badge--amber">中等偏高</span>(摇号算法 + 高并发)</td></tr>
<tr><td>合规要求</td><td><span class="badge badge--warn" style="background:#FFFBE6;color:#FAAD14;border:1px solid #FFE58F">中等</span>(个人信息保护 + 活动合规)</td></tr>
</tbody>
</table>
<p>建议按照 <strong>基础确认 → 活动币 → 抢签 → 积分商城 → 联调上线</strong> 的顺序分阶段推进,每个阶段完成后进行回归测试,确保新增模块不影响现有电商核心功能。</p>
</div>
</main>
</div>
<footer class="footer">
金鹿商城电商小程序 — 需求分析与差异对比报告 &middot; 基于 CRMEB Java 多端电商系统 &middot; 2026-05-09
</footer>
<script>
// Sidebar active link tracking
document.querySelectorAll('.sidebar-link').forEach(link => {
link.addEventListener('click', function(e) {
document.querySelectorAll('.sidebar-link').forEach(l => l.classList.remove('sidebar-link--active'));
this.classList.add('sidebar-link--active');
});
});
// Scroll spy
const sections = document.querySelectorAll('[id]');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const id = entry.target.id;
document.querySelectorAll('.sidebar-link').forEach(link => {
link.classList.toggle('sidebar-link--active', link.getAttribute('href') === `#${id}`);
});
}
});
}, { rootMargin: '-80px 0px -70% 0px' });
sections.forEach(s => observer.observe(s));
</script>
</body>
</html>