Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mould-vuecli3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lhfe
mould-vuecli3
Commits
41c24d83
Commit
41c24d83
authored
Aug 27, 2020
by
Jeff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新规则
parent
d332ef57
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
339 additions
and
349 deletions
+339
-349
.editorconfig
.editorconfig
+1
-1
.eslintrc.js
.eslintrc.js
+2
-12
App.vue
src/App.vue
+13
-13
index.vue
src/components/header/index.vue
+12
-12
tipPanel.vue
src/components/header/tipPanel.vue
+5
-5
tutorialContent.vue
src/components/misc/tutorialContent.vue
+4
-4
completeContent.vue
src/components/modal/completeContent.vue
+4
-4
completeModal.vue
src/components/modal/completeModal.vue
+7
-7
modalLayer.vue
src/components/modal/modalLayer.vue
+8
-8
selectContent.vue
src/components/modal/selectContent.vue
+7
-7
selectModal.vue
src/components/modal/selectModal.vue
+7
-7
index.vue
src/components/rightPanel/index.vue
+5
-5
screenshotPanel.vue
src/components/rightPanel/screenshotPanel.vue
+5
-5
index.vue
src/components/sideNav/index.vue
+5
-5
videoChange.vue
src/components/videoCutter/videoChange.vue
+4
-4
videoControl.vue
src/components/videoCutter/videoControl.vue
+20
-20
videoPlayer.vue
src/components/videoCutter/videoPlayer.vue
+45
-45
main.js
src/main.js
+3
-3
registerServiceWorker.js
src/registerServiceWorker.js
+23
-23
index.js
src/router/index.js
+32
-32
global.js
src/store/global.js
+6
-6
index.js
src/store/index.js
+4
-4
moduleA.js
src/store/modules/moduleA.js
+7
-7
bao2.vue
src/views/bao2.vue
+5
-5
bao3.vue
src/views/bao3.vue
+5
-5
screenshot.vue
src/views/screenshot.vue
+8
-8
videoConverter.vue
src/views/videoConverter.vue
+48
-48
videoCutter.vue
src/views/videoCutter.vue
+44
-44
No files found.
.editorconfig
View file @
41c24d83
...
...
@@ -11,7 +11,7 @@ charset = utf-8
indent_style = space
#缩进数量可选整数值2 or 4,或者tab
indent_size =
4
indent_size =
2
#换行符的格式 换行符,lf、cr和crlf
end_of_line = lf
...
...
.eslintrc.js
View file @
41c24d83
...
...
@@ -30,23 +30,13 @@ module.exports = {
'no-debugger'
:
process
.
env
.
NODE_ENV
===
'production'
?
'warn'
:
'off'
,
indent
:
[
'error'
,
4
,
2
,
{
SwitchCase
:
1
,
flatTernaryExpressions
:
true
}
],
'comma-dangle'
:
[
'error'
,
'never'
],
quotes
:
[
'error'
,
'single'
],
'vue/max-attributes-per-line'
:
[
'error'
,
{
singleline
:
1
,
multiline
:
{
max
:
1
,
allowFirstLine
:
false
}
}
]
quotes
:
[
'error'
,
'single'
]
}
}
src/App.vue
View file @
41c24d83
...
...
@@ -14,19 +14,19 @@
import
CommonHeader
from
'@/components/header/index.vue'
import
ModalLayer
from
'@/components/modal/modalLayer.vue'
export
default
{
components
:
{
CommonHeader
,
ModalLayer
,
SideNav
:
()
=>
import
(
'@/components/sideNav/index.vue'
),
RightPanel
:
()
=>
import
(
'@/components/rightPanel/index.vue'
)
},
data
()
{
return
{}
},
async
created
()
{
let
result
=
await
this
.
$http
.
get
(
'/webapi/home/banner?type=1&category=18'
)
console
.
log
(
'result:'
,
result
)
}
components
:
{
CommonHeader
,
ModalLayer
,
SideNav
:
()
=>
import
(
'@/components/sideNav/index.vue'
),
RightPanel
:
()
=>
import
(
'@/components/rightPanel/index.vue'
)
},
data
()
{
return
{}
},
async
created
()
{
let
result
=
await
this
.
$http
.
get
(
'/webapi/home/banner?type=1&category=18'
)
console
.
log
(
'result:'
,
result
)
}
}
</
script
>
...
...
src/components/header/index.vue
View file @
41c24d83
...
...
@@ -16,19 +16,19 @@
<
script
>
export
default
{
components
:
{
tipPanel
:
()
=>
import
(
'@/components/header/tipPanel.vue'
)
},
data
()
{
return
{}
},
created
()
{},
mounted
()
{},
methods
:
{
showModal
()
{
this
.
$modal
.
show
(
'selectModal'
)
}
components
:
{
tipPanel
:
()
=>
import
(
'@/components/header/tipPanel.vue'
)
},
data
()
{
return
{}
},
created
()
{},
mounted
()
{},
methods
:
{
showModal
()
{
this
.
$modal
.
show
(
'selectModal'
)
}
}
}
</
script
>
...
...
src/components/header/tipPanel.vue
View file @
41c24d83
...
...
@@ -6,11 +6,11 @@
<
script
>
export
default
{
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
}
</
script
>
...
...
src/components/misc/tutorialContent.vue
View file @
41c24d83
...
...
@@ -4,10 +4,10 @@
<
script
>
export
default
{
data
()
{
return
{}
},
methods
:
{}
data
()
{
return
{}
},
methods
:
{}
}
</
script
>
...
...
src/components/modal/completeContent.vue
View file @
41c24d83
...
...
@@ -6,10 +6,10 @@
<
script
>
export
default
{
data
()
{
return
{}
},
methods
:
{}
data
()
{
return
{}
},
methods
:
{}
}
</
script
>
...
...
src/components/modal/completeModal.vue
View file @
41c24d83
...
...
@@ -10,13 +10,13 @@
<
script
>
import
CompleteContent
from
'./completeContent'
export
default
{
components
:
{
CompleteContent
},
data
()
{
return
{}
},
methods
:
{}
components
:
{
CompleteContent
},
data
()
{
return
{}
},
methods
:
{}
}
</
script
>
...
...
src/components/modal/modalLayer.vue
View file @
41c24d83
...
...
@@ -9,14 +9,14 @@
import
CompleteModal
from
'@/components/modal/completeModal'
import
SelectModal
from
'@/components/modal/selectModal'
export
default
{
components
:
{
CompleteModal
,
SelectModal
},
data
()
{
return
{}
},
methods
:
{}
components
:
{
CompleteModal
,
SelectModal
},
data
()
{
return
{}
},
methods
:
{}
}
</
script
>
...
...
src/components/modal/selectContent.vue
View file @
41c24d83
...
...
@@ -12,14 +12,14 @@
<
script
>
export
default
{
data
()
{
return
{}
},
methods
:
{
close
()
{
this
.
$modal
.
hide
(
'selectModal'
)
}
data
()
{
return
{}
},
methods
:
{
close
()
{
this
.
$modal
.
hide
(
'selectModal'
)
}
}
}
</
script
>
...
...
src/components/modal/selectModal.vue
View file @
41c24d83
...
...
@@ -10,13 +10,13 @@
<
script
>
import
SelectContent
from
'./selectContent'
export
default
{
components
:
{
SelectContent
},
data
()
{
return
{}
},
methods
:
{}
components
:
{
SelectContent
},
data
()
{
return
{}
},
methods
:
{}
}
</
script
>
...
...
src/components/rightPanel/index.vue
View file @
41c24d83
...
...
@@ -6,11 +6,11 @@
<
script
>
export
default
{
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
}
</
script
>
...
...
src/components/rightPanel/screenshotPanel.vue
View file @
41c24d83
...
...
@@ -6,11 +6,11 @@
<
script
>
export
default
{
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
}
</
script
>
...
...
src/components/sideNav/index.vue
View file @
41c24d83
...
...
@@ -20,11 +20,11 @@
<
script
>
export
default
{
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
}
</
script
>
...
...
src/components/videoCutter/videoChange.vue
View file @
41c24d83
...
...
@@ -8,11 +8,11 @@
</
template
>
<
script
>
export
default
{
methods
:
{
changeVideo
()
{
this
.
$emit
(
'changeVideo'
)
}
methods
:
{
changeVideo
()
{
this
.
$emit
(
'changeVideo'
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/components/videoCutter/videoControl.vue
View file @
41c24d83
...
...
@@ -19,28 +19,28 @@
</
template
>
<
script
>
export
default
{
filters
:
{
formatTime
(
duration
)
{
if
(
duration
<=
0
)
return
'00:00'
if
(
!
duration
)
return
'--:--'
let
min
=
~~
(
duration
/
60
)
min
=
(
min
+
''
).
length
===
1
?
'0'
+
min
:
min
let
sec
=
Math
.
floor
(
duration
%
60
)
sec
=
(
sec
+
''
).
length
===
1
?
'0'
+
sec
:
sec
min
=
min
||
'00'
sec
=
sec
||
'00'
return
min
+
':'
+
sec
}
},
filters
:
{
formatTime
(
duration
)
{
if
(
duration
<=
0
)
return
'00:00'
if
(
!
duration
)
return
'--:--'
let
min
=
~~
(
duration
/
60
)
min
=
(
min
+
''
).
length
===
1
?
'0'
+
min
:
min
let
sec
=
Math
.
floor
(
duration
%
60
)
sec
=
(
sec
+
''
).
length
===
1
?
'0'
+
sec
:
sec
min
=
min
||
'00'
sec
=
sec
||
'00'
return
min
+
':'
+
sec
}
},
props
:
[
'duration'
,
'nowTime'
],
// eslint-disable-line
data
()
{
return
{}
},
methods
:
{
play
()
{
this
.
$emit
(
'play'
)
}
data
()
{
return
{}
},
methods
:
{
play
()
{
this
.
$emit
(
'play'
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/components/videoCutter/videoPlayer.vue
View file @
41c24d83
...
...
@@ -8,55 +8,55 @@
</
template
>
<
script
>
export
default
{
data
()
{
return
{
state
:
'pluse'
,
times
:
0
,
canPlay
:
false
}
data
()
{
return
{
state
:
'pluse'
,
times
:
0
,
canPlay
:
false
}
},
mounted
()
{
this
.
$bus
.
on
(
'videoPlayer.play'
,
(
data
)
=>
{
if
(
data
.
time
!==
undefined
)
{
this
.
currentTime
(
data
.
time
)
}
if
(
data
.
play
)
{
this
.
play
()
}
else
{
this
.
pause
()
}
})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
videoDom
.
addEventListener
(
'canplay'
,
this
.
canPlayFunc
)
this
.
$refs
.
videoDom
.
addEventListener
(
'ended'
,
()
=>
{
this
.
$emit
(
'ended'
)
})
})
},
beforeDestroy
()
{
this
.
$refs
.
videoDom
.
removeEventListener
(
'canplay'
)
this
.
$refs
.
videoDom
.
removeEventListener
(
'ended'
)
},
methods
:
{
canPlayFunc
()
{
this
.
canPlay
=
true
let
from
=
this
.
$parent
.
$options
.
name
||
'videoPlayer'
this
.
$bus
.
emit
(
`
${
from
}
.canPlay`
,
this
.
$refs
.
videoDom
.
duration
)
},
mounted
()
{
this
.
$bus
.
on
(
'videoPlayer.play'
,
(
data
)
=>
{
if
(
data
.
time
!==
undefined
)
{
this
.
currentTime
(
data
.
time
)
}
if
(
data
.
play
)
{
this
.
play
()
}
else
{
this
.
pause
()
}
})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
videoDom
.
addEventListener
(
'canplay'
,
this
.
canPlayFunc
)
this
.
$refs
.
videoDom
.
addEventListener
(
'ended'
,
()
=>
{
this
.
$emit
(
'ended'
)
})
})
play
()
{
if
(
!
this
.
canPlay
)
return
this
.
$refs
.
videoDom
.
play
()
this
.
$emit
(
'currentTime'
,
this
.
$refs
.
videoDom
.
currentTime
)
},
beforeDestroy
()
{
this
.
$refs
.
videoDom
.
removeEventListener
(
'canplay'
)
this
.
$refs
.
videoDom
.
removeEventListener
(
'ended'
)
pause
()
{
if
(
!
this
.
canPlay
)
return
this
.
$refs
.
videoDom
.
pause
(
)
},
methods
:
{
canPlayFunc
()
{
this
.
canPlay
=
true
let
from
=
this
.
$parent
.
$options
.
name
||
'videoPlayer'
this
.
$bus
.
emit
(
`
${
from
}
.canPlay`
,
this
.
$refs
.
videoDom
.
duration
)
},
play
()
{
if
(
!
this
.
canPlay
)
return
this
.
$refs
.
videoDom
.
play
()
this
.
$emit
(
'currentTime'
,
this
.
$refs
.
videoDom
.
currentTime
)
},
pause
()
{
if
(
!
this
.
canPlay
)
return
this
.
$refs
.
videoDom
.
pause
()
},
currentTime
(
time
)
{
if
(
!
this
.
canPlay
)
return
this
.
$refs
.
videoDom
.
currentTime
=
time
}
currentTime
(
time
)
{
if
(
!
this
.
canPlay
)
return
this
.
$refs
.
videoDom
.
currentTime
=
time
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/main.js
View file @
41c24d83
...
...
@@ -18,7 +18,7 @@ Vue.config.productionTip = false
Vue
.
prototype
.
$http
=
axios
new
Vue
({
router
,
store
,
render
:
(
h
)
=>
h
(
App
)
router
,
store
,
render
:
(
h
)
=>
h
(
App
)
}).
$mount
(
'#app'
)
src/registerServiceWorker.js
View file @
41c24d83
...
...
@@ -3,27 +3,27 @@
import
{
register
}
from
'register-service-worker'
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
register
(
`
${
process
.
env
.
BASE_URL
}
service-worker.js`
,
{
ready
()
{
console
.
log
(
'App is being served from cache by a service worker.
\
n'
+
'For more details, visit https://goo.gl/AFskqB'
)
},
registered
()
{
console
.
log
(
'Service worker has been registered.'
)
},
cached
()
{
console
.
log
(
'Content has been cached for offline use.'
)
},
updatefound
()
{
console
.
log
(
'New content is downloading.'
)
},
updated
()
{
console
.
log
(
'New content is available; please refresh.'
)
},
offline
()
{
console
.
log
(
'No internet connection found. App is running in offline mode.'
)
},
error
(
error
)
{
console
.
error
(
'Error during service worker registration:'
,
error
)
}
})
register
(
`
${
process
.
env
.
BASE_URL
}
service-worker.js`
,
{
ready
()
{
console
.
log
(
'App is being served from cache by a service worker.
\
n'
+
'For more details, visit https://goo.gl/AFskqB'
)
},
registered
()
{
console
.
log
(
'Service worker has been registered.'
)
},
cached
()
{
console
.
log
(
'Content has been cached for offline use.'
)
},
updatefound
()
{
console
.
log
(
'New content is downloading.'
)
},
updated
()
{
console
.
log
(
'New content is available; please refresh.'
)
},
offline
()
{
console
.
log
(
'No internet connection found. App is running in offline mode.'
)
},
error
(
error
)
{
console
.
error
(
'Error during service worker registration:'
,
error
)
}
})
}
src/router/index.js
View file @
41c24d83
...
...
@@ -7,42 +7,42 @@ import screenshotPanel from '../components/rightPanel/screenshotPanel.vue'
Vue
.
use
(
VueRouter
)
const
routes
=
[
{
path
:
'/'
,
name
:
'Bao3'
,
component
:
Bao3
},
{
path
:
'/about'
,
name
:
'About'
,
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component
:
()
=>
import
(
/* webpackChunkName: "about" */
'../views/About.vue'
)
},
{
path
:
'/cutter'
,
name
:
'Cutter'
,
component
:
()
=>
import
(
/* webpackChunkName: "bao1" */
'../views/videoCutter.vue'
)
},
{
path
:
'/videoConverter'
,
name
:
'VideoConverter'
,
component
:
()
=>
import
(
/* webpackChunkName: "bao2" */
'../views/videoConverter.vue'
)
},
{
path
:
'/screenshot'
,
components
:
{
default
:
Screenshot
,
panel
:
screenshotPanel
}
{
path
:
'/'
,
name
:
'Bao3'
,
component
:
Bao3
},
{
path
:
'/about'
,
name
:
'About'
,
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component
:
()
=>
import
(
/* webpackChunkName: "about" */
'../views/About.vue'
)
},
{
path
:
'/cutter'
,
name
:
'Cutter'
,
component
:
()
=>
import
(
/* webpackChunkName: "bao1" */
'../views/videoCutter.vue'
)
},
{
path
:
'/videoConverter'
,
name
:
'VideoConverter'
,
component
:
()
=>
import
(
/* webpackChunkName: "bao2" */
'../views/videoConverter.vue'
)
},
{
path
:
'/screenshot'
,
components
:
{
default
:
Screenshot
,
panel
:
screenshotPanel
}
}
]
const
router
=
new
VueRouter
({
mode
:
'history'
,
base
:
process
.
env
.
BASE_URL
,
routes
mode
:
'history'
,
base
:
process
.
env
.
BASE_URL
,
routes
})
export
default
router
src/store/global.js
View file @
41c24d83
...
...
@@ -2,11 +2,11 @@
// getter调用示例:this.$store.getters['test']
const
state
=
{
_test
:
1
_test
:
1
}
const
getters
=
{
test
:
(
state
)
=>
state
.
_test
test
:
(
state
)
=>
state
.
_test
}
const
mutations
=
{}
...
...
@@ -14,8 +14,8 @@ const mutations = {}
const
actions
=
{}
export
default
{
state
,
getters
,
mutations
,
actions
state
,
getters
,
mutations
,
actions
}
src/store/index.js
View file @
41c24d83
...
...
@@ -7,8 +7,8 @@ import moduleA from './modules/moduleA'
Vue
.
use
(
Vuex
)
export
default
new
Vuex
.
Store
({
...
global
,
modules
:
{
moduleA
}
...
global
,
modules
:
{
moduleA
}
})
src/store/modules/moduleA.js
View file @
41c24d83
...
...
@@ -2,11 +2,11 @@
// getter调用示例:this.$store.getters['moduleA/moduleState']
const
state
=
{
_moduleState
:
'moduleState'
_moduleState
:
'moduleState'
}
const
getters
=
{
moduleState
:
(
state
)
=>
state
.
_moduleState
moduleState
:
(
state
)
=>
state
.
_moduleState
}
const
mutations
=
{}
...
...
@@ -14,9 +14,9 @@ const mutations = {}
const
actions
=
{}
export
default
{
namespaced
:
true
,
state
,
getters
,
mutations
,
actions
namespaced
:
true
,
state
,
getters
,
mutations
,
actions
}
src/views/bao2.vue
View file @
41c24d83
...
...
@@ -6,11 +6,11 @@
<
script
>
export
default
{
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
}
</
script
>
...
...
src/views/bao3.vue
View file @
41c24d83
...
...
@@ -7,11 +7,11 @@
<
script
>
export
default
{
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
data
()
{
return
{}
},
created
()
{},
mounted
()
{}
}
</
script
>
...
...
src/views/screenshot.vue
View file @
41c24d83
...
...
@@ -15,14 +15,14 @@
<
script
>
export
default
{
name
:
'Screenshot'
,
data
()
{
return
{
srcUrl
:
null
}
},
created
()
{},
mounted
()
{}
name
:
'Screenshot'
,
data
()
{
return
{
srcUrl
:
null
}
},
created
()
{},
mounted
()
{}
}
</
script
>
...
...
src/views/videoConverter.vue
View file @
41c24d83
...
...
@@ -81,57 +81,57 @@
<
script
>
export
default
{
name
:
'VideoConverter'
,
components
:
{},
props
:
{},
data
()
{
return
{
taskList
:
[]
}
name
:
'VideoConverter'
,
components
:
{},
props
:
{},
data
()
{
return
{
taskList
:
[]
}
},
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
({
cover
:
''
,
name
:
'视频片段'
+
(
this
.
taskList
.
length
+
1
),
duration
:
'10:00'
,
state
:
0
,
progress
:
60
,
outputFormat
:
'mp4'
})
},
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'
})
}
stopTask
(
item
)
{
item
.
state
=
0
},
methods
:
{
addVideo
()
{
this
.
taskList
.
push
({
cover
:
''
,
name
:
'视频片段'
+
(
this
.
taskList
.
length
+
1
),
duration
:
'10:00'
,
state
:
0
,
progress
:
60
,
outputFormat
:
'mp4'
})
},
stopTask
(
item
)
{
item
.
state
=
0
},
clearTask
(
item
)
{
let
index
=
this
.
taskList
.
indexOf
(
item
)
if
(
index
>
-
1
)
{
this
.
taskList
.
splice
(
index
,
1
)
}
},
clearAllTasks
()
{
this
.
taskList
=
[]
},
startAllTasks
()
{
this
.
taskList
.
forEach
((
task
)
=>
{
task
.
state
=
1
})
}
clearTask
(
item
)
{
let
index
=
this
.
taskList
.
indexOf
(
item
)
if
(
index
>
-
1
)
{
this
.
taskList
.
splice
(
index
,
1
)
}
},
clearAllTasks
()
{
this
.
taskList
=
[]
},
startAllTasks
()
{
this
.
taskList
.
forEach
((
task
)
=>
{
task
.
state
=
1
})
}
}
}
</
script
>
...
...
src/views/videoCutter.vue
View file @
41c24d83
...
...
@@ -31,55 +31,55 @@ import VideoChange from '@/components/videoCutter/videoChange.vue'
import
VideoControl
from
'@/components/videoCutter/videoControl.vue'
export
default
{
name
:
'VideoCutter'
,
components
:
{
VideoPlayer
,
VideoChange
,
VideoControl
name
:
'VideoCutter'
,
components
:
{
VideoPlayer
,
VideoChange
,
VideoControl
},
data
()
{
return
{
name
:
''
,
nowTime
:
0
,
duration
:
0
,
playing
:
false
,
canPlay
:
false
}
},
created
()
{},
mounted
()
{
this
.
$bus
.
on
(
'videoCutter.canPlay'
,
this
.
canPlayFunc
)
},
methods
:
{
changeVideo
()
{
console
.
log
(
'todo change video, <-----lilei'
)
},
canPlayFunc
(
data
)
{
this
.
duration
=
data
this
.
canPlay
=
true
},
data
()
{
return
{
name
:
''
,
nowTime
:
0
,
duration
:
0
,
playing
:
false
,
canPlay
:
false
videoPlay
()
{
if
(
!
this
.
canPlay
)
return
let
ob
=
{}
if
(
this
.
playing
)
{
ob
.
play
=
false
}
else
{
ob
.
play
=
true
if
(
this
.
nowTime
>=
this
.
duration
)
{
ob
.
time
=
0
}
}
this
.
playing
=
!
this
.
playing
this
.
$bus
.
emit
(
'videoPlayer.play'
,
ob
)
},
created
()
{},
mounted
()
{
this
.
$bus
.
on
(
'videoCutter.canPlay'
,
this
.
canPlayFunc
)
changeTime
(
data
)
{
console
.
log
(
data
)
},
methods
:
{
changeVideo
()
{
console
.
log
(
'todo change video, <-----lilei'
)
},
canPlayFunc
(
data
)
{
this
.
duration
=
data
this
.
canPlay
=
true
},
videoPlay
()
{
if
(
!
this
.
canPlay
)
return
let
ob
=
{}
if
(
this
.
playing
)
{
ob
.
play
=
false
}
else
{
ob
.
play
=
true
if
(
this
.
nowTime
>=
this
.
duration
)
{
ob
.
time
=
0
}
}
this
.
playing
=
!
this
.
playing
this
.
$bus
.
emit
(
'videoPlayer.play'
,
ob
)
},
changeTime
(
data
)
{
console
.
log
(
data
)
},
playEnd
()
{
this
.
playing
=
false
this
.
nowTime
=
this
.
duration
}
playEnd
()
{
this
.
playing
=
false
this
.
nowTime
=
this
.
duration
}
}
}
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment