diff --git a/docker-compose.yml b/docker-compose.yml index 28836a3..3db6984 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: build: context: . dockerfile: Dockerfile - image: tradus-web:1.3.49 + image: tradus-web:1.4.0 container_name: tradus-web ports: - '6000:80' diff --git a/src/App.vue b/src/App.vue index 275fa3b..9aac7e8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -415,6 +415,19 @@ const closeUserInfoModal = () => { showUserInfoModal.value = false } +// 格式化过期时间 +const formatExpireTime = (expireTime: string | undefined) => { + if (!expireTime) return '' + const date = new Date(expireTime) + return date + .toLocaleDateString('zh-CN', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + }) + .replace(/\//g, '/') +} + // 切换主题 // const toggleTheme = () => { // themeStore.toggleTheme() @@ -568,6 +581,20 @@ onUnmounted(() => { AI 交易智能体 + + + + + 会员订阅 + { {{ userInfo?.mail || '未设置邮箱' }} - - 💰 - {{ userInfo?.points || 0 }} 积分 + + + {{ userInfo.member_name }} + { {{ userInfo?.mail || '未设置邮箱' }} - - 💰 - {{ userInfo?.points || 0 }} 积分 + + + {{ userInfo.member_name }} + { {{ userInfo?.mail || '未设置邮箱' }} - - 💰 - 积分余额:{{ userInfo?.points || 0 }} + + + {{ userInfo.member_name }} + + + + 到期时间:{{ formatExpireTime(userInfo.expire_time) }} @@ -1542,27 +1577,6 @@ body { max-width: 100%; } -.mobile-user-info .user-points { - font-size: 0.85rem; - color: var(--color-text-secondary); - display: flex; - align-items: center; - gap: 0.3rem; -} - -.mobile-user-info .user-points::before { - content: none; -} - -.mobile-user-info .points-icon { - color: var(--color-accent); - font-size: 0.9rem; -} - -.mobile-user-info .points-value { - white-space: nowrap; -} - /* 移除旧的退出按钮样式 */ .logout-button { display: none; @@ -1759,10 +1773,6 @@ body { color: var(--color-accent); } -.desktop-user-info .user-info-box:hover .user-points { - color: var(--color-text-primary); -} - .dropdown-icon { color: var(--color-text-secondary); transition: transform 0.2s ease; @@ -2066,28 +2076,6 @@ body { max-width: 100%; } -.desktop-user-info .user-points { - font-size: 0.8rem; - color: var(--color-text-secondary); - display: flex; - align-items: center; - gap: 0.3rem; - transition: all 0.2s ease; -} - -.desktop-user-info .user-points::before { - content: none; -} - -.desktop-user-info .points-icon { - color: var(--color-accent); - font-size: 0.9rem; -} - -.desktop-user-info .points-value { - white-space: nowrap; -} - /* 全局滚动条样式 */ ::-webkit-scrollbar { width: 6px; @@ -2321,23 +2309,6 @@ html { color: var(--color-text-secondary); } -.user-points-display { - display: flex; - align-items: center; - gap: 0.5rem; - font-size: 1rem; - font-weight: 500; -} - -.user-points-display .points-icon { - font-size: 1.2rem; - color: var(--color-accent); -} - -.user-points-display .points-text { - color: var(--color-text-primary); -} - .settings-section { padding: 1.5rem 2rem; } @@ -2507,6 +2478,51 @@ html { max-width: 100%; } +/* 用户会员标签样式 */ +.user-member-tag { + margin-top: 0.25rem; +} + +.member-tag { + display: inline-block; + padding: 0.2rem 0.5rem; + background: #3b82f6; + color: white; + font-size: 0.75rem; + font-weight: 500; + border-radius: 0.375rem; + transition: all 0.2s ease; +} + +.member-tag.svip-tag { + background: linear-gradient(135deg, #d4af37, #ffd700); + color: #2d1810; + box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3); +} + +.member-tag:hover { + transform: scale(1.05); +} + +.member-tag.svip-tag:hover { + box-shadow: 0 4px 8px rgba(212, 175, 55, 0.4); +} + +/* 模态框中的用户会员信息 */ +.user-member-info { + margin: 0.5rem 0; +} + +.user-expire-info { + margin-top: 0.5rem; +} + +.expire-text { + font-size: 0.85rem; + color: var(--color-text-secondary); + font-weight: 400; +} + .desktop-user-info .user-info-box:hover .user-email-display { color: var(--color-accent); } diff --git a/src/router/index.ts b/src/router/index.ts index 2bca387..8fdcb30 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -63,6 +63,22 @@ const router = createRouter({ title: 'AI 交易智能体', }, }, + { + path: '/subscription', + name: 'subscription', + component: () => import('../views/SubscriptionView.vue'), + meta: { + title: '会员订阅', + }, + }, + { + path: '/subscription-success', + name: 'subscription-success', + component: () => import('../views/SubscriptionSuccessView.vue'), + meta: { + title: '订阅成功', + }, + }, { path: '/contact', name: 'contact', diff --git a/src/stores/user.ts b/src/stores/user.ts index 95e64be..338ea0d 100644 --- a/src/stores/user.ts +++ b/src/stores/user.ts @@ -8,6 +8,9 @@ export interface UserInfo { level: number create_time: string points?: number + member_name?: string + is_subscribed?: boolean + expire_time?: string } export interface AuthResponse { diff --git a/src/views/ChatAgentView.vue b/src/views/ChatAgentView.vue index cb248a3..89c873a 100644 --- a/src/views/ChatAgentView.vue +++ b/src/views/ChatAgentView.vue @@ -8,10 +8,7 @@ import { useUserStore } from '../stores/user' const userStore = useUserStore() const userInfo = computed(() => userStore.userInfo) -// 计算属性:用户积分余额,直接从store获取 -const userPoints = computed(() => { - return userInfo.value?.points || 0 -}) +// 注释:userPoints已移除,因为当前页面不需要显示积分信息 // 配置marked选项 onMounted(() => { @@ -677,18 +674,6 @@ const stopStreaming = async () => { AI交易智能体 为您提供市场分析、交易建议和投资策略 - - - - 💰 - - 每次分析消耗 - 20 积分 - - - @@ -759,6 +744,15 @@ const stopStreaming = async () => { + + + 💡 + + 非订阅用户每天只有 1 次体验分析, + 订阅后解锁无限次分析 + + + { z-index: 10; } +/* 使用限制提示样式 */ +.usage-tips { + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.75rem 1rem; + background: linear-gradient(135deg, #fff3cd, #ffeaa7); + border: 1px solid #ffd60a; + border-radius: 12px; + margin-bottom: 1rem; + box-shadow: 0 2px 8px rgba(255, 214, 10, 0.1); +} + +.tips-icon { + font-size: 1.25rem; + flex-shrink: 0; +} + +.tips-content { + display: flex; + flex-direction: column; + gap: 0.25rem; + flex: 1; +} + +.tips-text { + font-size: 0.9rem; + color: #856404; + line-height: 1.4; +} + +.tips-link { + font-size: 0.9rem; + color: #0066cc; + text-decoration: none; + font-weight: 500; + transition: color 0.2s ease; +} + +.tips-link:hover { + color: #004080; + text-decoration: underline; +} + /* 快速分析按钮样式 */ .quick-analysis-buttons { display: flex; @@ -1934,6 +1972,26 @@ const stopStreaming = async () => { font-size: 1rem; } + /* 移动端使用限制提示样式 */ + .usage-tips { + padding: 0.6rem 0.75rem; + margin-bottom: 0.75rem; + gap: 0.5rem; + } + + .tips-icon { + font-size: 1.1rem; + } + + .tips-content { + gap: 0.2rem; + } + + .tips-text, + .tips-link { + font-size: 0.85rem; + } + .conversation-header { padding: 0.6rem 0.75rem; height: 4rem; diff --git a/src/views/SubscriptionSuccessView.vue b/src/views/SubscriptionSuccessView.vue new file mode 100644 index 0000000..f1350b2 --- /dev/null +++ b/src/views/SubscriptionSuccessView.vue @@ -0,0 +1,199 @@ + + + + + + + + + + + + 订阅成功! + 恭喜您成为尊享会员,享受专属权益 + + + + + + 开始体验 + 返回首页 + + + + + + + diff --git a/src/views/SubscriptionView.vue b/src/views/SubscriptionView.vue new file mode 100644 index 0000000..72a627f --- /dev/null +++ b/src/views/SubscriptionView.vue @@ -0,0 +1,786 @@ + + + + + + 选择您的会员计划 + 解锁全部功能,享受无限制的AI分析服务 + + + + + + + + + + + 推荐 + 尊享会员 + 适合个人用户和专业投资者 + + + + + + ¥{{ pricing.price_month }} + /月 + + + ¥{{ pricing.price_year }} + /年 + + + + 加载中... + + + 暂不可用 + + + + + 包月 + + + 按年 + + + + + + + + + + 每天无限次分析额度 + + + + + + 专属技术支持 + + + + + + 优先处理 + + + + + + 高级功能解锁 + + + + + 立刻订阅 + + + + + + + + + + + 确认订阅 + + + + + + + + {{ selectedPlan?.title }} + + ¥{{ selectedPlan?.price }} / {{ selectedPlan?.period.replace('订阅', '') }} + + {{ selectedPlan?.quota }} + + + + 取消 + + + 创建订单中... + 确认订阅 + + + + + + + + + +
为您提供市场分析、交易建议和投资策略
恭喜您成为尊享会员,享受专属权益
解锁全部功能,享受无限制的AI分析服务
适合个人用户和专业投资者
{{ selectedPlan?.quota }}