Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c65a3a9b
authored
Jun 25, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat(marketingManagement): iframe加载的url动态获取
1 parent
052ded40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
src/views/marketingManagement/marketingPushStrategy/components/pageConfig/index.vue
src/views/marketingManagement/marketingPushStrategy/components/pageConfig/index.vue
View file @
c65a3a9
<
template
>
<div
class=
"page-config-wrapper"
>
<div
class=
"phone-preview-iframe"
>
<iframe
ref=
"iframeRef"
<iframe
v-if=
"iframeUrl"
ref=
"iframeRef"
class=
"iframe"
frameborder=
"0"
src=
"http://192.168.148.147:4173/sop-material-preview.htm
l"
>
:src=
"iframeUr
l"
>
</iframe>
</div>
<div
class=
"config-from-wrapper"
>
...
...
@@ -152,6 +153,7 @@
import
VenusOssUpload
from
"@/components/venusOssUpload"
;
import
{
moveItem
}
from
"@/libs/array.js"
;
import
{
isImageFile
}
from
"@/libs/file.js"
;
import
{
baseConfig
}
from
"@/main"
;
import
{
intervalPxOptions
}
from
"@/views/marketingManagement/marketingPushStrategy/constant/index.js"
;
export
default
{
...
...
@@ -179,6 +181,7 @@ export default {
return
{
file
:
[],
materialList
:
[],
iframeUrl
:
""
,
rules
:
{
pageTitle
:
[
{
required
:
true
,
message
:
"请输入网页标题"
,
trigger
:
[
"blur"
]
},
...
...
@@ -224,6 +227,7 @@ export default {
window
.
removeEventListener
(
"message"
,
this
.
eventListenerIframeReady
);
},
async
mounted
()
{
this
.
iframeUrl
=
baseConfig
.
marketingManagement
.
marketingPushStrategy
.
pageConfigH5Addres
;
window
.
addEventListener
(
"message"
,
this
.
eventListenerIframeReady
);
},
...
...
@@ -364,10 +368,13 @@ export default {
return
hash
?
`
${
finalUrl
}
#
${
hash
}
`
:
finalUrl
;
},
async
eventListenerIframeReady
(
e
)
{
console
.
log
(
"message from iframe?"
,
e
.
origin
,
e
.
data
);
if
(
e
.
data
.
type
===
"SOP_MATERIAL_PREVIEW_READY"
||
e
.
type
===
"SOP_MATERIAL_PREVIEW_READY"
)
{
await
this
.
postIframeMessage
();
if
(
!
[
"http://single-pages.test.glsx.com.cn"
,
"http://single-pages.glsx.com.cn"
].
includes
(
e
.
origin
))
{
return
;
}
if
(
e
.
data
.
type
!==
"SOP_MATERIAL_PREVIEW_READY"
)
{
return
;
}
await
this
.
postIframeMessage
();
},
async
postIframeMessage
()
{
await
this
.
$nextTick
();
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment