Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
live-management-web
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
live-management-web
Commits
038d5382
Commit
038d5382
authored
Jul 18, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
7d8d89bd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
83 additions
and
47 deletions
+83
-47
src/components/SelectionPopup.vue
+17
-0
src/pages/createLive/index.vue
+12
-12
src/pages/home/components/myDigtalPeople.vue
+2
-1
src/pages/startLive/components/audio.vue
+31
-12
src/pages/startLive/components/video.vue
+2
-0
src/pages/startLive/index.vue
+17
-22
src/utils/request.ts
+2
-0
No files found.
src/components/SelectionPopup.vue
View file @
038d5382
...
@@ -63,6 +63,9 @@
...
@@ -63,6 +63,9 @@
</template>
</template>
</div>
</div>
</div>
</div>
<
template
v-if=
"playAudio"
>
<audio
ref=
"audioRef"
:src=
"currentAudio"
style=
"display: none"
@
canplay=
"audioCanplay"
></audio>
</
template
>
</template>
</template>
<slot></slot>
<slot></slot>
</t-popup>
</t-popup>
...
@@ -84,6 +87,7 @@ const props = withDefaults(
...
@@ -84,6 +87,7 @@ const props = withDefaults(
placement
?:
string
;
placement
?:
string
;
needCategorie
?:
boolean
;
needCategorie
?:
boolean
;
reset
?:
boolean
;
reset
?:
boolean
;
playAudio
?:
boolean
;
}
>
(),
}
>
(),
{
{
disabled
:
false
,
disabled
:
false
,
...
@@ -93,10 +97,16 @@ const props = withDefaults(
...
@@ -93,10 +97,16 @@ const props = withDefaults(
placement
:
'bottom'
,
placement
:
'bottom'
,
needCategorie
:
true
,
needCategorie
:
true
,
reset
:
false
,
reset
:
false
,
playAudio
:
true
,
},
},
);
);
const
emit
=
defineEmits
([
'update:modelValue'
,
'update:value'
,
'itemChange'
]);
const
emit
=
defineEmits
([
'update:modelValue'
,
'update:value'
,
'itemChange'
]);
const
visible
=
ref
(
props
.
modelValue
);
const
visible
=
ref
(
props
.
modelValue
);
const
audioRef
=
ref
<
HTMLAudioElement
>
();
// 当前选择的音调或音色的音频链接
const
currentAudio
=
ref
(
''
);
const
popupList
=
reactive
({
const
popupList
=
reactive
({
list
:
[],
list
:
[],
});
});
...
@@ -107,6 +117,11 @@ const getList = async () => {
...
@@ -107,6 +117,11 @@ const getList = async () => {
popupList
.
list
=
list
;
popupList
.
list
=
list
;
};
};
// 音频播放
const
audioCanplay
=
()
=>
{
audioRef
.
value
.
play
();
};
watch
(
watch
(
()
=>
props
.
modelValue
,
()
=>
props
.
modelValue
,
(
v
)
=>
{
(
v
)
=>
{
...
@@ -132,6 +147,8 @@ const onSelect = (item: any) => {
...
@@ -132,6 +147,8 @@ const onSelect = (item: any) => {
visible
.
value
=
false
;
visible
.
value
=
false
;
emit
(
'update:value'
,
item
.
id
);
emit
(
'update:value'
,
item
.
id
);
emit
(
'itemChange'
,
item
);
emit
(
'itemChange'
,
item
);
//
currentAudio
.
value
=
item
.
audition_url
;
};
};
</
script
>
</
script
>
...
...
src/pages/createLive/index.vue
View file @
038d5382
...
@@ -221,18 +221,6 @@ const getEditInfo = async (id: any, type: string) => {
...
@@ -221,18 +221,6 @@ const getEditInfo = async (id: any, type: string) => {
}
}
};
};
onMounted
(()
=>
{
let
obj
=
getElBounding
(
publicTool
.
value
);
toolHeight
.
value
=
obj
.
height
;
if
(
routeQuery
.
id
&&
routeQuery
.
type
)
{
// 获取编辑数据
getEditInfo
(
routeQuery
.
id
,
routeQuery
.
type
);
}
store
.
commit
(
'live/setName'
,
route
.
query
.
title
?
route
.
query
.
title
:
''
);
// 记录本次路由
window
.
localStorage
.
setItem
(
createLiveRouteKey
,
JSON
.
stringify
(
route
.
query
));
});
const
backHome
=
()
=>
{
const
backHome
=
()
=>
{
router
.
replace
({
router
.
replace
({
path
:
routerConfig
.
home
.
path
,
path
:
routerConfig
.
home
.
path
,
...
@@ -405,6 +393,18 @@ const confirm = async () => {
...
@@ -405,6 +393,18 @@ const confirm = async () => {
console
.
log
(
e
);
console
.
log
(
e
);
}
}
};
};
onMounted
(()
=>
{
let
obj
=
getElBounding
(
publicTool
.
value
);
toolHeight
.
value
=
obj
.
height
;
if
(
routeQuery
.
id
&&
routeQuery
.
type
)
{
// 获取编辑数据
getEditInfo
(
routeQuery
.
id
,
routeQuery
.
type
);
}
store
.
commit
(
'live/setName'
,
route
.
query
.
title
?
route
.
query
.
title
:
''
);
// 记录本次路由
window
.
localStorage
.
setItem
(
createLiveRouteKey
,
JSON
.
stringify
(
route
.
query
));
});
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
...
src/pages/home/components/myDigtalPeople.vue
View file @
038d5382
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
>
>
<template
#
hover
>
<template
#
hover
>
<div
class=
"my-digtal-people-hover"
>
<div
class=
"my-digtal-people-hover"
>
<template
v-if=
"item.is_live ==
1
"
>
<template
v-if=
"item.is_live ==
0
"
>
<Button
class=
"digtal-people-start-end"
theme=
"danger"
height=
"40px"
@
click=
"startLive(item)"
<Button
class=
"digtal-people-start-end"
theme=
"danger"
height=
"40px"
@
click=
"startLive(item)"
>
开启直播
</Button
>
开启直播
</Button
>
>
...
@@ -69,6 +69,7 @@ const startLive = (item: any) => {
...
@@ -69,6 +69,7 @@ const startLive = (item: any) => {
status
:
item
.
status
,
status
:
item
.
status
,
digital_image
:
item
.
cover_url
,
digital_image
:
item
.
cover_url
,
digital_name
:
item
.
name
,
digital_name
:
item
.
name
,
is_live
:
item
.
is_live
,
},
},
});
});
};
};
...
...
src/pages/startLive/components/audio.vue
View file @
038d5382
...
@@ -20,9 +20,12 @@
...
@@ -20,9 +20,12 @@
<div
class=
"live-icon"
>
<div
class=
"live-icon"
>
<LiveSvg></LiveSvg>
<LiveSvg></LiveSvg>
</div>
</div>
<span>
直播中
</span>
<span>
<template
v-if=
"route.query.is_live == '1'"
>
直播中
</
template
>
<
template
v-else
>
未开播
</
template
>
</span>
</div>
</div>
<div
class=
"stop"
>
<div
class=
"stop"
v-if=
"route.query.is_live == '1'"
>
<!-- <span class="start-time">00:52:20</span> -->
<!-- <span class="start-time">00:52:20</span> -->
<Button
theme=
"opacity"
@
click=
"closeLive"
>
关闭直播
</Button>
<Button
theme=
"opacity"
@
click=
"closeLive"
>
关闭直播
</Button>
</div>
</div>
...
@@ -39,7 +42,8 @@ import LiveSvg from '@/assets/svg/home/live.svg';
...
@@ -39,7 +42,8 @@ import LiveSvg from '@/assets/svg/home/live.svg';
import
PlayAudioSvg
from
'@/assets/svg/home/playAudio.svg'
;
import
PlayAudioSvg
from
'@/assets/svg/home/playAudio.svg'
;
import
{
closeLiveTask
}
from
'@/utils/api/userApi'
;
import
{
closeLiveTask
}
from
'@/utils/api/userApi'
;
import
{
ref
,
watch
}
from
'vue'
;
import
{
ref
,
watch
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
routerConfig
from
'@/router/tool'
;
import
{
show_message
}
from
'@/utils/tool'
;
import
{
show_message
}
from
'@/utils/tool'
;
const
props
=
withDefaults
(
const
props
=
withDefaults
(
defineProps
<
{
defineProps
<
{
...
@@ -52,6 +56,7 @@ const props = withDefaults(
...
@@ -52,6 +56,7 @@ const props = withDefaults(
},
},
);
);
const
route
=
useRoute
();
const
route
=
useRoute
();
const
router
=
useRouter
();
const
canPlay
=
ref
(
false
);
const
canPlay
=
ref
(
false
);
...
@@ -64,9 +69,31 @@ watch(
...
@@ -64,9 +69,31 @@ watch(
},
},
);
);
watch
(
()
=>
props
.
value
,
(
v
)
=>
{
if
(
v
)
{
textareaValue
.
value
=
v
;
}
else
{
textareaValue
.
value
=
''
;
}
},
);
const
textareaStatus
=
ref
(
false
);
const
textareaStatus
=
ref
(
false
);
const
textareaValue
=
ref
(
props
.
value
);
const
textareaValue
=
ref
(
props
.
value
);
const
changeRouteQuery
=
()
=>
{
router
.
replace
({
path
:
routerConfig
.
startLive
.
path
,
name
:
routerConfig
.
startLive
.
name
,
query
:
{
...
route
.
query
,
is_live
:
'0'
,
},
});
};
const
showTextarea
=
()
=>
{
const
showTextarea
=
()
=>
{
textareaStatus
.
value
=
true
;
textareaStatus
.
value
=
true
;
};
};
...
@@ -76,20 +103,12 @@ const closeLive = async () => {
...
@@ -76,20 +103,12 @@ const closeLive = async () => {
let
res
:
any
=
await
closeLiveTask
(
route
.
query
.
id
);
let
res
:
any
=
await
closeLiveTask
(
route
.
query
.
id
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
show_message
(
'关播成功'
,
'success'
);
show_message
(
'关播成功'
,
'success'
);
changeRouteQuery
();
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
}
}
};
};
watch
(
()
=>
props
.
value
,
(
v
)
=>
{
if
(
v
)
{
textareaValue
.
value
=
v
;
}
},
);
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
...
src/pages/startLive/components/video.vue
View file @
038d5382
...
@@ -74,6 +74,8 @@ const updateTime = () => {
...
@@ -74,6 +74,8 @@ const updateTime = () => {
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.start-live-video
{
.start-live-video
{
padding
:
20px
40px
;
padding
:
20px
40px
;
display
:
flex
;
align-items
:
center
;
.default-video
{
.default-video
{
background
:
rgb
(
61
,
222
,
99
);
background
:
rgb
(
61
,
222
,
99
);
height
:
100%
;
height
:
100%
;
...
...
src/pages/startLive/index.vue
View file @
038d5382
<
template
>
<
template
>
<div
class=
"custom-start-live-page"
>
<div
class=
"custom-start-live-page"
>
<Video
:video=
"realVideo"
v-model=
"progress"
:video2=
"addVideo"
:playId=
"addVideoId"
@
playEnd=
"playEnd"
></Video>
<Video
:video=
"realVideo"
v-model=
"progress"
:video2=
"addVideo"
:playId=
"addVideoId"
@
playEnd=
"playEnd"
></Video>
<Audio
:url=
"realAudio"
v-model=
"progress"
></Audio>
<Audio
:url=
"realAudio"
v-model=
"progress"
:value=
"liveInfo.content"
></Audio>
<Human
@
createAudio=
"createAudio"
></Human>
<Human
@
createAudio=
"createAudio"
></Human>
<div
v-show=
"false"
>
<div
v-show=
"false"
>
<audio
:src=
"audioFile"
ref=
"audioRef"
@
canplay=
"audioCanplay"
></audio>
<audio
:src=
"audioFile"
ref=
"audioRef"
@
canplay=
"audioCanplay"
></audio>
...
@@ -17,12 +17,14 @@ import Video from './components/video.vue';
...
@@ -17,12 +17,14 @@ import Video from './components/video.vue';
import
Audio
from
'./components/audio.vue'
;
import
Audio
from
'./components/audio.vue'
;
import
Human
from
'./components/human.vue'
;
import
Human
from
'./components/human.vue'
;
import
{
getLiveDetail
}
from
'@/utils/api/userApi'
;
import
{
getLiveDetail
}
from
'@/utils/api/userApi'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
show_message
,
isDev
}
from
'@/utils/tool'
;
import
{
show_message
,
isDev
}
from
'@/utils/tool'
;
import
{
initPyqtToWindow
,
injectWindow
}
from
'@/utils/pyqt'
;
import
{
initPyqtToWindow
,
injectWindow
}
from
'@/utils/pyqt'
;
import
{
getliveTaskReply
}
from
'@/utils/api/userApi'
;
import
{
getliveTaskReply
}
from
'@/utils/api/userApi'
;
import
routerConfig
from
'@/router/tool'
;
const
route
=
useRoute
();
const
route
=
useRoute
();
const
router
=
useRouter
();
const
routeQuery
=
route
.
query
;
const
routeQuery
=
route
.
query
;
const
progress
=
ref
(
0
);
const
progress
=
ref
(
0
);
...
@@ -35,22 +37,6 @@ const imgs = {
...
@@ -35,22 +37,6 @@ const imgs = {
mp4
:
new
URL
(
'../../assets/img/1.mp4'
,
import
.
meta
.
url
).
href
,
mp4
:
new
URL
(
'../../assets/img/1.mp4'
,
import
.
meta
.
url
).
href
,
mp3
:
new
URL
(
'../../assets/img/2.wav'
,
import
.
meta
.
url
).
href
,
mp3
:
new
URL
(
'../../assets/img/2.wav'
,
import
.
meta
.
url
).
href
,
};
};
const
getBase64
=
(
file
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
reader
=
new
FileReader
();
let
fileResult
=
''
;
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
()
=>
{
fileResult
=
reader
.
result
;
};
reader
.
onerror
=
(
error
)
=>
{
reject
(
error
);
};
reader
.
onloadend
=
()
=>
{
resolve
(
fileResult
);
};
});
};
const
file
=
ref
();
const
file
=
ref
();
...
@@ -65,11 +51,8 @@ const audioCanplay = () => {
...
@@ -65,11 +51,8 @@ const audioCanplay = () => {
const
liveInfo
=
reactive
({
const
liveInfo
=
reactive
({
// 原始链接
// 原始链接
video
:
[],
video
:
[],
// 音频从视频中提取出来
audio
:
''
,
content
:
''
,
content
:
''
,
status
:
1
,
type_content
:
''
,
startTime
:
'00:50:00'
,
});
});
// 定时检测python的方法是否注入成功
// 定时检测python的方法是否注入成功
...
@@ -188,8 +171,20 @@ const getDetail = async () => {
...
@@ -188,8 +171,20 @@ const getDetail = async () => {
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
liveInfo
.
video
=
res
.
data
.
url
;
liveInfo
.
video
=
res
.
data
.
url
;
liveInfo
.
content
=
res
.
data
.
content
;
liveInfo
.
content
=
res
.
data
.
content
;
if
(
res
.
data
.
type_content
)
{
liveInfo
.
content
=
res
.
data
.
type_content
;
}
// 通知python合并
// 通知python合并
submitVideo
();
submitVideo
();
// 开播成功
router
.
replace
({
path
:
routerConfig
.
startLive
.
path
,
name
:
routerConfig
.
startLive
.
name
,
query
:
{
...
route
.
query
,
is_live
:
'1'
,
},
});
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
...
...
src/utils/request.ts
View file @
038d5382
...
@@ -8,6 +8,7 @@ import { show_message, isDev } from './tool';
...
@@ -8,6 +8,7 @@ import { show_message, isDev } from './tool';
const
getBaseUrl
=
()
=>
{
const
getBaseUrl
=
()
=>
{
if
(
isDev
())
{
if
(
isDev
())
{
//
//
// return 'http://156.247.11.21:92/';
return
''
;
return
''
;
}
}
// return 'http://video-assistant.test';
// return 'http://video-assistant.test';
...
@@ -16,6 +17,7 @@ const getBaseUrl = () => {
...
@@ -16,6 +17,7 @@ const getBaseUrl = () => {
const
instance
=
axios
.
create
({
const
instance
=
axios
.
create
({
baseURL
:
getBaseUrl
(),
baseURL
:
getBaseUrl
(),
// withCredentials: false,
withCredentials
:
isDev
()
?
true
:
false
,
withCredentials
:
isDev
()
?
true
:
false
,
});
});
...
...
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