123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <div class="videoTool">
- <h3 class="toolTit">视频</h3>
- <div class="toolBox">
- <div class="itemBox">
- <label>视频地址</label>
- <Upload :default-file-list="defaultVideoList" :limit-size="20" :multiple="false" :types="['mp4']" :limit="1" @change="(fileList)=>handleUploadChange(fileList,'videoUrl')" />
- <!-- <el-input v-model="activeComponent.componentContent.videoUrl" placeholder="请输入内容"></el-input>-->
- </div>
- <div class="itemBox">
- <label>覆盖页地址(APP)</label>
- <Upload :default-file-list="defaultImgList" :limit-size="20" :multiple="false" :types="['jpg','jpeg','png','gif']" :limit="1" @change="(fileList)=>handleUploadChange(fileList,'coverImg')" />
- <!-- <el-input v-model="activeComponent.componentContent.videoUrl" placeholder="请输入内容"></el-input>-->
- </div>
- <!-- <div class="itemBox">-->
- <!-- <label>文本</label>-->
- <!-- <el-input-->
- <!-- type="textarea"-->
- <!-- :rows="2"-->
- <!-- placeholder="请输入内容"-->
- <!-- resize="none"-->
- <!-- v-model="textInfo">-->
- <!-- </el-input>-->
- <!-- </div>-->
- <div class="itemBox">
- <label>标题</label>
- <el-input v-model="activeComponent.componentContent.title" maxlength="20" placeholder="请输入内容"></el-input>
- </div>
- <div class="itemBox">
- <label>正文</label>
- <quill-editor
- v-model="activeComponent.componentContent.mainBody"
- ref="myQuillEditor"
- :options="editorOption"
- @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
- @change="onEditorChange($event)">
- </quill-editor>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { quillEditor } from 'vue-quill-editor'
- import Upload from '@@/components/Upload'
- import {toolMixin} from '@@/config/mixin'
- export default {
- mixins: [toolMixin],
- name: 'videoTool',
- components: {
- quillEditor,
- Upload
- },
- mounted() {
- this.activeComponent.componentContent.videoUrl && this.defaultVideoList.push(this.activeComponent.componentContent.videoUrl)
- this.activeComponent.componentContent.coverImg && this.defaultImgList.push(this.activeComponent.componentContent.coverImg)
- },
- data () {
- return {
- defaultVideoList:[],
- defaultImgList:[],
- editorOption: {
- placeholder: '请输入',
- modules: {
- toolbar: [
- ['bold', 'italic', 'link'] // toggled buttons
- ]
- }
- }
- }
- },
- methods: {
- onEditorBlur () { // 失去焦点事件
- },
- onEditorFocus () { // 获得焦点事件
- },
- onEditorChange () { // 内容改变事件
- console.log(this.mainBody)
- },
- handleUploadChange(fileList,field){
- this.activeComponent.componentContent[field] = fileList.length>0 ? fileList[0].url :''
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .videoTool {
- padding: 20px 20px 0 20px;
- h3 {
- font-size: 18px;
- font-weight: 500;
- height: 35px;
- line-height: 35px;
- color: #333333;
- margin-bottom: 20px;
- }
- .toolBox {
- padding-bottom: 10px;
- .itemBox {
- label {
- font-size: 14px;
- color: #666666;
- height: 40px;
- line-height: 40px;
- }
- margin-bottom: 15px;
- }
- }
- ::v-deep .ql-container {
- height: 200px;
- }
- }
- </style>
|