Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuzhen@situdata.com
/
yunxiao-admin-fe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
62448482
authored
2021-01-05 15:53:59 +0800
by
zhen
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update:更新iframe配置
1 parent
da102b08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
src/views/iframe.vue
src/views/iframe.vue
View file @
6244848
...
...
@@ -19,14 +19,14 @@
<el-button
type=
"primary"
@
click=
"open"
>
呼叫
</el-button>
<el-button
type=
"primary"
@
click=
"cancelCall"
>
取消呼叫
</el-button>
</p>
<iframe
<
!--
<
iframe
v-if=
"isStart"
ref=
"srtcIframe"
title=
"srtcIframe"
:src=
"target"
frameborder=
"2"
allow=
"microphone;camera;midi;encrypted-media;fullscreen;"
></iframe>
></iframe>
-->
</div>
</
template
>
...
...
@@ -34,17 +34,18 @@
export
default
{
data
()
{
return
{
baseUrl
:
'https://pre-web-chery.situdata.com'
,
// baseUrl: 'https://pre-web-chery.situdata.com',
baseUrl
:
'https://localhost:8081'
,
isStart
:
false
,
target
:
''
,
strWindowFeatures
:
`
left=2
4
00,
top=200
left=2
8
00,
top=200
,
height=500,
width=700,
menubar=1,
toolbar=1,
fullscreen
=1
status
=1
`
,
orderInfo
:
{
appUserName
:
'刘臻'
,
...
...
@@ -61,15 +62,15 @@ export default {
open
()
{
this
.
isStart
=
true
this
.
target
=
`
${
this
.
baseUrl
}
/#/srtc-iframe?path="https://localhost:8080"`
this
.
$nextTick
().
then
(()
=>
{
this
.
$refs
.
srtcIframe
.
onload
=
()
=>
{
this
.
sendMessage
()
}
})
this
.
srtcIframe
=
window
.
open
(
this
.
target
,
'srtc'
,
this
.
strWindowFeatures
)
this
.
srtcIframe
.
focus
()
setTimeout
(()
=>
{
this
.
sendMessage
()
}
,
2000
)
},
sendMessage
()
{
const
{
appUserName
,
appUserPhone
,
orderId
,
webUserName
}
=
this
.
orderInfo
this
.
$refs
.
srtcIframe
.
contentWindow
.
postMessage
(
this
.
srtcIframe
.
postMessage
(
{
type
:
'startCall'
,
data
:
{
...
...
@@ -83,12 +84,13 @@ export default {
)
},
cancelCall
()
{
this
.
$refs
.
srtcIframe
.
contentWindow
.
postMessage
(
this
.
srtcIframe
.
postMessage
(
{
type
:
'cancelCall'
},
this
.
baseUrl
)
this
.
srtcIframe
.
close
()
},
receiveMessage
(
e
)
{
if
(
e
.
origin
!==
this
.
baseUrl
)
{
...
...
@@ -100,11 +102,14 @@ export default {
switch
(
type
)
{
case
'appHangUp'
:
this
.
isStart
=
false
this
.
srtcIframe
.
close
()
break
case
'cancelCallCB'
:
this
.
srtcIframe
.
close
()
this
.
isStart
=
false
break
case
'webHangUp'
:
this
.
srtcIframe
.
close
()
this
.
isStart
=
false
break
}
...
...
Write
Preview
Styling with
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