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:
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>
|
||||
|
||||
Reference in New Issue
Block a user