|
|
|
|
@ -85,6 +85,8 @@
|
|
|
|
|
:on-success="handleOpenSourceFileSuccess"
|
|
|
|
|
:headers="upload.headers"
|
|
|
|
|
:file-list="fileOpenSourceList"
|
|
|
|
|
:before-upload="limitFileType"
|
|
|
|
|
accept=".jpeg,.jpg,.png,.svg,.mp4,.avi,.mov,.rmvb,.rm,.flv,.3gp,.GIF,.gif"
|
|
|
|
|
>
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传视频/图片文件,且不超过50M</div>
|
|
|
|
|
@ -246,7 +248,29 @@
|
|
|
|
|
<el-button type="primary" @click="showOpenSource">添加弹窗</el-button>
|
|
|
|
|
<el-table :data="openSourceData" style="width: 100%" max-height="250">
|
|
|
|
|
<el-table-column prop="openTitle" label="弹窗标题" width="150" />
|
|
|
|
|
<el-table-column prop="openSourceName" label="弹出视频/图片" width="120" />
|
|
|
|
|
<el-table-column prop="openSourceName" label="弹出视频/图片" width="120" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<template
|
|
|
|
|
v-if="scope.row.openSourceSuffix === 'gif'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'GIF'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'png'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'PNG'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'jpeg'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'JPEG'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'jpg'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'JPG'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'svg'
|
|
|
|
|
|| scope.row.openSourceSuffix === 'SVG'
|
|
|
|
|
">
|
|
|
|
|
<ImagePreview :src="scope.row.openSourceUrl" />
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div style="width: 80px; height: 80px">
|
|
|
|
|
<video style="width: 100%; height: 100%" :src="scope.row.openSourceUrl"></video>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="openSourceSuffix" label="类型" width="120" />
|
|
|
|
|
<el-table-column prop="openContent" label="提示内容" width="120" />
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="120">
|
|
|
|
|
@ -752,6 +776,16 @@ export default {
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
limitFileType(file) {
|
|
|
|
|
const imageType = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg', ['image/jpeg', 'image/jpg', 'image/png', 'image/svg', 'video/mp4','video/avi','video/mov','video/rmvb','video/rm','video/flv','video/3gp']]
|
|
|
|
|
let isVideo = imageType.includes(file.type)
|
|
|
|
|
// 检验文件格式
|
|
|
|
|
if (!isVideo) {
|
|
|
|
|
this.$message.error(`文件格式错误!`)
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
limitImageFileType(file) {
|
|
|
|
|
const imageType = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg']
|
|
|
|
|
let isVideo = imageType.includes(file.type)
|
|
|
|
|
|