2025/9/26/1:02
This commit is contained in:
51
typings/index.d.ts
vendored
51
typings/index.d.ts
vendored
@@ -1,9 +1,58 @@
|
||||
/// <reference path="./types/index.d.ts" />
|
||||
|
||||
export interface VoteOption {
|
||||
id: number;
|
||||
name: string;
|
||||
votes: number;
|
||||
is_voted: boolean;
|
||||
percentage?: number;
|
||||
isSelected?: boolean;
|
||||
}
|
||||
|
||||
export interface CardData {
|
||||
article_id: number;
|
||||
article_title: string;
|
||||
vote_type: 'single' | 'multiple';
|
||||
total_voters: number;
|
||||
end_time: string;
|
||||
is_ended: boolean;
|
||||
publisher_id: string;
|
||||
create_time: string;
|
||||
options: VoteOption[];
|
||||
user_has_voted: boolean;
|
||||
user_voted_option_ids: number[] | null;
|
||||
}
|
||||
|
||||
|
||||
export interface Comment {
|
||||
id: number;
|
||||
article_id: number;
|
||||
parent_id: number;
|
||||
content: string;
|
||||
likes_count: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
username: string;
|
||||
avatar_url: string;
|
||||
replies?: Comment[]; // 子评论可选
|
||||
}
|
||||
|
||||
export interface CommentResponse {
|
||||
data: Comment[];
|
||||
message: string;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
|
||||
interface IAppOption {
|
||||
globalData: {
|
||||
userInfo?: WechatMiniprogram.CustomUserInfo | null,
|
||||
token: string
|
||||
token: string,
|
||||
rawCardData:CardData[],
|
||||
processedCardsData:CardData[]
|
||||
}
|
||||
userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback,
|
||||
processVoteData(rawData: CardData[]): CardData[],
|
||||
fetchRawCardData():void,
|
||||
getComments(articleId: number):Comment[]
|
||||
}
|
||||
Reference in New Issue
Block a user