Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-community-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
TaoHuang
6 years ago
Commit
06e486fda52c8945e972cf8c01855ace7eefabe8
1 parent
366292f8
android open app
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
apps/common/open-app.js
apps/common/yoho.js
package.json
apps/common/open-app.js
View file @
06e486f
...
...
@@ -16,8 +16,6 @@ const getAppPath = () => {
let
openbyYohobuy
=
params
[
'openby:yohobuy'
]
||
''
;
let
appPath
=
''
;
console
.
log
(
'openbyyohobuy=>'
,
openbyYohobuy
);
if
(
openbyYohobuy
)
{
appPath
=
'yohobuy://yohobuy.com/goapp?openby:yohobuy='
+
openbyYohobuy
;
}
else
{
...
...
@@ -36,6 +34,8 @@ const isApp = /yoho/i.test(u) ||
const
isiOS
=
/
(
iPhone|iPad|iPod|iOS
)
/i
.
test
(
u
);
// ios终端
const
isAndroid
=
/Android/i
.
test
(
u
);
// android终端
const
isWechat
=
/MicroMessenger/i
.
test
(
navigator
.
userAgent
);
const
isMobileQQ
=
/MQQBrowser.+QQ/i
.
test
(
navigator
.
userAgent
);
const
isWechatDevtool
=
/wechatdevtools/i
.
test
(
u
);
// 微信开发者工具
const
nodownload
=
document
.
getElementById
(
'no-download'
);
// 页面不需要下载
...
...
@@ -122,7 +122,7 @@ const canOpenApp = () => {
return
isAndroid
||
isiOS
;
};
export
default
()
=>
{
export
default
function
openApp
()
{
if
(
canOpenApp
())
{
setTimeout
(
function
()
{
let
appPath
=
getAppPath
();
...
...
@@ -130,4 +130,9 @@ export default () => {
toAppPage
(
appPath
,
false
);
},
1000
);
}
};
}
// 在 android 中,不在微信和QQ和App中,打开页面
if
(
isAndroid
&&
!
(
isMobileQQ
||
isWechat
)
&&
!
isApp
)
{
openApp
();
}
...
...
apps/common/yoho.js
View file @
06e486f
...
...
@@ -58,8 +58,8 @@ const yoho = {
isiOS
:
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/i
.
test
(
navigator
.
userAgent
||
''
),
isAndroid
:
/Android/i
.
test
(
navigator
.
userAgent
||
''
),
isYohoBuy
:
isYohoBuy
,
isWechat
:
/MQQBrowser.+MicroMessenger/i
.
test
(
navigator
.
userAgent
),
isMobileQQ
:
/MQQBrowser.+QQ/i
.
test
(
navigator
.
userAgent
),
isWechat
:
/MicroMessenger/i
.
test
(
navigator
.
userAgent
),
isMobileQQ
:
/QQ/i
.
test
(
navigator
.
userAgent
),
isLocal
:
window
.
location
.
protocol
===
'yoho-protocol:'
||
/yoho-protocol/i
.
test
(
navigator
.
userAgent
||
''
),
appVersion
:
getAppVersion
(
navigator
.
userAgent
,
';'
)
||
getAppVersion
(
document
.
cookie
,
';'
),
...
...
package.json
View file @
06e486f
{
"name"
:
"yoho-community-web"
,
"version"
:
"6.9.10-beta
4
"
,
"version"
:
"6.9.10-beta
5
"
,
"private"
:
true
,
"description"
:
"A New Yohobuy Project With Express"
,
"repository"
:
{
...
...
Please
register
or
login
to post a comment