feat: 新增翻牌活动入口与全局组件声明
- 在 Header Avatar 菜单新增翻牌活动(cardFlip)入口,并添加对应插槽 <card-flip-activity/> - 在 types/components.d.ts 中添加 CardFlipActivity 与 ElCollapseTransition 类型声明 - 在 .eslintrc-auto-import.json 中新增 ElMessage 与 ElMessageBox 自动导入 - 从 import_meta.d.ts 中移除 VITE_BUILD_COMPRESS 环境声明 - 在 YiAbpWebModule.cs 中添加相关 using 并保留数据库建表初始化的注释(CodeFirst.InitTables)
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
"ComputedRef": true,
|
||||
"DirectiveBinding": true,
|
||||
"EffectScope": true,
|
||||
"ElMessage": true,
|
||||
"ElMessageBox": true,
|
||||
"ExtractDefaultPropTypes": true,
|
||||
"ExtractPropTypes": true,
|
||||
"ExtractPublicPropTypes": true,
|
||||
|
||||
33
Yi.Ai.Vue3/src/api/cardFlip/index.ts
Normal file
33
Yi.Ai.Vue3/src/api/cardFlip/index.ts
Normal 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();
|
||||
}
|
||||
57
Yi.Ai.Vue3/src/api/cardFlip/types.ts
Normal file
57
Yi.Ai.Vue3/src/api/cardFlip/types.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
// 翻牌任务状态输出
|
||||
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; // 翻牌类型描述
|
||||
}
|
||||
|
||||
// 翻牌输入
|
||||
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; // 本周所在
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -69,7 +69,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() {
|
||||
@@ -349,6 +350,9 @@ function onProductPackage() {
|
||||
<template #dailyTask>
|
||||
<daily-task />
|
||||
</template>
|
||||
<template #cardFlip>
|
||||
<card-flip-activity />
|
||||
</template>
|
||||
<template #rechargeLog>
|
||||
<recharge-log />
|
||||
</template>
|
||||
|
||||
2
Yi.Ai.Vue3/types/components.d.ts
vendored
2
Yi.Ai.Vue3/types/components.d.ts
vendored
@@ -10,6 +10,7 @@ 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']
|
||||
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']
|
||||
@@ -19,6 +20,7 @@ declare module 'vue' {
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||
ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition']
|
||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
|
||||
1
Yi.Ai.Vue3/types/import_meta.d.ts
vendored
1
Yi.Ai.Vue3/types/import_meta.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user