From 4253173a2a9c9e716c7ebfcfb9ac25e93bbd1171 Mon Sep 17 00:00:00 2001 From: owen Date: Mon, 6 Nov 2023 09:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6=E3=80=90?= =?UTF-8?q?=E8=BD=AE=E6=92=AD=E5=9B=BE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/Carousel/config.ts | 58 ++--- .../components/mobile/Carousel/index.vue | 86 +++---- .../components/mobile/Carousel/property.vue | 215 ++++++++++-------- src/components/DiyEditor/index.vue | 6 + src/components/UploadFile/src/UploadFile.vue | 2 +- 5 files changed, 182 insertions(+), 185 deletions(-) diff --git a/src/components/DiyEditor/components/mobile/Carousel/config.ts b/src/components/DiyEditor/components/mobile/Carousel/config.ts index 6c790186..3e74a511 100644 --- a/src/components/DiyEditor/components/mobile/Carousel/config.ts +++ b/src/components/DiyEditor/components/mobile/Carousel/config.ts @@ -1,27 +1,30 @@ -import { DiyComponent } from '@/components/DiyEditor/util' +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' /** 轮播图属性 */ export interface CarouselProperty { - // 选择模板 - swiperType: number - // 图片圆角 - borderRadius: number - // 页面边距 - pageMargin: number - // 图片边距 - imageMargin: number - // 分页类型 - pagingType: 'bullets' | 'fraction' | 'progressbar' - // 一行个数 - rowIndividual: number - // 添加图片 + // 类型:默认 | 卡片 + type: 'default' | 'card' + // 指示器样式:点 | 数字 + indicator: 'dot' | 'number' + // 是否自动播放 + autoplay: boolean + // 播放间隔 + interval: number + // 轮播内容 items: CarouselItemProperty[] + // 组件样式 + style: ComponentStyle } - +// 轮播内容属性 export interface CarouselItemProperty { - title: string + // 类型:图片 | 视频 + type: 'img' | 'video' + // 图片链接 imgUrl: string - link: string + // 视频链接 + videoUrl: string + // 跳转链接 + url: string } // 定义组件 @@ -30,15 +33,18 @@ export const component = { name: '轮播图', icon: 'system-uicons:carousel', property: { - swiperType: 0, // 选择模板 - borderRadius: 0, // 图片圆角 - pageMargin: 0, // 页面边距 - imageMargin: 0, // 图片边距 - pagingType: 'bullets', // 分页类型 - rowIndividual: 2, // 一行个数 + type: 'default', + indicator: 'dot', + autoplay: false, + interval: 3, items: [ - { imgUrl: 'https://static.iocoder.cn/mall/banner-01.jpg' }, - { imgUrl: 'https://static.iocoder.cn/mall/banner-02.jpg' } - ] as CarouselItemProperty[] + { type: 'img', imgUrl: 'https://static.iocoder.cn/mall/banner-01.jpg', videoUrl: '' }, + { type: 'img', imgUrl: 'https://static.iocoder.cn/mall/banner-02.jpg', videoUrl: '' } + ] as CarouselItemProperty[], + style: { + bgType: 'color', + bgColor: '#fff', + marginBottom: 8 + } as ComponentStyle } } as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/Carousel/index.vue b/src/components/DiyEditor/components/mobile/Carousel/index.vue index e9a0ab39..940a9a56 100644 --- a/src/components/DiyEditor/components/mobile/Carousel/index.vue +++ b/src/components/DiyEditor/components/mobile/Carousel/index.vue @@ -6,70 +6,38 @@ > - -
-
-
- -
{{ item.title }}
-
-
+
+ + + + + +
{{ currentIndex }} / {{ property.items.length }}
- - -
- -
{{ item.title }}
-
-
-
- + diff --git a/src/components/DiyEditor/components/mobile/Carousel/property.vue b/src/components/DiyEditor/components/mobile/Carousel/property.vue index acaee35f..700e0005 100644 --- a/src/components/DiyEditor/components/mobile/Carousel/property.vue +++ b/src/components/DiyEditor/components/mobile/Carousel/property.vue @@ -1,103 +1,120 @@