feat(promotion/repo): 统一分享弹窗尺寸、暂隐藏奖励入口并清理仓库文件
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
/.pnp
|
/.pnp
|
||||||
.pnp.js
|
.pnp.js
|
||||||
|
bun.lock
|
||||||
|
bun.lockb
|
||||||
|
|
||||||
# testing
|
# testing
|
||||||
/coverage
|
/coverage
|
||||||
@@ -25,6 +27,7 @@ node_modules/
|
|||||||
/build
|
/build
|
||||||
/dist/
|
/dist/
|
||||||
/dist-ssr/
|
/dist-ssr/
|
||||||
|
vercel.json
|
||||||
|
|
||||||
# tool caches and temporary files
|
# tool caches and temporary files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
# Copyright and License Notice
|
|
||||||
|
|
||||||
Copyright (C) 2025 QuantumNous
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as
|
|
||||||
published by the Free Software Foundation, either version 3 of the
|
|
||||||
License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For commercial licensing, please contact support@quantumnous.com
|
|
||||||
@@ -26,7 +26,7 @@ Monkey AI Web 是从总仓库 `weiyuan` 分支独立出来的前端工程,包
|
|||||||
|
|
||||||
环境要求:Node.js ≥ 22.13.0,npm ≥ 10(`packageManager` 为 npm 10.9.9)。统一使用 npm,不要用 Bun 或 Yarn 生成其他锁文件。
|
环境要求:Node.js ≥ 22.13.0,npm ≥ 10(`packageManager` 为 npm 10.9.9)。统一使用 npm,不要用 Bun 或 Yarn 生成其他锁文件。
|
||||||
|
|
||||||
仓库仅维护 `package-lock.json`,已移除 `bun.lock`,并忽略 `bun.lock` / `bun.lockb`。本地与 CI 使用 `npm ci` 安装依赖、`npm run dev` 启动开发服务、`npm run build` 构建;Vercel 已显式配置 npm 安装与构建命令。
|
仓库仅维护 `package-lock.json`,并忽略 `bun.lock` / `bun.lockb`。本地与 CI 使用 `npm ci` 安装依赖、`npm run dev` 启动开发服务、`npm run build` 构建。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone --branch weiyuan https://git.weytoken.com/qiubs/monkey-ai-web.git
|
git clone --branch weiyuan https://git.weytoken.com/qiubs/monkey-ai-web.git
|
||||||
@@ -135,7 +135,6 @@ monkey-ai-web/
|
|||||||
- **路由与权限**:在 `src/App.jsx` 注册路由,用 `PrivateRoute`、`AdminRoute`(role ≥ 10)、`RootRoute`(role ≥ 100)守卫;企业中心子路由在 `src/pages/Organization/index.jsx`。部分模块的可见性来自 `/api/status`,不能只靠隐藏菜单控制权限。
|
- **路由与权限**:在 `src/App.jsx` 注册路由,用 `PrivateRoute`、`AdminRoute`(role ≥ 10)、`RootRoute`(role ≥ 100)守卫;企业中心子路由在 `src/pages/Organization/index.jsx`。部分模块的可见性来自 `/api/status`,不能只靠隐藏菜单控制权限。
|
||||||
- **UI**:通用组件用 Ant Design;存量页面经 `src/components/ui` 适配层保留原契约;主题只由 `UiThemeProvider` 提供,不新增 ConfigProvider;按钮图标从 `src/components/common/icons/ActionIcons.js` 导入。页面改动需检查浅色、深色与窄屏。
|
- **UI**:通用组件用 Ant Design;存量页面经 `src/components/ui` 适配层保留原契约;主题只由 `UiThemeProvider` 提供,不新增 ConfigProvider;按钮图标从 `src/components/common/icons/ActionIcons.js` 导入。页面改动需检查浅色、深色与窄屏。
|
||||||
- **国际化**:文案写 `t('中文原文')`,新 key 补齐 `src/i18n/locales/` 下 9 个语言包;运行时开放语言以 `src/i18n/catalog.js` 为准(简中、繁中、英、日、韩、越、泰),`fr.json`、`ru.json` 尚未登记。
|
- **国际化**:文案写 `t('中文原文')`,新 key 补齐 `src/i18n/locales/` 下 9 个语言包;运行时开放语言以 `src/i18n/catalog.js` 为准(简中、繁中、英、日、韩、越、泰),`fr.json`、`ru.json` 尚未登记。
|
||||||
- **版权声明**:通用版权与许可声明见 [NOTICE.md](NOTICE.md),源码无需重复添加长文件头;保留独立的第三方声明。
|
|
||||||
|
|
||||||
## 6. 常用命令与提交检查
|
## 6. 常用命令与提交检查
|
||||||
|
|
||||||
@@ -211,8 +210,6 @@ npm run preview
|
|||||||
- **缓存**:`index.html` 应及时更新,带哈希的静态资源可长缓存;后端地址写在产物中,切换需重新构建并发布。
|
- **缓存**:`index.html` 应及时更新,带哈希的静态资源可长缓存;后端地址写在产物中,切换需重新构建并发布。
|
||||||
- **部署路径**:当前按域名根路径部署;部署到子目录需检查 Vite `base`、路由与静态资源地址。
|
- **部署路径**:当前按域名根路径部署;部署到子目录需检查 Vite `base`、路由与静态资源地址。
|
||||||
|
|
||||||
仓库中的 `vercel.json` 只关闭了 GitHub 通知,未配置路由回退或代理,不能作为完整部署配置。
|
|
||||||
|
|
||||||
## 8. 常见问题
|
## 8. 常见问题
|
||||||
|
|
||||||
| 现象 | 优先检查 |
|
| 现象 | 优先检查 |
|
||||||
|
|||||||
+27
-1
@@ -1,6 +1,6 @@
|
|||||||
# 变更记录(CHANGELOG)
|
# 变更记录(CHANGELOG)
|
||||||
|
|
||||||
> 状态:有效(持续追加) · 更新:2026-11-25 · 版本:v3.10
|
> 状态:有效(持续追加) · 更新:2026-11-26 · 版本:v3.14
|
||||||
|
|
||||||
对现状仍有影响的功能与修复记录,按日期倒序。改造、迁移、优化等一次性过程不在此记录。
|
对现状仍有影响的功能与修复记录,按日期倒序。改造、迁移、优化等一次性过程不在此记录。
|
||||||
|
|
||||||
@@ -8,6 +8,32 @@
|
|||||||
|
|
||||||
**记录规则**:每条写“范围、变更、影响、回滚、关联”五项;回滚优先 `git revert <提交>`,提交含多项改动时按文件还原(`git checkout <提交>^ -- <文件>`),不整仓 reset。本文不作为规则依据。
|
**记录规则**:每条写“范围、变更、影响、回滚、关联”五项;回滚优先 `git revert <提交>`,提交含多项改动时按文件还原(`git checkout <提交>^ -- <文件>`),不整仓 reset。本文不作为规则依据。
|
||||||
|
|
||||||
|
## 2026-11-26
|
||||||
|
|
||||||
|
### 修复 · 稳定推广分享弹窗高度
|
||||||
|
|
||||||
|
- **范围**:顶栏「推广分享」弹窗的链接分享和海报分享页签。
|
||||||
|
- **变更**:两个页签共用等高的内容区,并按视口限制高度。邀请卡片和海报预览共用列宽、圆角和最小高度。
|
||||||
|
- **影响**:切换页签时弹窗位置保持稳定,两张卡片对齐,内容超出可用高度时在页签内滚动。
|
||||||
|
- **回滚**:恢复推广分享弹窗原有的页签高度、滚动和预览卡片样式。
|
||||||
|
- **关联**:`src/components/promotion/promotion-poster.css`。
|
||||||
|
|
||||||
|
### 清理 · 移除 Bun 锁文件、Vercel 配置和根目录声明文档
|
||||||
|
|
||||||
|
- **范围**:依赖锁文件、Vercel 配置、根目录声明文档和 Git 忽略规则。
|
||||||
|
- **变更**:移除 `bun.lock`、`vercel.json` 和 `NOTICE.md`,清理现行文档中的对应引用,忽略 `bun.lock`、`bun.lockb` 和 `vercel.json`。
|
||||||
|
- **影响**:npm 继续使用 `package-lock.json`。Vercel Git 部署改由 Vercel 项目设置提供安装和构建命令。
|
||||||
|
- **回滚**:还原本次文档和忽略规则改动,并从变更前的 Git 版本恢复三个文件。
|
||||||
|
- **关联**:`.gitignore`、`README.md`、`docs/standards/DEV_STANDARDS.md`。
|
||||||
|
|
||||||
|
### 调整 · 暂时隐藏推广分享中的邀请奖励规则入口
|
||||||
|
|
||||||
|
- **范围**:顶栏「推广 → 推广分享」弹窗。
|
||||||
|
- **变更**:暂停渲染弹窗底部「查看邀请奖励规则」入口。
|
||||||
|
- **影响**:用户仍可通过弹窗分享邀请链接、邀请码和海报。
|
||||||
|
- **回滚**:将 `SHOW_INVITATION_REWARD_RULES` 设为 `true`。
|
||||||
|
- **关联**:`src/components/promotion/PromotionPosterModal.jsx`。
|
||||||
|
|
||||||
## 2026-11-25
|
## 2026-11-25
|
||||||
|
|
||||||
### 优化 · 成员排行按需加载并固定翻页结果
|
### 优化 · 成员排行按需加载并固定翻页结果
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# 统一开发与 Ant Design CRUD 规范
|
# 统一开发与 Ant Design CRUD 规范
|
||||||
|
|
||||||
> 状态:有效 · 适用:React 18.3、antd 6.7.0、Vite 5.4、Node ≥ 22.13 · 更新:2026-11-20 · 版本:v2.5
|
> 状态:有效 · 适用:React 18.3、antd 6.7.0、Vite 5.4、Node ≥ 22.13 · 更新:2026-11-26 · 版本:v2.6
|
||||||
|
|
||||||
新增与重构 CRUD 的编码规范:目录与命名、组件选择、请求、React 组件与状态、表单与弹层、权限、i18n,以及可直接复制的页面模板。外观取值见 `UI_COMPONENT_STANDARDS.md`。
|
新增与重构 CRUD 的编码规范:目录与命名、组件选择、请求、React 组件与状态、表单与弹层、权限、i18n,以及可直接复制的页面模板。外观取值见 `UI_COMPONENT_STANDARDS.md`。
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
### 1.3 版权声明
|
### 1.3 版权声明
|
||||||
|
|
||||||
通用版权与许可声明集中保留在 [NOTICE.md](../../NOTICE.md)。源码不重复添加长版权文件头,不移除独立的第三方声明。
|
源码不重复添加通用长版权文件头,保留独立的第三方声明。
|
||||||
|
|
||||||
## 2. Ant Design 组件边界
|
## 2. Ant Design 组件边界
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ import { API, showError, showSuccess, copy } from '../../helpers';
|
|||||||
|
|
||||||
const { Text, Title, Paragraph } = Typography;
|
const { Text, Title, Paragraph } = Typography;
|
||||||
|
|
||||||
|
// 暂时隐藏推广弹窗里的邀请奖励规则入口。
|
||||||
|
const SHOW_INVITATION_REWARD_RULES = false;
|
||||||
|
|
||||||
// 默认海报模板配置
|
// 默认海报模板配置
|
||||||
const DEFAULT_TEMPLATES = [
|
const DEFAULT_TEMPLATES = [
|
||||||
{ id: 'blue', name: '科技蓝' },
|
{ id: 'blue', name: '科技蓝' },
|
||||||
@@ -449,23 +452,25 @@ const PromotionPosterModal = ({ visible, onClose }) => {
|
|||||||
title={t('邀请链接获取中,请稍后')}
|
title={t('邀请链接获取中,请稍后')}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<button
|
{SHOW_INVITATION_REWARD_RULES && (
|
||||||
type='button'
|
<button
|
||||||
className='pm-rewards'
|
type='button'
|
||||||
onClick={() => {
|
className='pm-rewards'
|
||||||
onClose();
|
onClick={() => {
|
||||||
navigate('/user-center/invite');
|
onClose();
|
||||||
}}
|
navigate('/user-center/invite');
|
||||||
>
|
}}
|
||||||
<span className='pm-rewards-icon'>
|
>
|
||||||
<Gift size={20} aria-hidden />
|
<span className='pm-rewards-icon'>
|
||||||
</span>
|
<Gift size={20} aria-hidden />
|
||||||
<span className='pm-rewards-copy'>
|
</span>
|
||||||
<strong>{t('查看邀请奖励规则')}</strong>
|
<span className='pm-rewards-copy'>
|
||||||
<span>{t('了解返佣比例和奖励详情')}</span>
|
<strong>{t('查看邀请奖励规则')}</strong>
|
||||||
</span>
|
<span>{t('了解返佣比例和奖励详情')}</span>
|
||||||
<ChevronRight size={18} aria-hidden />
|
</span>
|
||||||
</button>
|
<ChevronRight size={18} aria-hidden />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
--pm-soft: var(--brand-primary-soft);
|
--pm-soft: var(--brand-primary-soft);
|
||||||
--pm-qr-surface: var(--ui-color-white);
|
--pm-qr-surface: var(--ui-color-white);
|
||||||
--pm-poster-ink: var(--ui-color-white);
|
--pm-poster-ink: var(--ui-color-white);
|
||||||
|
--pm-body-max-height: calc(100dvh - 200px);
|
||||||
|
--pm-tab-panel-height: 448px;
|
||||||
|
--pm-preview-min-height: 418px;
|
||||||
max-width: calc(100vw - 32px);
|
max-width: calc(100vw - 32px);
|
||||||
padding-block: 24px;
|
padding-block: 24px;
|
||||||
}
|
}
|
||||||
@@ -29,23 +32,44 @@
|
|||||||
right: 24px;
|
right: 24px;
|
||||||
}
|
}
|
||||||
.promotion-modal .ant-modal-body {
|
.promotion-modal .ant-modal-body {
|
||||||
max-height: calc(100dvh - 160px);
|
max-height: var(--pm-body-max-height);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
}
|
}
|
||||||
|
.promotion-tabs {
|
||||||
|
max-block-size: var(--pm-body-max-height);
|
||||||
|
}
|
||||||
.promotion-tabs > .ant-tabs-nav {
|
.promotion-tabs > .ant-tabs-nav {
|
||||||
|
flex-shrink: 0;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
.promotion-tabs > .ant-tabs-body-holder {
|
||||||
|
flex: 0 1 var(--pm-tab-panel-height);
|
||||||
|
min-block-size: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
scrollbar-gutter: stable;
|
||||||
|
}
|
||||||
.pm-tab-label {
|
.pm-tab-label {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
.pm-link-layout {
|
.pm-link-layout,
|
||||||
|
.pm-poster-layout {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
|
||||||
gap: 32px;
|
gap: 32px;
|
||||||
align-items: stretch;
|
align-items: start;
|
||||||
|
}
|
||||||
|
.pm-invitation-card,
|
||||||
|
.pm-preview-stage {
|
||||||
|
min-block-size: var(--pm-preview-min-height);
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
.pm-share-details,
|
||||||
|
.pm-poster-options {
|
||||||
|
align-self: center;
|
||||||
}
|
}
|
||||||
.pm-invitation-card {
|
.pm-invitation-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -53,7 +77,6 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 28px 20px;
|
padding: 28px 20px;
|
||||||
border: 1px solid var(--pm-border);
|
border: 1px solid var(--pm-border);
|
||||||
border-radius: 12px;
|
|
||||||
background: var(--pm-muted);
|
background: var(--pm-muted);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
@@ -195,12 +218,6 @@
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
color: var(--pm-secondary);
|
color: var(--pm-secondary);
|
||||||
}
|
}
|
||||||
.pm-poster-layout {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
||||||
gap: 32px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.promotion-modal [data-poster-template='blue'] {
|
.promotion-modal [data-poster-template='blue'] {
|
||||||
--pm-template-background: #2455b8;
|
--pm-template-background: #2455b8;
|
||||||
}
|
}
|
||||||
@@ -217,7 +234,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding-inline: 16px;
|
padding-inline: 16px;
|
||||||
border-radius: 12px;
|
|
||||||
background: var(--pm-template-background);
|
background: var(--pm-template-background);
|
||||||
color: var(--pm-poster-ink);
|
color: var(--pm-poster-ink);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
@@ -228,8 +244,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
width: min(100%, 280px);
|
width: min(100%, 280px);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
min-height: 448px;
|
padding: 28px 8px 20px;
|
||||||
padding: 32px 8px 24px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
@@ -246,7 +261,7 @@
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
.pm-poster h3 {
|
.pm-poster h3 {
|
||||||
margin: 20px 0;
|
margin: 16px 0;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@@ -312,6 +327,10 @@
|
|||||||
outline-offset: 3px;
|
outline-offset: 3px;
|
||||||
}
|
}
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
|
.promotion-modal.ant-modal {
|
||||||
|
--pm-tab-panel-height: 760px;
|
||||||
|
--pm-preview-min-height: 395px;
|
||||||
|
}
|
||||||
.promotion-modal .ant-modal-container {
|
.promotion-modal .ant-modal-container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
@@ -322,9 +341,6 @@
|
|||||||
top: 18px;
|
top: 18px;
|
||||||
right: 16px;
|
right: 16px;
|
||||||
}
|
}
|
||||||
.promotion-modal .ant-modal-body {
|
|
||||||
max-height: calc(100dvh - 136px);
|
|
||||||
}
|
|
||||||
.pm-link-layout,
|
.pm-link-layout,
|
||||||
.pm-poster-layout {
|
.pm-poster-layout {
|
||||||
grid-template-columns: minmax(0, 1fr);
|
grid-template-columns: minmax(0, 1fr);
|
||||||
@@ -344,7 +360,6 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.pm-poster {
|
.pm-poster {
|
||||||
min-height: 408px;
|
|
||||||
padding-block: 24px 20px;
|
padding-block: 24px 20px;
|
||||||
}
|
}
|
||||||
.pm-template-list {
|
.pm-template-list {
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"installCommand": "npm ci",
|
|
||||||
"buildCommand": "npm run build",
|
|
||||||
"github": {
|
|
||||||
"silent": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user