From a8b11c2b06297bba15dee039bb48cc6c9a4935f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=A3=AE?= Date: Wed, 5 Nov 2025 17:11:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/business/bizcard.tsx | 48 +++++++++++++++++++++++++++ app/components/business/button.tsx | 7 ++++ app/components/business/grids.tsx | 7 ++++ app/components/business/image.tsx | 16 +++++++++ app/components/business/index.ts | 9 +++++ app/components/business/list.tsx | 7 ++++ app/components/business/meida.tsx | 7 ++++ app/components/business/noticebar.tsx | 35 +++++++++++++++++++ app/components/business/swiper.tsx | 12 +++++++ app/components/business/video.tsx | 7 ++++ app/components/layout/Layout.tsx | 7 ++-- app/pages/index/index.tsx | 24 ++++++++------ app/styles/tailwind.basic.css | 8 ++++- types/types.d.ts | 6 ++++ 14 files changed, 185 insertions(+), 15 deletions(-) create mode 100644 app/components/business/bizcard.tsx create mode 100644 app/components/business/button.tsx create mode 100644 app/components/business/grids.tsx create mode 100644 app/components/business/image.tsx create mode 100644 app/components/business/index.ts create mode 100644 app/components/business/list.tsx create mode 100644 app/components/business/meida.tsx create mode 100644 app/components/business/noticebar.tsx create mode 100644 app/components/business/swiper.tsx create mode 100644 app/components/business/video.tsx create mode 100644 types/types.d.ts diff --git a/app/components/business/bizcard.tsx b/app/components/business/bizcard.tsx new file mode 100644 index 0000000..4367eea --- /dev/null +++ b/app/components/business/bizcard.tsx @@ -0,0 +1,48 @@ +/** + * 电子名片组件 + * ========================================= + * 1. 纯卡片风格 + * 2. 卡片+图片风格 + * 3. 纯图片风格 + * 4. 图片背景风格 + * ========================================= + **/ +import { View, Text } from "@tarojs/components"; +import { memo } from "react"; + +interface BizCardProps { + title: string; + userInfo: User; +} + +export const BizCardTpl_01 = memo(({ userInfo }: BizCardProps) => { + return ( + + {userInfo.name} + + ); +}); + +export const BizCardTpl_02 = memo(() => { + return ( + + Card Title + + ); +}); + +export const BizCardTpl_03 = memo(() => { + return ( + + Card Title + + ); +}); + +export const BizCardTpl_04 = memo(() => { + return ( + + Card Title + + ); +}); diff --git a/app/components/business/button.tsx b/app/components/business/button.tsx new file mode 100644 index 0000000..adf9629 --- /dev/null +++ b/app/components/business/button.tsx @@ -0,0 +1,7 @@ +import { View } from "@tarojs/components"; +import { memo } from "react"; + +// 按钮组件 +export const ButtonTpl = memo(() => { + return ; +}); diff --git a/app/components/business/grids.tsx b/app/components/business/grids.tsx new file mode 100644 index 0000000..35100ce --- /dev/null +++ b/app/components/business/grids.tsx @@ -0,0 +1,7 @@ +import { View } from "@tarojs/components"; +import { memo } from "react"; + +// 宫格组件 +export const GridsTpl = memo(() => { + return ; +}); diff --git a/app/components/business/image.tsx b/app/components/business/image.tsx new file mode 100644 index 0000000..efed1c7 --- /dev/null +++ b/app/components/business/image.tsx @@ -0,0 +1,16 @@ +import { View, Image } from "@tarojs/components"; +import { memo } from "react"; + +interface Props { + src: string; + size: "small" | "medium" | "large" | "raw"; +} + +export const ImageTpl = memo(({ src, size }: Props) => { + console.log(size); + return ( + + + + ); +}); diff --git a/app/components/business/index.ts b/app/components/business/index.ts new file mode 100644 index 0000000..451e5f2 --- /dev/null +++ b/app/components/business/index.ts @@ -0,0 +1,9 @@ +export * from "./bizcard"; +export * from "./noticebar"; +export * from "./swiper"; +export * from "./image"; +export * from "./button"; +export * from "./meida"; +export * from "./grids"; +export * from "./list"; +export * from "./video"; diff --git a/app/components/business/list.tsx b/app/components/business/list.tsx new file mode 100644 index 0000000..092be21 --- /dev/null +++ b/app/components/business/list.tsx @@ -0,0 +1,7 @@ +import { View } from "@tarojs/components"; +import { memo } from "react"; + +// 列表组件 +export const ListTpl = memo(() => { + return ; +}); diff --git a/app/components/business/meida.tsx b/app/components/business/meida.tsx new file mode 100644 index 0000000..0bc97eb --- /dev/null +++ b/app/components/business/meida.tsx @@ -0,0 +1,7 @@ +import { View } from "@tarojs/components"; +import { memo } from "react"; + +// 图文组件 +export const MeidaImageTpl = memo(() => { + return ; +}); diff --git a/app/components/business/noticebar.tsx b/app/components/business/noticebar.tsx new file mode 100644 index 0000000..ed0885e --- /dev/null +++ b/app/components/business/noticebar.tsx @@ -0,0 +1,35 @@ +/** + * 公告组件 + * ========================================= + * 1. 横向单行文本 + * 2. 横向滚动文本 + * 3. 竖向滚动多行文本 + * ========================================= + **/ + +import { View, Text } from "@tarojs/components"; +import { memo } from "react"; + +export const NoticeBarTpl_01 = memo(() => { + return ( + + 公告内容 + + ); +}); + +export const NoticeBarTpl_02 = memo(() => { + return ( + + 公告内容 + + ); +}); + +export const NoticeBarTpl_03 = memo(() => { + return ( + + 公告内容 + + ); +}); diff --git a/app/components/business/swiper.tsx b/app/components/business/swiper.tsx new file mode 100644 index 0000000..29ddc9e --- /dev/null +++ b/app/components/business/swiper.tsx @@ -0,0 +1,12 @@ +import { Swiper, SwiperItem, View } from "@tarojs/components"; +import { memo } from "react"; + +export const SwiperTpl = memo(() => { + return ( + + + 1 + + + ); +}); diff --git a/app/components/business/video.tsx b/app/components/business/video.tsx new file mode 100644 index 0000000..2a1ea2d --- /dev/null +++ b/app/components/business/video.tsx @@ -0,0 +1,7 @@ +import { Video } from "@tarojs/components"; +import { memo } from "react"; + +// 视频组件 +export const VideoTpl = memo(() => { + return