Merge branch 'invitation' into ai-hub

This commit is contained in:
ccnetcore
2025-11-02 13:00:36 +08:00
31 changed files with 4329 additions and 24 deletions

View File

@@ -5,6 +5,8 @@
"ComputedRef": true,
"DirectiveBinding": true,
"EffectScope": true,
"ElMessage": true,
"ElMessageBox": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,

View File

@@ -6,9 +6,9 @@
<link rel="icon" href="/favicon.ico"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="baidu-site-verification" content="codeva-mkVpSFmYJm"/>
<meta name="description" content="意心AI一站式多模型 AI 平台,提供 GPT-4o、DeepSeek 等服务"/>
<meta name="description" content="意心AI一站式多模型 AI 平台,提供 AI 服务"/>
<meta name="description" content="各大主流AI无限制使用直连AIclaude ,DeepSeek,open-ai"/>
<meta name="keywords" content="意心AI, GPT-4.5, 多模型AI, AI工具"/>
<meta name="keywords" content="意心AI, 多模型AI, AI工具"/>
<meta name="keywords" content="橙子chengzi,橙子老哥ccnetcore意社区"/>
<meta name="author" content="橙子chengzi,橙子老哥ccnetcore"/>
<meta name="version" content="%VITE_APP_VERSION%"/>
@@ -112,7 +112,7 @@
<body>
<!-- 加载动画容器 -->
<div id="yixinai-loader" class="loader-container">
<div class="loader-title">意心Ai 2.0</div>
<div class="loader-title">意心Ai 2.2</div>
<div class="loader-subtitle">海外地址仅首次访问预计加载约10秒</div>
<div class="loader-logo">
<div class="pulse-box"></div>

View File

@@ -0,0 +1,33 @@
import { get, post } from '@/utils/request';
import type {
CardFlipStatusOutput,
FlipCardInput,
FlipCardOutput,
UseInviteCodeInput,
InviteCodeOutput
} from './types';
// 获取本周翻牌任务状态
export function getWeeklyTaskStatus() {
return get<CardFlipStatusOutput>('/card-flip/weekly-task-status').json();
}
// 翻牌
export function flipCard(data: FlipCardInput) {
return post<FlipCardOutput>('/card-flip/flip-card', data).json();
}
// 使用邀请码解锁翻牌次数
export function useInviteCode(data: UseInviteCodeInput) {
return post<void>('/card-flip/use-invite-code', data).json();
}
// 获取我的邀请码信息
export function getMyInviteCode() {
return get<InviteCodeOutput>('/card-flip/my-invite-code').json();
}
// 生成我的邀请码(如果没有)
export function generateMyInviteCode() {
return post<string>('/card-flip/generate-my-invite-code').json();
}

View File

@@ -0,0 +1,58 @@
// 翻牌任务状态输出
export interface CardFlipStatusOutput {
totalFlips: number; // 本周总翻牌次数
remainingFreeFlips: number; // 剩余免费次数
remainingBonusFlips: number; // 剩余赠送次数
remainingInviteFlips: number; // 剩余邀请解锁次数
canFlip: boolean; // 是否可以翻牌
myInviteCode?: string; // 用户的邀请码
invitedCount: number; // 本周邀请人数
isInvited: boolean; // 是否已被邀请
flipRecords: CardFlipRecord[]; // 翻牌记录
nextFlipTip?: string; // 下次可翻牌提示
}
// 翻牌记录
export interface CardFlipRecord {
flipNumber: number; // 翻牌序号1-10
isFlipped: boolean; // 是否已翻
isWin: boolean; // 是否中奖
rewardAmount?: number; // 奖励金额token数
flipTypeDesc?: string; // 翻牌类型描述
flipOrderIndex: number; // 在翻牌顺序中的位置1-10表示第几个翻
}
// 翻牌输入
export interface FlipCardInput {
flipNumber: number; // 翻牌序号1-10
}
// 翻牌输出
export interface FlipCardOutput {
flipNumber: number; // 翻牌序号1-10
isWin: boolean; // 是否中奖
rewardAmount?: number; // 奖励金额token数
rewardDesc?: string; // 奖励描述
showDoubleRewardTip: boolean; // 是否显示翻倍包提示
remainingFlips: number; // 剩余可翻次数
}
// 使用邀请码输入
export interface UseInviteCodeInput {
inviteCode: string; // 邀请码
}
// 邀请码信息输出
export interface InviteCodeOutput {
myInviteCode?: string; // 我的邀请码
invitedCount: number; // 本周邀请人数
isInvited: boolean; // 是否已被邀请
invitationHistory: InvitationHistoryItem[]; // 邀请历史记录
}
// 邀请历史记录项
export interface InvitationHistoryItem {
invitedUserName: string; // 被邀请人昵称(脱敏)
invitationTime: string; // 邀请时间
weekDescription: string; // 本周所在
}

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
import { FullScreen } from '@element-plus/icons-vue';
import { ref, watch } from 'vue';
interface NavItem {
@@ -17,7 +18,7 @@ interface Props {
const props = withDefaults(defineProps<Props>(), {
title: '弹窗标题',
width: '1000px',
width: '75%',
defaultActive: '',
});
@@ -25,9 +26,13 @@ const emit = defineEmits(['update:modelValue', 'confirm', 'close', 'nav-change']
const visible = ref(false);
const activeNav = ref(props.defaultActive || (props.navItems.length > 0 ? props.navItems[0].name : ''));
const isFullscreen = ref(false);
watch(() => props.modelValue, (val) => {
visible.value = val;
if (!val) {
isFullscreen.value = false; // 关闭时重置全屏状态
}
});
watch(() => props.defaultActive, (val) => {
@@ -51,17 +56,46 @@ function handleConfirm() {
emit('confirm', activeNav.value);
handleClose();
}
function toggleFullscreen() {
isFullscreen.value = !isFullscreen.value;
}
</script>
<template>
<el-dialog
v-model="visible"
:title="title"
:width="width"
:width="isFullscreen ? '100%' : width"
:before-close="handleClose"
:fullscreen="isFullscreen"
:top="isFullscreen ? '0' : '5vh'"
class="nav-dialog"
>
<template #header="{ titleId, titleClass }">
<div class="dialog-header">
<h4 :id="titleId" :class="titleClass">
{{ title }}
</h4>
<!-- 全屏按钮暂不做 -->
<div v-if="false" class="header-actions">
<slot name="extra-actions" />
<el-button
circle
plain
size="small"
class="fullscreen-btn"
:title="isFullscreen ? '退出全屏' : '全屏'"
@click="toggleFullscreen"
>
<el-icon>
<FullScreen />
</el-icon>
</el-button>
</div>
</div>
</template>
<div class="dialog-container">
<!-- 左侧导航 -->
<div class="nav-side">
@@ -104,24 +138,52 @@ function handleConfirm() {
</template>
<style scoped>
.dialog-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.header-actions {
display: flex;
gap: 8px;
align-items: center;
}
.fullscreen-btn {
transition: all 0.3s;
}
.fullscreen-btn:hover {
transform: scale(1.1);
}
.dialog-container {
display: flex;
height: 500px;
height: 70vh;
min-height: 500px;
}
:deep(.el-dialog.is-fullscreen) .dialog-container {
height: calc(100vh - 120px);
}
.nav-side {
width: 200px;
border-right: 1px solid #e6e6e6;
flex-shrink: 0;
}
.nav-menu {
border-right: none;
height: 100%;
}
.content-main {
flex: 1;
padding: 0 20px;
overflow: auto;
min-width: 0;
}
.empty-content {

View File

@@ -262,7 +262,7 @@ onMounted(async () => {
<!-- 自适应缩放 iframe -->
<iframe
src="https://ccnetcore.com/article/3a1bc4d1-6a7d-751d-91cc-2817eb2ddcde"
class="min-w-full h-[700px] scale-100 duration-300"
class="min-w-full iframe-responsive scale-100 duration-300"
loading="lazy"
sandbox="allow-scripts allow-same-origin allow-popups"
@load="document.querySelector('.iframe-loading')?.remove()"
@@ -321,6 +321,13 @@ onMounted(async () => {
min-height: 200px;
}
/* iframe 响应式高度 */
.iframe-responsive {
height: 60vh;
min-height: 400px;
max-height: 800px;
}
/* 未领取状态样式 */
.unclaimed-state {
text-align: center;

File diff suppressed because it is too large Load Diff

View File

@@ -189,6 +189,8 @@ function getProgressColor(task: DailyTaskItem): string {
.daily-task-container {
padding: 20px;
min-height: 400px;
height: 100%;
overflow-y: auto;
}
.task-header {

View File

@@ -273,6 +273,8 @@ function onProductPackage() {
.premium-service {
padding: 20px;
position: relative;
height: 100%;
overflow-y: auto;
}
.header {

View File

@@ -104,6 +104,11 @@ function contactCustomerService() {
innerVisibleContact.value = !innerVisibleContact.value;
}
// 暴露方法给父组件使用
defineExpose({
contactCustomerService,
});
// 过滤和排序后的数据
const filteredData = computed(() => {
let data = [...logData.value];
@@ -253,7 +258,6 @@ onMounted(() => {
</div>
<el-table
v-loading="loading"
:data="filteredData"
style="width: 100%"
@@ -265,7 +269,7 @@ onMounted(() => {
<el-table-column
prop="content"
label="套餐类型"
width="150"
min-width="150"
sortable="custom"
show-overflow-tooltip
/>
@@ -273,7 +277,7 @@ onMounted(() => {
show-overflow-tooltip
prop="rechargeAmount"
label="金额(元)"
width="110"
min-width="110"
sortable="custom"
>
<template #default="{ row }">
@@ -283,14 +287,14 @@ onMounted(() => {
<el-table-column
prop="creationTime"
label="充值时间"
width="160"
min-width="160"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column
prop="expireDateTime"
label="到期时间"
width="160"
min-width="160"
sortable="custom"
show-overflow-tooltip
/>
@@ -302,7 +306,7 @@ onMounted(() => {
<span v-else>{{ row.contactInfo || '-' }}</span>
</template>
</el-table-column> -->
<el-table-column show-overflow-tooltip prop="remark" label="备注" width="160">
<el-table-column show-overflow-tooltip prop="remark" label="备注" min-width="160">
<template #default="{ row }">
<el-tooltip v-if="row.remark && row.remark.length > 10" :content="row.remark" placement="top">
<span class="ellipsis-text">{{ row.remark }}</span>
@@ -379,6 +383,8 @@ onMounted(() => {
border-radius: 16px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
height: 100%;
overflow-y: auto;
}
.recharge-log-container:hover {

View File

@@ -74,6 +74,8 @@ const gridTemplateColumns = computed(() => {
<style scoped>
.model-container {
margin: 10px 0;
height: 100%;
overflow-y: auto;
}
.model-header {

View File

@@ -494,7 +494,7 @@ onBeforeUnmount(() => {
</div>
</template>
<div class="chart-container">
<div ref="lineChart" class="chart" style="height: 400px;" />
<div ref="lineChart" class="chart" style="height: 350px;" />
</div>
</el-card>
@@ -505,7 +505,7 @@ onBeforeUnmount(() => {
</div>
</template>
<div class="chart-container">
<div ref="pieChart" class="chart" style="height: 450px;" />
<div ref="pieChart" class="chart" style="height: 400px;" />
</div>
</el-card>
@@ -516,7 +516,7 @@ onBeforeUnmount(() => {
</div>
</template>
<div class="chart-container">
<div ref="barChart" class="chart" style="height: 500px;" />
<div ref="barChart" class="chart" style="height: 450px;" />
</div>
</el-card>
</div>
@@ -524,13 +524,14 @@ onBeforeUnmount(() => {
<style scoped>
.usage-statistics {
padding: 30px;
padding: 20px;
position: relative;
background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
border-radius: 16px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
min-height: 100vh;
height: 100%;
overflow-y: auto;
}
.usage-statistics:hover {

View File

@@ -293,6 +293,8 @@ function bindWechat() {
<style scoped>
.user-profile {
padding: 20px;
height: 100%;
overflow-y: auto;
}
.header {

View File

@@ -1,6 +1,8 @@
<!-- 头像 -->
<script setup lang="ts">
import { computed } from 'vue';
import { ChatLineRound } from '@element-plus/icons-vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { computed, nextTick, onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import Popover from '@/components/Popover/index.vue';
import SvgIcon from '@/components/SvgIcon/index.vue';
@@ -58,6 +60,12 @@ const popoverList = ref([
]);
const dialogVisible = ref(false);
const rechargeLogRef = ref();
const activeNav = ref('user');
// ============ 邀请码分享功能 ============
/** 从 URL 获取的邀请码 */
const externalInviteCode = ref<string>('');
const navItems = [
{ name: 'user', label: '用户信息', icon: 'User' },
@@ -69,7 +77,8 @@ const navItems = [
{ name: 'rechargeLog', label: '充值记录', icon: 'Document' },
{ name: 'usageStatistics', label: '用量统计', icon: 'Histogram' },
{ name: 'premiumService', label: '尊享服务', icon: 'ColdDrink' },
{ name: 'dailyTask', label: '每日任务', icon: 'Trophy' }
{ name: 'dailyTask', label: '每日任务(限时)', icon: 'Trophy' },
{ name: 'cardFlip', label: '每周邀请(限时)', icon: 'Present' },
// { name: 'usageStatistics2', label: '用量统计2', icon: 'Histogram' },
];
function openDialog() {
@@ -81,6 +90,12 @@ function handleConfirm(activeNav: string) {
// 导航切换
function handleNavChange(nav: string) {
activeNav.value = nav;
}
// 联系售后
function handleContactSupport() {
rechargeLogRef.value?.contactCustomerService();
}
// 点击
@@ -173,7 +188,61 @@ function openVipGuide() {
function onProductPackage() {
showProductPackage();
}
// 直接调用
// ============ 监听对话框打开事件,切换到邀请码标签页 ============
watch(dialogVisible, (newVal) => {
if (newVal && externalInviteCode.value) {
// 对话框打开后,切换标签页(已通过 :default-active 绑定,会自动响应)
// console.log('[Avatar] watch: 对话框已打开,切换到 cardFlip 标签页');
nextTick(() => {
activeNav.value = 'cardFlip';
// console.log('[Avatar] watch: 已设置 activeNav 为', activeNav.value);
});
}
// 对话框关闭时,清除邀请码状态和 URL 参数
if (!newVal && externalInviteCode.value) {
// console.log('[Avatar] watch: 对话框关闭,清除邀请码状态');
externalInviteCode.value = '';
// 清除 URL 中的 inviteCode 参数
const url = new URL(window.location.href);
if (url.searchParams.has('inviteCode')) {
url.searchParams.delete('inviteCode');
window.history.replaceState({}, '', url.toString());
// console.log('[Avatar] watch: 已清除 URL 中的 inviteCode 参数');
}
}
});
// ============ 监听 URL 参数,实现邀请码快捷分享 ============
onMounted(() => {
// 获取 URL 查询参数
const urlParams = new URLSearchParams(window.location.search);
const inviteCode = urlParams.get('inviteCode');
if (inviteCode && inviteCode.trim()) {
// console.log('[Avatar] onMounted: 检测到邀请码', inviteCode);
// 保存邀请码
externalInviteCode.value = inviteCode.trim();
// 先设置标签页为 cardFlip
activeNav.value = 'cardFlip';
// console.log('[Avatar] onMounted: 设置 activeNav 为', activeNav.value);
// 延迟打开对话框,确保状态已更新
nextTick(() => {
setTimeout(() => {
// console.log('[Avatar] onMounted: 打开用户中心对话框');
dialogVisible.value = true;
}, 200);
});
// 注意:不立即清除 URL 参数,保留给登录后使用
// URL 参数会在对话框关闭时清除
}
});
</script>
<template>
@@ -313,9 +382,20 @@ function onProductPackage() {
v-model="dialogVisible"
title="用户中心"
:nav-items="navItems"
:default-active="activeNav"
@confirm="handleConfirm"
@nav-change="handleNavChange"
>
<template #extra-actions>
<el-tooltip v-if="isUserVip() && activeNav === 'rechargeLog'" content="联系售后" placement="bottom">
<el-button circle plain size="small" @click="handleContactSupport">
<el-icon color="#07c160">
<ChatLineRound />
</el-icon>
</el-button>
</el-tooltip>
</template>
<!-- 用户管理内容 -->
<template #user>
<user-management />
@@ -349,8 +429,11 @@ function onProductPackage() {
<template #dailyTask>
<daily-task />
</template>
<template #cardFlip>
<card-flip-activity :external-invite-code="externalInviteCode" />
</template>
<template #rechargeLog>
<recharge-log />
<recharge-log ref="rechargeLogRef" />
</template>
</nav-dialog>
</div>

View File

@@ -10,6 +10,8 @@ declare module 'vue' {
export interface GlobalComponents {
AccountPassword: typeof import('./../src/components/LoginDialog/components/FormLogin/AccountPassword.vue')['default']
APIKeyManagement: typeof import('./../src/components/userPersonalCenter/components/APIKeyManagement.vue')['default']
CardFlipActivity: typeof import('./../src/components/userPersonalCenter/components/CardFlipActivity.vue')['default']
CardFlipActivity2: typeof import('./../src/components/userPersonalCenter/components/CardFlipActivity2.vue')['default']
DailyTask: typeof import('./../src/components/userPersonalCenter/components/DailyTask.vue')['default']
DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']

View File

@@ -6,7 +6,6 @@ interface ImportMetaEnv {
readonly VITE_WEB_ENV: string;
readonly VITE_WEB_BASE_API: string;
readonly VITE_API_URL: string;
readonly VITE_BUILD_COMPRESS: string;
readonly VITE_SSO_SEVER_URL: string;
readonly VITE_APP_VERSION: string;
}