feat: 完成网站前端的基本建设
- 网站内容展示:首页, 产品页, 解决方案, 联系信息等 - 网站跳转逻辑:通过Vue-Router实现路由跳转 - 后端通信: 通过Nuxt Strapi与后端Strapi服务进行通信
This commit is contained in:
49
app/types/strapi/common.ts
Normal file
49
app/types/strapi/common.ts
Normal file
@ -0,0 +1,49 @@
|
||||
export interface StrapiEntity {
|
||||
id: number;
|
||||
documentId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
publishedAt: string;
|
||||
locale: string;
|
||||
}
|
||||
|
||||
export interface StrapiMedia {
|
||||
id: number;
|
||||
url: string;
|
||||
ext: string;
|
||||
name: string;
|
||||
size: number;
|
||||
alternativeText: string;
|
||||
caption: string;
|
||||
}
|
||||
|
||||
export interface StrapiImageFormat {
|
||||
url: string;
|
||||
width: number;
|
||||
height: number;
|
||||
size: number;
|
||||
}
|
||||
|
||||
export interface StrapiImage extends StrapiMedia {
|
||||
width: number;
|
||||
height: number;
|
||||
formats: {
|
||||
small: StrapiImageFormat;
|
||||
medium: StrapiImageFormat;
|
||||
thumbnail: StrapiImageFormat;
|
||||
}
|
||||
}
|
||||
|
||||
export interface StrapiResponse<T> {
|
||||
data: T;
|
||||
meta: {
|
||||
pagination: {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
pageCount: number;
|
||||
total: number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type StrapiRelation<T, K extends keyof T = never> = Omit<T, K | keyof StrapiEntity> & StrapiEntity;
|
||||
5
app/types/strapi/index.ts
Normal file
5
app/types/strapi/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export * from './common';
|
||||
export * from './production';
|
||||
export * from './singleTypes';
|
||||
export * from './solution';
|
||||
export * from './question';
|
||||
33
app/types/strapi/production.ts
Normal file
33
app/types/strapi/production.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import type { StrapiEntity, StrapiImage, StrapiMedia, StrapiRelation } from './common';
|
||||
|
||||
export interface ProductionType extends StrapiEntity {
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface ProductionSpecItem {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface ProductionSpecGroup {
|
||||
title: string;
|
||||
items: ProductionSpecItem[];
|
||||
}
|
||||
|
||||
export interface Production extends StrapiEntity {
|
||||
title: string;
|
||||
summary: string;
|
||||
production_type: ProductionType;
|
||||
cover: StrapiImage;
|
||||
production_images: StrapiImage[];
|
||||
production_details: string;
|
||||
production_specs: ProductionSpecGroup[];
|
||||
production_documents: StrapiRelation<ProductionDocument, 'related_productions'>[];
|
||||
questions: StrapiRelation<Question, 'related_productions'>[];
|
||||
show_in_production_list: boolean;
|
||||
}
|
||||
|
||||
export interface ProductionDocument extends StrapiEntity {
|
||||
document: StrapiMedia;
|
||||
related_productions: StrapiRelation<Production, 'production_documents'>[];
|
||||
}
|
||||
5
app/types/strapi/question.ts
Normal file
5
app/types/strapi/question.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export interface Question extends StrapiEntity {
|
||||
title: string;
|
||||
content: string;
|
||||
related_productions: StrapiRelation<Production, 'questions'>[];
|
||||
}
|
||||
12
app/types/strapi/singleTypes.ts
Normal file
12
app/types/strapi/singleTypes.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export interface StrapiCompanyProfile extends StrapiEntity {
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface StrapiContactInfo extends StrapiEntity {
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface StrapiHomepage extends StrapiEntity {
|
||||
carousel: StrapiImage[];
|
||||
recommend_productions: StrapiRelation<Production>[];
|
||||
}
|
||||
13
app/types/strapi/solution.ts
Normal file
13
app/types/strapi/solution.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import type { StrapiEntity, StrapiImage } from './common';
|
||||
|
||||
export interface SolutionType extends StrapiEntity {
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface Solution extends StrapiEntity {
|
||||
title: string;
|
||||
summary: string;
|
||||
cover: StrapiImage;
|
||||
solution_type: SolutionType;
|
||||
content: string;
|
||||
}
|
||||
Reference in New Issue
Block a user