|
@@ -0,0 +1,61 @@
|
|
|
|
|
+# 我的团队:推广收益内外口径对齐 + 邀请成员直接分享(推荐/下级绑定)
|
|
|
|
|
+
|
|
|
|
|
+> 任务编号:待派发(cfc-frontend)
|
|
|
|
|
+> 日期:2026-11-06
|
|
|
|
|
+> 触发:用户 "1、打卡和成长记录是如何定义的? 2、我的团队中的推广收益,外面显示的和里面不一致 3、在我的团队中邀请成员,应该直接分享页面,要满足推荐、下级绑定的需求"
|
|
|
|
|
+
|
|
|
|
|
+## 一、需求
|
|
|
|
|
+
|
|
|
|
|
+1. **(理解性,已在任务书外回答)** 打卡/成长记录定义——已查证,无需代码改动
|
|
|
|
|
+2. **推广收益内外不一致**(bug 修复):profile「我的团队」外面显示的推广收益 与 推广中心里面显示的 不一致 → 统一口径
|
|
|
|
|
+3. **邀请成员直接分享**:在「我的团队」加"邀请成员"入口 → 点击**直接打开分享**(分享海报/卡片),满足**推荐 + 下级绑定**需求
|
|
|
|
|
+
|
|
|
|
|
+## 二、根因(已定位)
|
|
|
|
|
+
|
|
|
|
|
+### 需求 2(收益口径不一致)
|
|
|
|
|
+- profile.vue `loadReferralEarnings()`(L625-631):`getReferralSummary().totalEarnings` → **旧口径** = `CommissionRecord(status='settled')` 佣金求和(`CommissionService.getReferralSummary` L234-254)
|
|
|
|
|
+- 推广中心 promotion/index.vue 收益总览(L119):`summary.totalEarned` → **新口径** = `getCfSummary()`(`POST /api/commission/cf/summary`,CF 值总览)
|
|
|
|
|
+- **两个数据源不同 → 外面/里面数字不一致**(外面是旧佣金表,里面是 CF 值总览)
|
|
|
|
|
+
|
|
|
|
|
+### 需求 3(邀请成员)
|
|
|
|
|
+- profile.vue「我的团队」区块(L190-212):现有「我的团队」`goTeamTree`(L197)+「推广收益」`goToWealthCenter`(L204),**无"邀请成员"入口**
|
|
|
|
|
+- profile.vue 已有 `ContentSharePoster`(L346-357,typeLabel="邀友加入")+ `showShareQr()`(L682-709:`scene='ref='+referralCode`,路径 `pages/index-home/index`,海报二维码含推荐码)+ 浮动分享按钮 `share-qr-float`(L101)——**复用即可满足推荐/下级绑定**
|
|
|
|
|
+
|
|
|
|
|
+## 三、方案(仅改前端 profile.vue,后端零改动)
|
|
|
|
|
+
|
|
|
|
|
+### 3.1 需求 2:profile.vue 推广收益改 CF 口径
|
|
|
|
|
+- `loadReferralEarnings()` 改为 `getCfSummary().then(res => { self.referralEarnings = res.data.totalEarned || 0 })`
|
|
|
|
|
+- **单位换算**:promotion 用 `cfVal(summary.totalEarned)`(分→元字符串),profile L208 直接 `{{ referralEarnings }}`——需把 `referralEarnings` 存为**元**(`totalEarned/100`)或加 `cfVal` 格式化。**建议:`self.referralEarnings = (res.data.totalEarned || 0) / 100`**(与 promotion 显示一致,profile 展示"元")
|
|
|
|
|
+- import 补 `getCfSummary`(api.js L2150 已有);`getReferralSummary` 若不再用则移除(确认无其他引用)
|
|
|
|
|
+
|
|
|
|
|
+### 3.2 需求 3:团队区块加「邀请成员」→ 直接分享
|
|
|
|
|
+- 「我的团队」区块(L190-212)新增一个 `ach-item`:「🤝 邀请成员」`@click="showShareQr"`(复用现有分享海报)
|
|
|
|
|
+ - 或新增 `goInvite()` 方法:`this.showShareQr = true`(触发现有 ContentSharePoster,typeLabel="邀友加入",scene=ref=code → 满足推荐/下级绑定)
|
|
|
|
|
+- 保持区块网格 2 列(现有「我的团队」+「推广收益」→ 加「邀请成员」成 3 项,调整布局或网格)
|
|
|
|
|
+- 展示说明:分享海报二维码含推荐码(`ref=`),好友扫码进入 `pages/index-home/index` 自动绑定推荐人 → **下级绑定满足**
|
|
|
|
|
+
|
|
|
|
|
+## 四、验收标准
|
|
|
|
|
+
|
|
|
|
|
+1. profile「我的团队」推广收益 **= 推广中心收益总览的累计收益**(数字一致,元为单位)
|
|
|
|
|
+2. 团队区块有「邀请成员」入口,点击直接打开分享海报(含推荐码二维码)
|
|
|
|
|
+3. 分享海报保存后发给好友,好友扫码注册 → 自动绑定推荐人(下级绑定生效)
|
|
|
|
|
+4. 构建 `npm run build:mp-weixin` exit 0
|
|
|
|
|
+
|
|
|
|
|
+## 五、硬约束
|
|
|
|
|
+
|
|
|
|
|
+- 只改 `cfc-frontend/pages/profile-main/profile.vue`;不改后端、不改 api.js(仅 profile.vue 顶部加一行 import `getCfSummary`)
|
|
|
|
|
+- 不破坏成就重构三段式(纯成就/我的团队/卡券中心)与访客态 gp- 块
|
|
|
|
|
+- 邀请分享复用现有 ContentSharePoster(不新建组件、不改组件)
|
|
|
|
|
+- 基于 `origin/cfclub` 建 `feature/team-invite-share` 分支,commit + push,**不自行合入 cfclub**
|
|
|
|
|
+- 完成后 `git status --porcelain` 干净
|
|
|
|
|
+
|
|
|
|
|
+## 六、风险
|
|
|
|
|
+
|
|
|
|
|
+- `getCfSummary().totalEarned` 单位:promotion 用 cfVal 分→元,profile 需一致换算(/100);若后端返回已是元则不需除——**开发会话以实际返回为准,用 promotion 的 cfVal 作为参照**(cfVal 若除 100,则 totalEarned 是分)
|
|
|
|
|
+- 团队区块网格从 2 项变 3 项:布局可能拥挤,调整 `achievement-grid` 网格列数或卡片尺寸(保持既有视觉)
|
|
|
|
|
+- 需求 1(定义)无代码改动,不在本任务范围
|
|
|
|
|
+
|
|
|
|
|
+## 七、验证数据
|
|
|
|
|
+
|
|
|
|
|
+- 后端口径参照:`CommissionService.getReferralSummary`(旧)vs CF 总览(新);`promotion/index.vue` L119 `cfVal(summary.totalEarned)` 为"里面"权威值
|
|
|
|
|
+- 测试:profile 推广收益数字应与 promotion 收益总览一致(同一用户、无新佣金变动时)
|