Commit ee46a092 authored by 13841799530's avatar 13841799530

解润东20211231视频回显

parent 1c74be51
...@@ -71,7 +71,14 @@ ...@@ -71,7 +71,14 @@
</van-field> </van-field>
<van-field name="uploader2" label="视频上传" > <van-field name="uploader2" label="视频上传" >
<template #input> <template #input>
<van-uploader :before-read="beforeReadVideo" accept="video/*" multiple :max-count="5" upload-text="最多上传五个" v-model="uploaderVideo" /> <van-uploader :before-read="beforeReadVideo" accept="video/*" multiple :max-count="5" upload-text="最多上传五个" v-model="uploaderVideo">
<template #preview-cover="{ file,content }">
<div v-if="file.type.indexOf('video') !== -1" >
<video muted autoplay :src="content" style="width:80px;height:80px;object-fit:cover;"></video>
</div>
<div v-else></div>
</template>
</van-uploader>
</template> </template>
</van-field> </van-field>
<div style="margin: 0.5rem"> <div style="margin: 0.5rem">
...@@ -95,6 +102,8 @@ export default { ...@@ -95,6 +102,8 @@ export default {
data() { data() {
return { return {
/* form表单 */ /* form表单 */
videoList:[{name:'e'},{name:'ddd'}],
videourl:'',//视频预览
// problemName:'',//问题名称 // problemName:'',//问题名称
problemPosition:'',//问题位置 problemPosition:'',//问题位置
value:'',//责任单位 value:'',//责任单位
...@@ -242,6 +251,7 @@ export default { ...@@ -242,6 +251,7 @@ export default {
this.showPicker = false; this.showPicker = false;
}, },
beforeReadVideo(file) { beforeReadVideo(file) {
console.log(file)
if (file.type.indexOf('video')==-1) { if (file.type.indexOf('video')==-1) {
this.$toast.fail('请上传视频!'); this.$toast.fail('请上传视频!');
return false; return false;
......
...@@ -60,7 +60,14 @@ ...@@ -60,7 +60,14 @@
</van-field> </van-field>
<van-field name="uploader2" label="视频上传" > <van-field name="uploader2" label="视频上传" >
<template #input> <template #input>
<van-uploader :before-read="beforeReadVideo" accept="video/*" multiple :max-count="5" upload-text="最多上传五个" v-model="editObj.videos" /> <van-uploader :before-read="beforeReadVideo" accept="video/*" multiple :max-count="5" upload-text="最多上传五个" v-model="editObj.videos" >
<template #preview-cover="{ file,content }">
<div v-if="file.type.indexOf('video') !== -1" >
<video muted autoplay :src="content" style="width:80px;height:80px;object-fit:cover;"></video>
</div>
<div v-else></div>
</template>
</van-uploader>
</template> </template>
</van-field> </van-field>
<div style="margin: 0.5rem"> <div style="margin: 0.5rem">
......
...@@ -60,7 +60,14 @@ ...@@ -60,7 +60,14 @@
</van-field> </van-field>
<van-field name="uploader2" label="视频上传"> <van-field name="uploader2" label="视频上传">
<template #input> <template #input>
<van-uploader :before-read="beforeReadVideo" accept="video/*" multiple :max-count="5" upload-text="最多上传五个" v-model="editObj.videos" /> <van-uploader :before-read="beforeReadVideo" accept="video/*" multiple :max-count="5" upload-text="最多上传五个" v-model="editObj.videos" >
<template #preview-cover="{ file,content }">
<div v-if="file.type.indexOf('video') !== -1" >
<video muted autoplay :src="content" style="width:80px;height:80px;object-fit:cover;"></video>
</div>
<div v-else></div>
</template>
</van-uploader>
</template> </template>
</van-field> </van-field>
<div style="margin: 0.5rem"> <div style="margin: 0.5rem">
......
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