Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
frontend-h5
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songrui
frontend-h5
Commits
5dd741c7
Commit
5dd741c7
authored
Sep 09, 2024
by
gengchunlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
慢综 医生端 关闭页面原生调用
parent
22d1a765
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
doctorFetch.js
src/api/doctor/doctorFetch.js
+2
-2
Doctor.vue
src/doctor/Doctor.vue
+2
-2
common.js
src/utils/common.js
+20
-0
No files found.
src/api/doctor/doctorFetch.js
View file @
5dd741c7
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
axios
from
'axios'
import
axios
from
'axios'
import
{
showFailToast
,
showLoadingToast
}
from
'vant'
import
{
showFailToast
,
showLoadingToast
}
from
'vant'
import
{
callMobil
e
}
from
'@/utils/common'
import
{
backHom
e
}
from
'@/utils/common'
const
baseAxios
=
axios
.
create
({
const
baseAxios
=
axios
.
create
({
baseURL
:
''
,
baseURL
:
''
,
...
@@ -31,7 +31,7 @@ export function fetchBase({
...
@@ -31,7 +31,7 @@ export function fetchBase({
contentType
===
'file'
&&
(
contentType
=
'multipart/form-data'
)
contentType
===
'file'
&&
(
contentType
=
'multipart/form-data'
)
let
token
=
sessionStorage
.
getItem
(
'token'
)
let
token
=
sessionStorage
.
getItem
(
'token'
)
if
(
!
token
)
{
if
(
!
token
)
{
callMobile
(
"goIndex"
,
{}
)
backHome
(
)
return
return
}
}
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
src/doctor/Doctor.vue
View file @
5dd741c7
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<
script
>
<
script
>
import
{
getDict
}
from
'@/api/base.js'
import
{
getDict
}
from
'@/api/base.js'
import
{
useStore
}
from
'./store/index.js'
import
{
useStore
}
from
'./store/index.js'
import
{
callMobil
e
,
getQueryVariable
}
from
'@/utils/common'
import
{
backHom
e
,
getQueryVariable
}
from
'@/utils/common'
import
{
getAuthInfo
}
from
'@/api/doctor/generalFU'
import
{
getAuthInfo
}
from
'@/api/doctor/generalFU'
export
default
{
export
default
{
...
@@ -64,7 +64,7 @@ export default {
...
@@ -64,7 +64,7 @@ export default {
this
.
visible
=
true
this
.
visible
=
true
}
else
{
}
else
{
callMobile
(
"goIndex"
,
{}
)
backHome
(
)
}
}
}
}
...
...
src/utils/common.js
View file @
5dd741c7
...
@@ -213,3 +213,22 @@ export function callMobile(handlerInterface, parameters) {
...
@@ -213,3 +213,22 @@ export function callMobile(handlerInterface, parameters) {
}
}
}
}
}
}
// 判断ios还是安卓
export
function
isIOSWebKit
()
{
const
aa
=
window
.
navigator
.
userAgent
;
if
(
!!
aa
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
))
{
// ios端
return
true
;
}
else
if
(
aa
.
indexOf
(
'Android'
)
!==
-
1
||
aa
.
indexOf
(
'Adr'
)
!==
-
1
)
{
// 安卓端
return
false
;
}
}
//关闭页面
export
function
backHome
()
{
if
(
isIOSWebKit
())
{
//ios
callMobile
(
"closeWebPage"
,
{})
}
if
(
isIOSWebKit
()
===
false
)
{
callMobile
(
"closePage"
,
{})
}
}
\ No newline at end of file
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