Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
zxn-adputin
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lijin
zxn-adputin
Commits
94603d86
Commit
94603d86
authored
Jan 02, 2025
by
jiyonggang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了,选择视频页面是灰色的,只有再点击页面才正常的问题
parent
ef7fcc58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
index.vue
src/views/createDelivery/index.vue
+35
-10
No files found.
src/views/createDelivery/index.vue
View file @
94603d86
...
@@ -619,15 +619,22 @@
...
@@ -619,15 +619,22 @@
<ImageUploader
@
change=
"handleUploadChange"
/>
<ImageUploader
@
change=
"handleUploadChange"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"选择 Youtube 视频"
>
<el-form-item
label=
"选择 Youtube 视频"
>
<el-button
type=
"primary"
@
click=
"
fetchVideoList
"
>
加载视频列表
</el-button>
<el-button
type=
"primary"
@
click=
"
openVideoDialog
"
>
加载视频列表
</el-button>
<el-input
v-model=
"videoUrlsString"
placeholder=
"YouTube 链接将自动填充"
:disabled=
"true"
type=
"textarea"
:rows=
"3"
></el-input>
<el-input
v-model=
"videoUrlsString"
placeholder=
"YouTube 链接将自动填充"
:disabled=
"true"
type=
"textarea"
:rows=
"3"
></el-input>
<div
class=
"video-list"
style=
"display: flex; flex-wrap: wrap;"
>
<el-dialog
title=
"选择视频"
:visible
.
sync=
"videoDialogVisible"
width=
"70%"
:modal-append-to-body=
"true"
:append-to-body=
"true"
>
<div
v-for=
"video in videoDataList"
:key=
"video.videoId"
class=
"video-item"
@
click=
"toggleVideoSelection(video)"
style=
"margin: 10px; text-align: center; cursor: pointer;"
>
<el-button
type=
"primary"
@
click=
"fetchVideoList"
:loading=
"videoListLoading"
style=
"margin-bottom: 10px;"
>
刷新视频列表
</el-button>
<video
:src=
"video.ossUrl"
controls
width=
"200"
></video>
<div
class=
"video-list"
style=
"display: flex; flex-wrap: wrap;"
>
<p>
{{ video.materialName }}
</p>
<div
v-for=
"video in videoDataList"
:key=
"video.videoId"
class=
"video-item"
@
click=
"toggleVideoSelection(video)"
style=
"margin: 10px; text-align: center; cursor: pointer;"
>
<el-checkbox
v-model=
"selectedVideoId"
:label=
"video.videoId"
></el-checkbox>
<video
:src=
"video.ossUrl"
controls
width=
"200"
></video>
<p>
{{ video.materialName }}
</p>
<el-checkbox
v-model=
"selectedVideoId"
:label=
"video.videoId"
></el-checkbox>
</div>
</div>
</div>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"videoDialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmVideoSelection"
>
确 定
</el-button>
</span>
</el-dialog>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -744,6 +751,7 @@ export default {
...
@@ -744,6 +751,7 @@ export default {
selectedVideoId
:
{
selectedVideoId
:
{
handler
(
newVal
)
{
handler
(
newVal
)
{
this
.
putinTask
.
videoUrls
=
newVal
.
map
(
videoId
=>
`https://www.youtube.com/watch?v=
${
videoId
}
`
);
this
.
putinTask
.
videoUrls
=
newVal
.
map
(
videoId
=>
`https://www.youtube.com/watch?v=
${
videoId
}
`
);
this
.
updateVideoUrlsString
();
},
},
deep
:
true
deep
:
true
}
}
...
@@ -1019,6 +1027,8 @@ export default {
...
@@ -1019,6 +1027,8 @@ export default {
checkedAdvId
:
""
,
// 点击户时,选中的id
checkedAdvId
:
""
,
// 点击户时,选中的id
videoDataList
:
[],
// 存储通过 getYoutubeUploadDetaillist 获取的视频列表
videoDataList
:
[],
// 存储通过 getYoutubeUploadDetaillist 获取的视频列表
selectedVideoId
:
[],
// 存储用户选择的视频的 videoId
selectedVideoId
:
[],
// 存储用户选择的视频的 videoId
videoDialogVisible
:
false
,
videoListLoading
:
false
};
};
},
},
...
@@ -1739,13 +1749,16 @@ export default {
...
@@ -1739,13 +1749,16 @@ export default {
this
.
putinTask
.
imageAssets
=
files
this
.
putinTask
.
imageAssets
=
files
},
},
fetchVideoList
()
{
fetchVideoList
()
{
this
.
videoListLoading
=
true
;
getYoutubeUploadDetaillist
().
then
(
res
=>
{
getYoutubeUploadDetaillist
().
then
(
res
=>
{
this
.
videoDataList
=
res
.
result
.
data
;
this
.
videoDataList
=
res
.
result
.
data
;
this
.
$nextTick
(()
=>
{
console
.
log
(
'视频列表已更新'
);
})
}).
finally
(()
=>
{
this
.
videoListLoading
=
false
;
});
});
},
},
selectVideo
(
video
)
{
this
.
selectedVideoId
=
video
.
videoId
;
},
toggleVideoSelection
(
video
)
{
toggleVideoSelection
(
video
)
{
const
index
=
this
.
selectedVideoId
.
indexOf
(
video
.
videoId
);
const
index
=
this
.
selectedVideoId
.
indexOf
(
video
.
videoId
);
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
...
@@ -1754,6 +1767,18 @@ export default {
...
@@ -1754,6 +1767,18 @@ export default {
this
.
selectedVideoId
.
push
(
video
.
videoId
);
// 选中
this
.
selectedVideoId
.
push
(
video
.
videoId
);
// 选中
}
}
},
},
openVideoDialog
()
{
this
.
videoDialogVisible
=
true
;
if
(
this
.
videoDataList
.
length
===
0
)
{
this
.
fetchVideoList
();
}
},
confirmVideoSelection
()
{
this
.
videoDialogVisible
=
false
;
},
updateVideoUrlsString
()
{
this
.
videoUrlsString
=
this
.
putinTask
.
videoUrls
.
join
(
'
\
n'
);
},
},
},
};
};
</
script
>
</
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