From bb2b7ffd034fc8abab9041be02f35d6284ebebc4 Mon Sep 17 00:00:00 2001 From: owen Date: Sun, 5 Nov 2023 22:53:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?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=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ComponentContainerProperty.vue | 15 +++-- .../components/mobile/VideoPlayer/config.ts | 37 +++++++++++++ .../components/mobile/VideoPlayer/index.vue | 30 ++++++++++ .../mobile/VideoPlayer/property.vue | 55 +++++++++++++++++++ src/components/DiyEditor/util.ts | 2 +- src/components/UploadFile/src/UploadFile.vue | 55 +++++++++++++------ 6 files changed, 169 insertions(+), 25 deletions(-) create mode 100644 src/components/DiyEditor/components/mobile/VideoPlayer/config.ts create mode 100644 src/components/DiyEditor/components/mobile/VideoPlayer/index.vue create mode 100644 src/components/DiyEditor/components/mobile/VideoPlayer/property.vue diff --git a/src/components/DiyEditor/components/ComponentContainerProperty.vue b/src/components/DiyEditor/components/ComponentContainerProperty.vue index 0cfbbe1e..5c5ed9a0 100644 --- a/src/components/DiyEditor/components/ComponentContainerProperty.vue +++ b/src/components/DiyEditor/components/ComponentContainerProperty.vue @@ -26,7 +26,7 @@ :label="data.label" :prop="data.prop" :label-width="node.level === 1 ? '80px' : '62px'" - class="tree-form-item w-full m-b-0!" + class="w-full m-b-0!" > + @@ -153,12 +154,10 @@ const handleSliderChange = (prop: string) => { diff --git a/src/components/DiyEditor/components/mobile/VideoPlayer/config.ts b/src/components/DiyEditor/components/mobile/VideoPlayer/config.ts new file mode 100644 index 00000000..30501cb8 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/VideoPlayer/config.ts @@ -0,0 +1,37 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' + +/** 视频播放属性 */ +export interface VideoPlayerProperty { + // 视频链接 + videoUrl: string + // 封面链接 + posterUrl: string + // 是否自动播放 + autoplay: boolean + // 组件样式 + style: VideoPlayerStyle +} + +// 视频播放样式 +export interface VideoPlayerStyle extends ComponentStyle { + // 视频高度 + height: number +} + +// 定义组件 +export const component = { + id: 'VideoPlayer', + name: '视频播放', + icon: 'ep:video-play', + property: { + videoUrl: '', + posterUrl: '', + autoplay: false, + style: { + bgType: 'color', + bgColor: '#fff', + marginBottom: 8, + height: 300 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/VideoPlayer/index.vue b/src/components/DiyEditor/components/mobile/VideoPlayer/index.vue new file mode 100644 index 00000000..a62dea08 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/VideoPlayer/index.vue @@ -0,0 +1,30 @@ + + + + diff --git a/src/components/DiyEditor/components/mobile/VideoPlayer/property.vue b/src/components/DiyEditor/components/mobile/VideoPlayer/property.vue new file mode 100644 index 00000000..96f317d6 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/VideoPlayer/property.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 0f246ac1..29b44cf6 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -109,7 +109,7 @@ export const PAGE_LIBS = [ 'TitleBar' ] }, - { name: '图文组件', extended: true, components: ['ImageBar', 'Carousel'] }, + { name: '图文组件', extended: true, components: ['ImageBar', 'Carousel', 'VideoPlayer'] }, { name: '商品组件', extended: true, components: ['ProductCard'] }, { name: '会员组件', diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index c8a3b972..42ed4f1d 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -33,11 +33,10 @@