Compare commits

..

8 Commits

Author SHA1 Message Date
0812a6192f fix: 普通对话返回后不再显示智能体对话
- showConversationList 简化为直接返回主页
- 主页对话列表正确过滤(只显示没有 agentId 的普通对话)
- 添加操作菜单支持(重命名、分享、置顶、删除)
- 统一使用全局变量 currentActionConvId
2026-04-27 11:18:15 +08:00
c8cea4c1a1 feat: 登录注册系统 + 游客使用限制
功能:
- 登录/注册界面(本地存储用户数据)
- 我的页面显示用户状态、登录/退出按钮
- 游客配额显示(对话会话/消息/智能体消息)

游客限制:
- 每天最多1个对话会话
- 每天最多20条对话消息
- 只能使用通用助手智能体
- 每天最多20条智能体消息
- 登录用户无限制

限制提示:
- 达到限制弹出提示对话框
- 提示登录解锁全部功能
2026-04-27 11:06:20 +08:00
439743c051 fix: 智能体对话不显示在历史对话列表中
- 对话页面只显示没有智能体的普通对话
- 智能体对话只在智能体页面的最近使用列表显示
- 搜索功能也只搜索普通对话
2026-04-27 10:50:43 +08:00
dbd1853e6e feat: 智能体发现和收藏功能
- 智能体界面顶部右侧添加搜索按钮(发现智能体)
- 点击进入发现页面,显示所有系统智能体
- 每个智能体显示简介、热度、类别
- 支持添加和收藏按钮
- 添加的智能体自动归类到对应类别
- 智能体界面顶部右侧添加收藏按钮(☆)
- 点击进入收藏夹页面,点击智能体进入对话
- 智能体长按弹出操作菜单(置顶、收藏、删除)
- 置顶、收藏、用户智能体配置持久化存储
2026-04-27 10:45:30 +08:00
213b11c707 feat: 智能体历史改为显示每次对话记录而非合并统计 2026-04-27 00:26:51 +08:00
0303ccabc0 fix: 智能体使用记录改为发送第一条消息时才记录 2026-04-26 23:52:14 +08:00
e6b3465aa7 fix: 最近使用改为标题右侧显示更多>>链接 2026-04-26 23:48:42 +08:00
b6455e4720 feat: 智能体历史使用列表 - 显示最近使用的智能体(最多5个)+ 使用次数和时间 + 查看全部历史页面 2026-04-26 23:24:58 +08:00
3 changed files with 2377 additions and 295 deletions

1752
www/app.js

File diff suppressed because it is too large Load Diff

View File

@@ -8,12 +8,12 @@
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>AI助手</title>
<link rel="stylesheet" href="style.css?v=3.0.2">
<link rel="stylesheet" href="style.css?v=3.3.1">
<link rel="manifest" href="manifest.json">
</head>
<body>
<div id="app"></div>
<script src="marked.min.js?v=3.0.2"></script>
<script src="app.js?v=3.0.2"></script>
<script src="marked.min.js?v=3.3.1"></script>
<script src="app.js?v=3.3.1"></script>
</body>
</html>

View File

@@ -167,6 +167,57 @@ body {
height: 100%;
}
.agents-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.agents-header h1 {
font-size: 18px;
font-weight: 600;
}
.agents-header-actions {
display: flex;
align-items: center;
gap: 8px;
}
.agents-header-btn {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: rgba(255,255,255,0.95);
border: none;
border-radius: 50%;
color: var(--primary);
cursor: pointer;
transition: all 0.25s ease;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
font-size: 18px;
}
.agents-header-btn:hover {
transform: scale(1.08);
box-shadow: 0 4px 16px rgba(102,126,234,0.4);
color: #5a67d8;
}
.agents-header-btn.favorite-btn {
font-size: 20px;
font-weight: bold;
}
.agents-header-btn.favorite-btn.has-favorites {
color: #f59e0b;
}
.agents-content {
flex: 1;
padding: 16px;
@@ -185,6 +236,28 @@ body {
margin-bottom: 12px;
}
.section-title-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.section-title-row .section-title {
margin-bottom: 0;
}
.section-more {
font-size: 14px;
color: var(--primary);
cursor: pointer;
transition: color 0.2s;
}
.section-more:hover {
color: #5a67d8;
}
.agents-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
@@ -201,6 +274,7 @@ body {
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
position: relative;
}
.agent-card:hover {
@@ -209,6 +283,31 @@ body {
transform: translateY(-2px);
}
.agent-card.pinned {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.08);
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}
.agent-card.favorite {
border-color: #f59e0b;
box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}
.agent-pin-icon {
position: absolute;
top: 8px;
left: 8px;
font-size: 14px;
}
.agent-fav-icon {
position: absolute;
top: 8px;
right: 8px;
font-size: 14px;
}
.agent-avatar {
font-size: 32px;
margin-bottom: 8px;
@@ -227,6 +326,821 @@ body {
text-align: center;
}
/* 智能体操作菜单 */
.agent-action-menu {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: transparent;
display: none;
z-index: 1000;
}
.agent-action-menu.show {
display: block;
}
.agent-action-menu-content {
background: white;
border-radius: 16px 16px 0 0;
padding: 16px;
box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
animation: slideUp 0.2s ease;
}
.agent-action-item {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 16px;
border-radius: 10px;
cursor: pointer;
transition: all 0.2s;
}
.agent-action-item:hover {
background: rgba(102, 126, 234, 0.1);
}
.agent-action-item svg {
color: var(--primary);
}
.agent-action-item span {
font-size: 16px;
color: var(--text-color);
}
.agent-action-item.delete-action svg,
.agent-action-item.delete-action span {
color: #e53e3e;
}
.agent-action-item.delete-action:hover {
background: rgba(229, 62, 62, 0.1);
}
/* ==================== 智能体发现页面 ==================== */
.agent-discover-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
background: #f5f5f5;
}
.discover-header {
display: flex;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.discover-header h1 {
font-size: 18px;
font-weight: 600;
margin-left: 12px;
}
.back-btn-white {
background: transparent;
border: none;
color: white;
padding: 8px;
cursor: pointer;
display: flex;
align-items: center;
}
.discover-content {
flex: 1;
padding: 16px;
overflow-y: auto;
}
.discover-search {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 12px;
margin-bottom: 16px;
}
.discover-search svg {
color: var(--text-light);
}
.discover-search input {
flex: 1;
font-size: 16px;
border: none;
outline: none;
background: transparent;
}
.discover-section {
margin-bottom: 24px;
}
.discover-section-title {
font-size: 16px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 12px;
}
.discover-grid {
display: flex;
flex-direction: column;
gap: 12px;
}
.discover-card {
display: flex;
flex-direction: column;
padding: 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 12px;
transition: all 0.2s;
}
.discover-card:hover {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.05);
}
.discover-card-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 8px;
}
.discover-avatar {
font-size: 32px;
}
.discover-card-info {
flex: 1;
}
.discover-name {
font-size: 16px;
font-weight: 600;
color: var(--text-color);
}
.discover-meta {
display: flex;
align-items: center;
gap: 8px;
margin-top: 4px;
}
.discover-category {
font-size: 12px;
color: var(--primary);
background: rgba(102, 126, 234, 0.1);
padding: 2px 8px;
border-radius: 4px;
}
.discover-heat {
font-size: 12px;
color: #f59e0b;
}
.discover-desc {
font-size: 14px;
color: var(--text-light);
margin-bottom: 12px;
}
.discover-actions {
display: flex;
gap: 8px;
}
.discover-action-btn {
flex: 1;
padding: 8px 12px;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 14px;
color: var(--text-light);
background: white;
cursor: pointer;
transition: all 0.2s;
}
.discover-action-btn:hover {
border-color: var(--primary);
color: var(--primary);
}
.discover-action-btn.add-btn {
border-color: var(--primary);
color: var(--primary);
}
.discover-action-btn.add-btn:hover {
background: var(--primary);
color: white;
}
.discover-action-btn.add-btn.added {
background: rgba(102, 126, 234, 0.1);
color: var(--primary);
border-color: var(--primary);
}
.discover-action-btn.favorite-btn {
border-color: #f59e0b;
color: #f59e0b;
}
.discover-action-btn.favorite-btn:hover {
background: #f59e0b;
color: white;
}
.discover-action-btn.favorite-btn.favorited {
background: #f59e0b;
color: white;
}
/* ==================== 智能体收藏夹页面 ==================== */
.agent-favorite-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
background: #f5f5f5;
}
.favorite-header {
display: flex;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.favorite-header h1 {
font-size: 18px;
font-weight: 600;
margin-left: 12px;
}
.favorite-content {
flex: 1;
padding: 16px;
overflow-y: auto;
}
.empty-favorites {
text-align: center;
padding: 60px 20px;
}
.empty-icon {
font-size: 48px;
margin-bottom: 16px;
color: #f59e0b;
}
.empty-favorites p {
color: var(--text-light);
margin: 8px 0;
}
.empty-favorites .empty-tip {
font-size: 14px;
color: var(--primary);
}
.favorite-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}
.favorite-agent-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 16px;
background: white;
border: 1px solid #f59e0b;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
position: relative;
box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}
.favorite-agent-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}
.favorite-agent-avatar {
font-size: 32px;
margin-bottom: 8px;
}
.favorite-agent-name {
font-size: 14px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 4px;
}
.favorite-agent-desc {
font-size: 12px;
color: var(--text-light);
text-align: center;
}
.favorite-agent-unfav {
position: absolute;
top: 8px;
right: 8px;
width: 24px;
height: 24px;
background: transparent;
border: none;
color: #f59e0b;
font-size: 16px;
cursor: pointer;
opacity: 0.6;
transition: opacity 0.2s;
}
.favorite-agent-unfav:hover {
opacity: 1;
}
/* ==================== 登录注册页面 ==================== */
.auth-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
background: #f5f5f5;
}
.auth-header {
display: flex;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.auth-header h1 {
font-size: 18px;
font-weight: 600;
margin-left: 12px;
}
.auth-content {
flex: 1;
padding: 24px 16px;
display: flex;
flex-direction: column;
}
.auth-form {
background: white;
padding: 24px;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.auth-input-group {
margin-bottom: 20px;
}
.auth-input-group label {
display: block;
font-size: 14px;
font-weight: 500;
color: var(--text-color);
margin-bottom: 8px;
}
.auth-input-group input {
width: 100%;
padding: 12px 16px;
border: 2px solid var(--border-color);
border-radius: 10px;
font-size: 16px;
outline: none;
transition: border-color 0.2s;
}
.auth-input-group input:focus {
border-color: var(--primary);
}
.auth-submit-btn {
width: 100%;
padding: 14px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s;
}
.auth-submit-btn:hover {
transform: scale(1.02);
}
.auth-submit-btn:active {
transform: scale(0.98);
}
.auth-footer {
text-align: center;
padding: 24px;
color: var(--text-light);
}
.auth-link {
color: var(--primary);
font-weight: 500;
cursor: pointer;
}
.auth-link:hover {
color: #5a67d8;
}
/* ==================== 我的页面 ==================== */
.profile-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 24px;
background: white;
border-radius: 12px;
margin-bottom: 16px;
}
.profile-avatar {
font-size: 48px;
margin-bottom: 8px;
}
.profile-name {
font-size: 18px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 8px;
}
.profile-status {
font-size: 14px;
color: #22c55e;
margin-bottom: 16px;
}
.profile-status.guest {
color: var(--text-light);
}
.profile-login-buttons {
display: flex;
flex-direction: column;
gap: 12px;
width: 100%;
}
.login-btn, .register-btn, .logout-btn {
width: 100%;
padding: 12px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: transform 0.2s;
}
.login-btn:hover, .register-btn:hover, .logout-btn:hover {
transform: scale(1.02);
}
.register-btn {
background: white;
border: 2px solid var(--primary);
color: var(--primary);
}
.logout-btn {
background: #fee2e2;
color: #e53e3e;
}
.skip-btn {
width: 100%;
padding: 10px;
background: transparent;
border: 1px solid var(--border-color);
color: var(--text-light);
border-radius: 8px;
font-size: 14px;
cursor: pointer;
}
.skip-btn:hover {
background: rgba(0,0,0,0.05);
}
/* ==================== 配额显示 ==================== */
.quota-card {
background: white;
padding: 16px;
border-radius: 12px;
margin-bottom: 16px;
border: 1px solid var(--border-color);
}
.quota-title {
font-size: 14px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 12px;
}
.quota-items {
display: flex;
flex-direction: column;
gap: 8px;
}
.quota-item {
display: flex;
justify-content: space-between;
align-items: center;
}
.quota-label {
font-size: 14px;
color: var(--text-light);
}
.quota-value {
font-size: 14px;
font-weight: 500;
color: var(--primary);
}
.quota-tip {
text-align: center;
font-size: 12px;
color: #f59e0b;
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid var(--border-color);
}
/* ==================== 限制提示对话框 ==================== */
.limit-dialog {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 2000;
}
.limit-dialog-content {
background: white;
padding: 24px;
border-radius: 16px;
max-width: 300px;
text-align: center;
animation: dialogSlideUp 0.2s ease;
}
@keyframes dialogSlideUp {
from { transform: translateY(20px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.limit-dialog-icon {
font-size: 48px;
margin-bottom: 16px;
}
.limit-dialog-title {
font-size: 18px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 12px;
}
.limit-dialog-message {
font-size: 14px;
color: var(--text-light);
line-height: 1.6;
margin-bottom: 20px;
white-space: pre-line;
}
.limit-dialog-actions {
display: flex;
gap: 12px;
}
.limit-dialog-btn {
flex: 1;
padding: 12px;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.limit-dialog-btn.login {
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
border: none;
}
.limit-dialog-btn.login:hover {
transform: scale(1.02);
}
.limit-dialog-btn.cancel {
background: white;
border: 1px solid var(--border-color);
color: var(--text-light);
}
.limit-dialog-btn.cancel:hover {
background: var(--bg-color);
}
/* 最近使用的智能体列表 */
.recent-agents-list {
display: flex;
flex-direction: column;
gap: 8px;
}
.recent-agent-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 10px;
cursor: pointer;
transition: all 0.2s;
}
.recent-agent-item:hover {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.05);
}
.recent-agent-left {
display: flex;
align-items: center;
gap: 12px;
}
.recent-agent-avatar {
font-size: 20px;
}
.recent-agent-name {
font-size: 14px;
font-weight: 500;
color: var(--text-color);
}
.recent-agent-right {
display: flex;
align-items: center;
gap: 12px;
font-size: 12px;
color: var(--text-light);
}
.recent-agent-usage {
color: var(--primary);
}
.recent-agent-agent-name {
font-size: 12px;
color: var(--primary);
background: rgba(102, 126, 234, 0.1);
padding: 2px 8px;
border-radius: 4px;
}
/* 智能体历史页面 */
.agent-history-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
}
.back-btn-white {
background: transparent;
border: none;
color: white;
padding: 8px;
cursor: pointer;
}
.agent-history-content {
flex: 1;
padding: 16px;
overflow-y: auto;
background: #f5f5f5;
}
.agent-history-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 10px;
margin-bottom: 8px;
cursor: pointer;
transition: all 0.2s;
}
.agent-history-item:hover {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.05);
}
.agent-history-left {
display: flex;
align-items: center;
gap: 12px;
}
.agent-history-avatar {
font-size: 24px;
}
.agent-history-name {
font-size: 15px;
font-weight: 500;
color: var(--text-color);
}
.agent-history-right {
display: flex;
align-items: center;
gap: 12px;
font-size: 13px;
color: var(--text-light);
}
.agent-history-usage {
color: var(--primary);
}
.agent-history-agent {
font-size: 12px;
color: var(--primary);
background: rgba(102, 126, 234, 0.1);
padding: 2px 8px;
border-radius: 4px;
}
/* ==================== 我的页面 ==================== */
.profile-page {