template-project/pagesA/yy-video/yy-video.vue

64 lines
1.4 KiB
Vue
Raw Normal View History

<template>
<view>
<status-container titlet="视频">
<view slot="content">
<column-function :list="list" @chooseEv="chooseEv"></column-function>
</view>
</status-container>
</view>
</template>
<script>
import columnFunction from '@/components/function-list/column/column-function.vue';
import videoTools from '@/jsFile/video/yy-video.js';
export default {
components:{
columnFunction
},
data() {
return {
list:[
{url:'',title:'单选视频',iconsrc:'',iconWidth:60,iconHeight:60,content:'',contentColor:'#999999',ifNext:true},
{url:'',title:'选择视频并压缩视频',iconsrc:'',iconWidth:60,iconHeight:60,content:'',contentColor:'#999999',ifNext:true},
{url:'',title:'预览视频',iconsrc:'',iconWidth:60,iconHeight:60,content:'',contentColor:'#999999',ifNext:true},
],
videoArr:[]
}
},
methods: {
chooseEv(obj) {
switch (obj.index){
case 0:
videoTools.chooseVideo().then(res=>{
console.log(res,30);
let obj = {
url:res.path,
type:'video',
poster:''
}
this.videoArr.push(obj);
});
break;
case 1:
videoTools.chooseCompressVideo().then(res=>{
console.log(res,30);
});
break;
case 2:
console.log(this.videoArr)
uni.previewMedia({
current:1,
sources:this.videoArr
})
// videoTools.previewVideo(1,this.videoArr)
break;
}
}
}
}
</script>
<style>
</style>