Commit d332ef57 authored by Jeff's avatar Jeff

更新规则

parent 780a265f
......@@ -10,7 +10,7 @@ module.exports = {
// 3: ESLint + Standard config
// extends: [ 'plugin:vue/essential', '@vue/airbnb',],
// ESLint + Prettier
extends: ['plugin:vue/essential', 'eslint:recommended'],
extends: ['plugin:vue/recommended', 'eslint:recommended'],
plugins: [],
parserOptions: {
parser: 'babel-eslint'
......
<template>
<div class="video-control">
<div
class="video-play-btn"
@click="play()">
class="video-play-btn"
@click="play()"
>
播放
</div>
<div class="video-time-content">
......@@ -18,15 +19,6 @@ class="video-play-btn"
</template>
<script>
export default {
data() {
return {}
},
props: ['duration', 'nowTime'],
methods: {
play() {
this.$emit('play')
}
},
filters: {
formatTime(duration) {
if (duration <= 0) return '00:00'
......@@ -39,6 +31,15 @@ export default {
sec = sec || '00'
return min + ':' + sec
}
},
props: ['duration', 'nowTime'], // eslint-disable-line
data() {
return {}
},
methods: {
play() {
this.$emit('play')
}
}
}
</script>
......
......@@ -33,6 +33,10 @@ export default {
})
})
},
beforeDestroy() {
this.$refs.videoDom.removeEventListener('canplay')
this.$refs.videoDom.removeEventListener('ended')
},
methods: {
canPlayFunc() {
this.canPlay = true
......@@ -52,10 +56,6 @@ export default {
if (!this.canPlay) return
this.$refs.videoDom.currentTime = time
}
},
beforeDestroy() {
this.$refs.videoDom.removeEventListener('canplay')
this.$refs.videoDom.removeEventListener('ended')
}
}
</script>
......
......@@ -2,10 +2,13 @@
<div class="videoConverter">
<ul>
<li
v-for="(item, index) in taskList"
:key="index">
v-for="(item, index) in taskList"
:key="index"
>
<div class="info">
<div class="cove">视频封面</div>
<div class="cove">
视频封面
</div>
<div>
<div>{{ item.name }}.mp4</div>
<div>时长:{{ item.duration }}</div>
......@@ -13,27 +16,37 @@ v-for="(item, index) in taskList"
</div>
<div class="operationPanel">
<div
class="wait"
v-show="item.state == 0">
v-show="item.state == 0"
class="wait"
>
<div>输出格式</div>
<div class="selectionFormat">mp4</div>
<div class="selectionFormat">
mp4
</div>
<div
class="delete"
@click="clearTask(item)">删除</div>
class="delete"
@click="clearTask(item)"
>
删除
</div>
</div>
<div
class="active"
v-show="item.state == 1">
v-show="item.state == 1"
class="active"
>
<div class="progress">
<div>转换中{{ item.progress }}%</div>
<div class="slide">
<div></div>
<div />
</div>
</div>
<div
class="stop"
@click="stopTask(item)">取消</div>
class="stop"
@click="stopTask(item)"
>
取消
</div>
</div>
</div>
</li>
......@@ -41,17 +54,28 @@ class="stop"
<div class="editBar">
<div
class="addVideo"
@click="addVideo">添加视频</div>
class="addVideo"
@click="addVideo"
>
添加视频
</div>
<div
class="clearList"
@click="clearAllTasks">清空列表</div>
<div class="clearWatermark">去除水印</div>
class="clearList"
@click="clearAllTasks"
>
清空列表
</div>
<div class="clearWatermark">
去除水印
</div>
</div>
<div
class="startAll"
@click="startAllTasks">开始转换</div>
class="startAll"
@click="startAllTasks"
>
开始转换
</div>
</div>
</template>
......@@ -67,6 +91,18 @@ export default {
},
computed: {},
watch: {},
created() {
for (let i = 1; i < 10; i++) {
this.taskList.push({
cover: '',
name: '视频片段' + i,
duration: '10:00',
state: 0,
progress: 60,
outputFormat: 'mp4'
})
}
},
methods: {
addVideo() {
this.taskList.push({
......@@ -95,18 +131,6 @@ export default {
task.state = 1
})
}
},
created() {
for (let i = 1; i < 10; i++) {
this.taskList.push({
cover: '',
name: '视频片段' + i,
duration: '10:00',
state: 0,
progress: 60,
outputFormat: 'mp4'
})
}
}
}
</script>
......
......@@ -31,12 +31,12 @@ import VideoChange from '@/components/videoCutter/videoChange.vue'
import VideoControl from '@/components/videoCutter/videoControl.vue'
export default {
name: 'VideoCutter',
components: {
VideoPlayer,
VideoChange,
VideoControl
},
name: 'VideoCutter',
data() {
return {
name: '',
......
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