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
1fae0be5
Commit
1fae0be5
authored
Mar 22, 2025
by
lijin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加查看广告信息抽屉
parent
7211868e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
200 additions
and
26 deletions
+200
-26
CampaignTaskManage.vue
src/views/campaignTask/CampaignTaskManage.vue
+200
-26
No files found.
src/views/campaignTask/CampaignTaskManage.vue
View file @
1fae0be5
...
@@ -145,9 +145,6 @@
...
@@ -145,9 +145,6 @@
:visible
.
sync=
"detailVisible"
:visible
.
sync=
"detailVisible"
width=
"80%"
width=
"80%"
>
>
<div
style=
"margin-bottom: 15px; text-align: right;"
>
<el-button
icon=
"el-icon-refresh"
@
click=
"refreshTaskDetail"
>
刷新
</el-button>
</div>
<el-table
:data=
"currentTaskDetail"
border
>
<el-table
:data=
"currentTaskDetail"
border
>
<el-table-column
prop=
"id"
label=
"ID"
></el-table-column>
<el-table-column
prop=
"id"
label=
"ID"
></el-table-column>
<el-table-column
prop=
"advertiserId"
label=
"广告账户ID"
></el-table-column>
<el-table-column
prop=
"advertiserId"
label=
"广告账户ID"
></el-table-column>
...
@@ -175,9 +172,79 @@
...
@@ -175,9 +172,79 @@
</el-tag>
</el-tag>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<!-- 新增操作列 -->
<el-table-column
label=
"操作"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
v-if=
"scope.row.adInfo"
@
click=
"showAdInfo(scope.row)"
>
广告信息
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-table>
</el-dialog>
</el-dialog>
<!-- 广告信息抽屉 -->
<el-drawer
title=
"广告信息"
:visible
.
sync=
"drawerVisible"
direction=
"rtl"
size=
"50%"
:modal-append-to-body=
"false"
>
<div
v-if=
"currentAdInfo"
class=
"drawer-content"
>
<!-- 标题部分 -->
<div
class=
"section-title"
>
标题
</div>
<div
class=
"headlines-section"
>
<div
v-for=
"(headline, index) in currentAdInfo.headlines"
:key=
"'headline-'+index"
class=
"headline-item"
>
<div
class=
"item-content"
>
{{headline.text}}
</div>
</div>
</div>
<!-- 描述部分 -->
<div
class=
"section-title"
>
描述
</div>
<div
class=
"descriptions-section"
>
<div
v-for=
"(desc, index) in currentAdInfo.descriptions"
:key=
"'desc-'+index"
class=
"description-item"
>
<div
class=
"item-content"
>
{{desc.text}}
</div>
</div>
</div>
<!-- 图片部分 -->
<div
class=
"section-title"
>
图片
</div>
<div
class=
"images-section"
>
<div
v-for=
"(imgUrl, index) in currentAdInfo.imageUrls"
:key=
"'img-'+index"
class=
"image-item"
>
<img
:src=
"imgUrl"
@
click=
"previewImage(imgUrl)"
class=
"thumbnail"
>
</div>
</div>
<!-- 视频部分 -->
<div
class=
"section-title"
>
视频
</div>
<div
class=
"videos-section"
>
<div
v-for=
"(video, index) in currentAdInfo.videoInfos"
:key=
"'video-'+index"
class=
"video-item"
>
<video
:src=
"video.url"
class=
"video-thumbnail"
preload=
"metadata"
@
click=
"playVideo(video.url)"
>
</video>
<div
class=
"video-name"
>
{{video.name}}
</div>
</div>
</div>
</div>
</el-drawer>
<!-- 图片预览 -->
<el-dialog
:visible
.
sync=
"previewVisible"
append-to-body
class=
"preview-dialog"
>
<img
:src=
"previewImageUrl"
class=
"preview-image"
alt=
"预览图片"
>
</el-dialog>
<!-- 视频播放 -->
<el-dialog
:visible
.
sync=
"videoPlayVisible"
append-to-body
width=
"70%"
class=
"video-dialog"
>
<video
:src=
"currentVideoUrl"
controls
autoplay
class=
"video-player"
></video>
</el-dialog>
</div>
</div>
</template>
</template>
...
@@ -226,7 +293,12 @@ export default {
...
@@ -226,7 +293,12 @@ export default {
detailVisible
:
false
,
detailVisible
:
false
,
errorReasonVisible
:
false
,
errorReasonVisible
:
false
,
currentTaskDetail
:
null
,
currentTaskDetail
:
null
,
currentTaskId
:
null
drawerVisible
:
false
,
currentAdInfo
:
null
,
previewVisible
:
false
,
previewImageUrl
:
''
,
videoPlayVisible
:
false
,
currentVideoUrl
:
''
}
}
},
},
created
()
{
created
()
{
...
@@ -351,7 +423,6 @@ export default {
...
@@ -351,7 +423,6 @@ export default {
this
.
detailVisible
=
true
;
this
.
detailVisible
=
true
;
this
.
detailLoading
=
true
;
this
.
detailLoading
=
true
;
this
.
currentTaskDetail
=
null
;
this
.
currentTaskDetail
=
null
;
this
.
currentTaskId
=
row
.
id
;
getCampaignTaskDetails
({
taskId
:
row
.
id
}).
then
(
response
=>
{
getCampaignTaskDetails
({
taskId
:
row
.
id
}).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
if
(
response
.
status
===
200
)
{
...
@@ -366,27 +437,6 @@ export default {
...
@@ -366,27 +437,6 @@ export default {
this
.
detailLoading
=
false
;
this
.
detailLoading
=
false
;
});
});
},
},
refreshTaskDetail
()
{
if
(
!
this
.
currentTaskId
)
{
this
.
$message
.
warning
(
'无法刷新,任务ID不存在'
);
return
;
}
this
.
detailLoading
=
true
;
getCampaignTaskDetails
({
taskId
:
this
.
currentTaskId
}).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
currentTaskDetail
=
response
.
result
.
data
;
}
else
{
this
.
$message
.
error
(
response
.
msg
||
'获取任务详情失败'
);
}
}).
catch
(
error
=>
{
console
.
error
(
'获取任务详情失败:'
,
error
);
this
.
$message
.
error
(
'获取任务详情失败: '
+
error
.
message
);
}).
finally
(()
=>
{
this
.
detailLoading
=
false
;
});
},
async
handleStart
(
row
)
{
async
handleStart
(
row
)
{
try
{
try
{
...
@@ -447,6 +497,31 @@ export default {
...
@@ -447,6 +497,31 @@ export default {
}
catch
(
e
)
{
}
catch
(
e
)
{
return
jsonString
;
return
jsonString
;
}
}
},
showAdInfo
(
row
)
{
if
(
row
&&
row
.
adInfo
)
{
try
{
// 如果adInfo是字符串,则解析为JSON对象
this
.
currentAdInfo
=
typeof
row
.
adInfo
===
'string'
?
JSON
.
parse
(
row
.
adInfo
)
:
row
.
adInfo
;
this
.
drawerVisible
=
true
;
}
catch
(
error
)
{
console
.
error
(
'解析广告信息失败:'
,
error
);
this
.
$message
.
error
(
'无法解析广告信息'
);
}
}
else
{
this
.
$message
.
info
(
'没有广告信息'
);
}
},
previewImage
(
url
)
{
this
.
previewImageUrl
=
url
;
this
.
previewVisible
=
true
;
},
playVideo
(
url
)
{
this
.
currentVideoUrl
=
url
;
this
.
videoPlayVisible
=
true
;
}
}
}
}
}
}
...
@@ -562,4 +637,103 @@ export default {
...
@@ -562,4 +637,103 @@ export default {
.mt-3
{
.mt-3
{
margin-top
:
1rem
;
margin-top
:
1rem
;
}
}
/* 抽屉内容样式 */
.drawer-content
{
padding
:
20px
;
}
.section-title
{
font-size
:
18px
;
font-weight
:
bold
;
margin
:
20px
0
10px
0
;
padding-bottom
:
10px
;
border-bottom
:
1px
solid
#ebeef5
;
}
.headlines-section
,
.descriptions-section
{
display
:
flex
;
flex-direction
:
column
;
gap
:
10px
;
}
.headline-item
,
.description-item
{
background-color
:
#f5f7fa
;
padding
:
10px
;
border-radius
:
4px
;
}
.item-title
{
font-weight
:
bold
;
margin-bottom
:
5px
;
color
:
#666
;
}
.item-content
{
word-break
:
break-all
;
}
.images-section
,
.videos-section
{
display
:
flex
;
flex-wrap
:
wrap
;
gap
:
15px
;
margin-top
:
10px
;
}
.image-item
,
.video-item
{
width
:
calc
(
33.333%
-
15px
);
margin-bottom
:
15px
;
}
.thumbnail
,
.video-thumbnail
{
width
:
100%
;
height
:
120px
;
object-fit
:
cover
;
border-radius
:
4px
;
cursor
:
pointer
;
transition
:
transform
0.3s
;
}
.thumbnail
:hover
,
.video-thumbnail
:hover
{
transform
:
scale
(
1.05
);
}
.video-name
{
font-size
:
12px
;
margin-top
:
5px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.preview-image
{
max-width
:
100%
;
max-height
:
80vh
;
}
.video-player
{
width
:
100%
;
}
/* 大型屏幕上的响应式布局 */
@media
(
min-width
:
1200px
)
{
.image-item
,
.video-item
{
width
:
calc
(
25%
-
15px
);
}
}
/* 小型屏幕上的响应式布局 */
@media
(
max-width
:
768px
)
{
.image-item
,
.video-item
{
width
:
calc
(
50%
-
15px
);
}
}
</
style
>
</
style
>
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