Initial commit

This commit is contained in:
2026-06-05 17:46:51 +08:00
commit c04c890186
96 changed files with 6477 additions and 0 deletions

108
miniprogram/types/index.ts Normal file
View File

@@ -0,0 +1,108 @@
export interface Pet {
_id: string
ownerId: string
name: string
species: 'dog' | 'cat' | 'other'
breed: string
gender: 'male' | 'female'
birthday?: string
age: string
emoji: string
photos: string[]
tags: string[]
bio?: string
}
export interface UserProfile {
_id: string
openid: string
nickName: string
avatarUrl: string
handle: string
location: string
bio: string
stats: {
posts: number
friends: number
likes: number
}
lastLocation?: GeoPoint
isOnline: boolean
lastSeen: string
pets: Pet[]
}
export interface GeoPoint {
latitude: number
longitude: number
}
export interface LocationTag {
name: string
latitude: number
longitude: number
address?: string
}
export interface Post {
_id: string
authorId: string
author?: UserProfile
petId?: string
pet?: Pet
content: string
images: string[]
video?: string
location?: LocationTag
hashtags: string[]
mood?: string
likeCount: number
commentCount: number
isLiked?: boolean
createdAt: string
}
export interface Comment {
_id: string
postId: string
authorId: string
author?: UserProfile
content: string
createdAt: string
}
export interface Message {
_id: string
fromId: string
from?: UserProfile
toId: string
content: string
type: 'greeting' | 'text' | 'image'
isRead: boolean
createdAt: string
}
export interface NearbyUser {
userId: string
user: UserProfile
pet: Pet
distance: number
distanceText: string
isOnline: boolean
lastSeenText: string
location: GeoPoint
}
export interface TabBarItem {
pagePath: string
text: string
icon: string
activeIcon: string
selected: boolean
}
export interface AppGlobalData {
userInfo: UserProfile | null
isLoggedIn: boolean
currentLocation: GeoPoint | null
}