首次提交
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// ========== 打卡分类 ==========
|
||||
export const CHECKIN_CATEGORIES = {
|
||||
study: { label: '学习成长', icon: 'book' },
|
||||
health: { label: '健康生活', icon: 'heart' },
|
||||
habit: { label: '习惯自律', icon: 'refresh' },
|
||||
hobby: { label: '兴趣爱好', icon: 'star' },
|
||||
goal: { label: '目标任务', icon: 'target' },
|
||||
} as const
|
||||
|
||||
// ========== 积分规则 ==========
|
||||
export const POINTS = {
|
||||
CHECKIN: 1,
|
||||
STREAK_7: 5,
|
||||
STREAK_30: 20,
|
||||
GOAL_COMPLETE: 10,
|
||||
POST_SHARE: 2,
|
||||
COMMENT: 1,
|
||||
INVITE_USER: 15,
|
||||
} as const
|
||||
|
||||
// ========== 徽章成就 ==========
|
||||
export const ACHIEVEMENTS = [
|
||||
{ id: 'first_checkin', name: '初露锋芒', condition: '第 1 次打卡', rarity: 'bronze' as const },
|
||||
{ id: 'streak_7', name: '七日坚持', condition: '连续 7 天打卡', rarity: 'bronze' as const },
|
||||
{ id: 'streak_30', name: '月满则盈', condition: '连续 30 天打卡', rarity: 'silver' as const },
|
||||
{ id: 'streak_100', name: '百日筑基', condition: '连续 100 天打卡',rarity: 'gold' as const },
|
||||
{ id: 'social_star', name: '社交达人', condition: '获得 50 个点赞', rarity: 'silver' as const },
|
||||
]
|
||||
|
||||
// ========== 分页 ==========
|
||||
export const PAGE_SIZE = 20
|
||||
|
||||
// ========== 隐私级别 ==========
|
||||
export const PRIVACY_LABEL: Record<number, string> = {
|
||||
1: '公开',
|
||||
2: '仅好友可见',
|
||||
3: '仅自己可见',
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// ========== 用户 ==========
|
||||
export interface IUser {
|
||||
id: string
|
||||
phone?: string
|
||||
nickname?: string
|
||||
avatar?: string
|
||||
bio?: string
|
||||
motto?: string
|
||||
privacy: PrivacyLevel
|
||||
points: number
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
// ========== 打卡 ==========
|
||||
export interface ICheckInItem {
|
||||
id: string
|
||||
userId: string
|
||||
name: string
|
||||
icon?: string
|
||||
category: CheckInCategory
|
||||
dailyGoal?: string
|
||||
cycleType: CycleType
|
||||
privacy: PrivacyLevel
|
||||
status: ItemStatus
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface ICheckInRecord {
|
||||
id: string
|
||||
itemId: string
|
||||
userId: string
|
||||
checkDate: string
|
||||
status: RecordStatus
|
||||
note?: string
|
||||
images?: string[]
|
||||
}
|
||||
|
||||
// ========== 枚举 ==========
|
||||
export type CheckInCategory =
|
||||
| 'study' | 'health' | 'habit' | 'hobby' | 'goal'
|
||||
|
||||
export type CycleType =
|
||||
| 'daily' | 'weekly' | 'every_other_day' | 'custom'
|
||||
|
||||
export type PrivacyLevel = 1 | 2 | 3
|
||||
// 1 = public, 2 = friends_only, 3 = private
|
||||
|
||||
export type ItemStatus = 'active' | 'paused' | 'archived' | 'deleted'
|
||||
|
||||
export type RecordStatus = 'normal' | 'makeup'
|
||||
|
||||
export type Rarity = 'bronze' | 'silver' | 'gold'
|
||||
|
||||
// ========== 社交 ==========
|
||||
export interface IGroup {
|
||||
id: string
|
||||
name: string
|
||||
cover?: string
|
||||
intro?: string
|
||||
type: 'public' | 'private'
|
||||
maxMember: number
|
||||
}
|
||||
|
||||
// ========== API 响应 ==========
|
||||
export interface ApiResponse<T = unknown> {
|
||||
code: number
|
||||
message: string
|
||||
data?: T
|
||||
}
|
||||
Reference in New Issue
Block a user