- 删除未使用的空组件目录、死代码导出(clearAuth/calcDistance/COLORS/ AVATAR_GRADIENTS/Message/TabBarItem/deletePost/uploadImage/getFileURL/ _initLogin),确保程序仍可正常运行 - 新增 8 个云函数并补全对应页面逻辑:getMessages/sendMessage(私信聊天)、 getHotTopics/searchPosts/searchUsers(搜索)、getStory(故事,复用 posts 集合)、getNotifications/markAllRead(基于点赞评论聚合的通知系统) - 在 cloudbaserc.json 中注册全部新云函数,并通过 --deployMode zip 完成部署 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
98 lines
1.6 KiB
TypeScript
98 lines
1.6 KiB
TypeScript
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 NearbyUser {
|
|
userId: string
|
|
user: UserProfile
|
|
pet: Pet
|
|
distance: number
|
|
distanceText: string
|
|
isOnline: boolean
|
|
lastSeenText: string
|
|
location: GeoPoint
|
|
}
|
|
|
|
export interface NavBarInfo {
|
|
statusBarHeight: number
|
|
navbarHeight: number
|
|
navbarPaddingRight: number
|
|
}
|
|
|
|
export interface AppGlobalData {
|
|
userInfo: UserProfile | null
|
|
isLoggedIn: boolean
|
|
currentLocation: GeoPoint | null
|
|
navBarInfo: NavBarInfo
|
|
_locationTimer: number | null
|
|
}
|