update Page obj
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
import Time from "../../../utils/Time";
|
||||
import config from "../../../config/index"
|
||||
import Events from "../../../utils/Events";
|
||||
import { QueryPage } from "../../../types/Model";
|
||||
|
||||
export type Journal = {
|
||||
date: string;
|
||||
@ -24,12 +25,7 @@ export enum JournalItemType {
|
||||
}
|
||||
|
||||
interface JournalData {
|
||||
page: {
|
||||
index: number;
|
||||
size: number;
|
||||
type: string;
|
||||
orderMap?: object;
|
||||
}
|
||||
page: QueryPage;
|
||||
list: Journal[];
|
||||
dateFilterMin: number;
|
||||
dateFilterMax: number;
|
||||
@ -46,9 +42,8 @@ Page({
|
||||
page: {
|
||||
index: 0,
|
||||
size: 8,
|
||||
type: "NORMAL",
|
||||
orderMap: {
|
||||
createdAt: "DESC"
|
||||
likeMap: {
|
||||
type: "NORMAL"
|
||||
}
|
||||
},
|
||||
list: [],
|
||||
@ -71,9 +66,8 @@ Page({
|
||||
page: {
|
||||
index: 0,
|
||||
size: 8,
|
||||
type: "NORMAL",
|
||||
orderMap: {
|
||||
createdAt: "DESC"
|
||||
likeMap: {
|
||||
type: "NORMAL"
|
||||
}
|
||||
},
|
||||
list: [],
|
||||
@ -181,9 +175,8 @@ Page({
|
||||
page: {
|
||||
index: this.data.page.index + 1,
|
||||
size: 8,
|
||||
type: "NORMAL",
|
||||
orderMap: {
|
||||
createdAt: "DESC"
|
||||
likeMap: {
|
||||
type: "NORMAL"
|
||||
}
|
||||
},
|
||||
list: this.data.list.concat(result),
|
||||
|
||||
@ -1,17 +1,13 @@
|
||||
// pages/main/portfolio/index.ts
|
||||
|
||||
import config from "../../../config/index";
|
||||
import { QueryPage } from "../../../types/Model";
|
||||
import Events from "../../../utils/Events";
|
||||
import Time from "../../../utils/Time";
|
||||
import { Journal, JournalItemType } from "../journal/index";
|
||||
|
||||
interface IPortfolioData {
|
||||
page: {
|
||||
index: number;
|
||||
size: number;
|
||||
type: string;
|
||||
orderMap?: object;
|
||||
}
|
||||
page: QueryPage;
|
||||
list: Journal[];
|
||||
isFetching: boolean;
|
||||
isFinished: boolean;
|
||||
@ -23,9 +19,8 @@ Page({
|
||||
page: {
|
||||
index: 0,
|
||||
size: 8,
|
||||
type: "PORTFOLIO",
|
||||
orderMap: {
|
||||
createdAt: "DESC"
|
||||
likeMap: {
|
||||
type: "PORTFOLIO"
|
||||
}
|
||||
},
|
||||
list: [],
|
||||
@ -39,9 +34,8 @@ Page({
|
||||
page: {
|
||||
index: 0,
|
||||
size: 8,
|
||||
type: "PORTFOLIO",
|
||||
orderMap: {
|
||||
createdAt: "DESC"
|
||||
likeMap: {
|
||||
type: "PORTFOLIO"
|
||||
}
|
||||
},
|
||||
list: [],
|
||||
@ -111,9 +105,8 @@ Page({
|
||||
page: {
|
||||
index: this.data.page.index + 1,
|
||||
size: 8,
|
||||
type: "PORTFOLIO",
|
||||
orderMap: {
|
||||
createdAt: "DESC"
|
||||
likeMap: {
|
||||
type: "PORTFOLIO"
|
||||
}
|
||||
},
|
||||
list: this.data.list.concat(result),
|
||||
|
||||
43
miniprogram/types/Model.ts
Normal file
43
miniprogram/types/Model.ts
Normal file
@ -0,0 +1,43 @@
|
||||
// 基本实体模型
|
||||
export type Model = {
|
||||
id?: number;
|
||||
|
||||
createdAt?: number;
|
||||
updatedAt?: number;
|
||||
deletedAt?: number;
|
||||
}
|
||||
|
||||
export type Response = {
|
||||
code: number;
|
||||
msg?: string;
|
||||
data: object;
|
||||
}
|
||||
|
||||
export type QueryPage = {
|
||||
index: number;
|
||||
size: number;
|
||||
orderMap?: { [key: string]: OrderType };
|
||||
likeMap?: { [key: string]: string | undefined | null };
|
||||
}
|
||||
|
||||
export enum OrderType {
|
||||
ASC = "ASC",
|
||||
DESC = "DESC"
|
||||
}
|
||||
|
||||
export type QueryPageResult<T> = {
|
||||
total: number;
|
||||
list: T[];
|
||||
}
|
||||
|
||||
// 携带验证码的请求体
|
||||
export type CaptchaData<T> = {
|
||||
from: string;
|
||||
captcha: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
export type KeyValue<T> = {
|
||||
key: string;
|
||||
value: T;
|
||||
}
|
||||
Reference in New Issue
Block a user