Commit 693214fa authored by Xuguangxing's avatar Xuguangxing

feat: 增加自由容器上传视频功能

parent 369f6095
...@@ -14,7 +14,7 @@ export const basicComponents = [ ...@@ -14,7 +14,7 @@ export const basicComponents = [
type: 'text' type: 'text'
}, },
{ {
key: 'video', key: 'freedomVideo',
name: '视频背景', name: '视频背景',
desc: '视频背景', desc: '视频背景',
type: 'upload' type: 'upload'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="upload"> <div class="upload">
<div class="upload-img" v-if="img"> <div class="upload-img" v-if="img">
<img :src="fileType === 'video' ? `${img}?vframe/jpg/offset/1` : img" v-if="isUrl"> <img :src="componentKey === 'freedomVideo' ? `${img}?vframe/jpg/offset/1` : img" v-if="isUrl">
<cr-icon :type="img" class="upload-img-none-icon" v-else /> <cr-icon :type="img" class="upload-img-none-icon" v-else />
<!-- <Icon type="image" size="20" class="upload-img-none-icon"></Icon> --> <!-- <Icon type="image" size="20" class="upload-img-none-icon"></Icon> -->
<div class="upload-img-cover"> <div class="upload-img-cover">
...@@ -32,6 +32,10 @@ ...@@ -32,6 +32,10 @@
showInput: { showInput: {
type: Boolean, type: Boolean,
default: true default: true
},
componentKey: {
type: String,
default: ''
} }
}, },
data() { data() {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</FormItem> </FormItem>
</div> </div>
<FormItem class="Df-component-formitem" v-else :label="item.name" :title="item.desc || ''"> <FormItem class="Df-component-formitem" v-else :label="item.name" :title="item.desc || ''">
<component :hide3Column="curElement.name === 'cs-discount' && item.key ==='column'" :is="getComponent(item.type)" :options="item.options" :formControl="item.formControl" :limit-name="item.type === 'ComponentSelect' && curElement.name === 'cs-goods-tabs' ? 'cs-goods' : ''" v-model="form[item.key]" /> <component :componentKey="item.key" :hide3Column="curElement.name === 'cs-discount' && item.key ==='column'" :is="getComponent(item.type)" :options="item.options" :formControl="item.formControl" :limit-name="item.type === 'ComponentSelect' && curElement.name === 'cs-goods-tabs' ? 'cs-goods' : ''" v-model="form[item.key]" />
</FormItem> </FormItem>
</template> </template>
</Form> </Form>
......
<template> <template>
<div class="freedom" :ref="`freedomContainer${containerIndex}`" @click.stop="handleElementClick(containerIndex)"> <div class="freedom" :ref="`freedomContainer${containerIndex}`" @click.stop="handleElementClick(containerIndex)">
<video width="100%" @loadeddata="videoOnload" ref="videoBackground" height="auto" style="position: absolute; top: 0; left: 0" v-if="childItem.props.video" :src="childItem.props.video" autoplay loop muted />
<div class="freedom-body" :data-index="containerIndex"> <div class="freedom-body" :data-index="containerIndex">
<video width="100%" @loadeddata="videoOnload" ref="videoBackground" height="auto" style="z-index: -10; osition: absolute; top: 0; left: 0" v-if="childItem.props.freedomVideo" :src="childItem.props.freedomVideo" autoplay loop muted />
<div v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle, 'container')" :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" :key="index" @click.stop="handleElementClick(containerIndex, index)" @mousedown.stop.prevent="mousedown(index, $event)" @contextmenu.prevent.stop="show($event, containerIndex, index)"> <div v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle, 'container')" :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" :key="index" @click.stop="handleElementClick(containerIndex, index)" @mousedown.stop.prevent="mousedown(index, $event)" @contextmenu.prevent.stop="show($event, containerIndex, index)">
<component ref="childComponent" :style="transformStyle(item.commonStyle, 'component')" :is="item.name" v-bind="item.props"></component> <component ref="childComponent" :style="transformStyle(item.commonStyle, 'component')" :is="item.name" v-bind="item.props"></component>
<div class="freedom-body-dot" <div class="freedom-body-dot"
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment