Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
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 f2e1f75d
authored
Feb 17, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加注释
1 parent
30e0d4fe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
src/components/Action.vue
src/components/Action.vue
View file @
f2e1f75
...
@@ -150,6 +150,15 @@ export default {
...
@@ -150,6 +150,15 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
checkOpenLaunch
()
this
.
iSMiniprogram
=
window
.
__wxjs_environment
===
'miniprogram'
},
methods
:
{
checkOpenLaunch
()
{
/**
* 微信版本要求为:7.0.12及以上
* 系统版本要求为:iOS 10.3及以上、Android 5.0及以上
*/
const
userAgent
=
navigator
.
userAgent
,
const
userAgent
=
navigator
.
userAgent
,
wechat_version
=
userAgent
.
match
(
/MicroMessenger
\/([\d\.]
+
)
/i
)[
1
]
wechat_version
=
userAgent
.
match
(
/MicroMessenger
\/([\d\.]
+
)
/i
)[
1
]
try
{
try
{
...
@@ -158,29 +167,29 @@ export default {
...
@@ -158,29 +167,29 @@ export default {
if
(
w_a
<
7
)
throw
false
if
(
w_a
<
7
)
throw
false
if
(
w_a
==
7
&&
w_b
==
0
&&
w_c
<
12
)
throw
false
if
(
w_a
==
7
&&
w_b
==
0
&&
w_c
<
12
)
throw
false
if
(
userAgent
.
includes
(
'iPhone'
)
||
userAgent
.
includes
(
'iPad'
))
{
if
(
userAgent
.
includes
(
'iPhone'
)
||
userAgent
.
includes
(
'iPad'
))
{
let
[
phone_version
]
=
userAgent
.
match
(
/iPhone OS .*
?(?=
)
/
)
let
phone_version
=
userAgent
.
match
(
/iPhone OS
([\d\_]
+
)
/i
)[
1
]
if
(
phone_version
)
{
if
(
phone_version
)
{
let
[
a
,
b
]
=
phone_version
.
split
(
' '
).
at
(
-
1
)
.
split
(
'_'
)
let
[
a
,
b
]
=
phone_version
.
split
(
'_'
)
if
(
!
b
)
b
=
0
if
(
!
b
)
b
=
0
if
(
a
<
10
)
throw
false
if
(
a
<
10
)
throw
false
if
(
a
==
10
&&
b
<
3
)
throw
false
if
(
a
==
10
&&
b
<
3
)
throw
false
/**
* 👇 iOS15底层 WebKit 接口发生变更,微信版本8.0.8以下(不包括8.0.8)无法使用开放标签,可引导用户升级最新版本微信
*/
if
(
a
==
15
&&
w_a
==
8
&&
w_b
==
0
&&
w_c
<
8
)
throw
false
if
(
a
==
15
&&
w_a
==
8
&&
w_b
==
0
&&
w_c
<
8
)
throw
false
}
}
}
}
if
(
userAgent
.
includes
(
'Android'
))
{
if
(
userAgent
.
includes
(
'Android'
))
{
let
[
phone_version
]
=
userAgent
.
match
(
/Android.*
?(?=
;
)
/
)
let
phone_version
=
userAgent
.
match
(
/Android
([\d\.]
+
)
/i
)[
1
]
if
(
phone_version
)
{
if
(
phone_version
)
{
let
[
a
]
=
phone_version
.
split
(
' '
).
at
(
-
1
)
.
split
(
'.'
)
let
[
a
]
=
phone_version
.
split
(
'.'
)
if
(
a
<
5
)
throw
false
if
(
a
<
5
)
throw
false
}
}
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
this
.
supportOpenLaunch
=
error
this
.
supportOpenLaunch
=
error
}
}
this
.
iSMiniprogram
=
window
.
__wxjs_environment
===
'miniprogram'
},
},
methods
:
{
errorToast
()
{
errorToast
()
{
this
.
showToast
(
'当前系统或微信版本不支持该功能,请升级后再试。'
)
this
.
showToast
(
'当前系统或微信版本不支持该功能,请升级后再试。'
)
},
},
...
...
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