Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
libai
/
Static
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3a146412
authored
5 years ago
by
dabai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cdn
parent
5e963e91
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
0 deletions
js/common.js
js/data.json
js/common.js
0 → 100644
View file @
3a146412
$
.
ajaxSetup
({
global
:
false
,
type
:
'post'
,
dataType
:
"JSON"
,
data
:
{
os
:
'WEB'
,
cid
:
'web_gw'
,
lang
:
2
,
uid
:
url_get_params
().
uid
,
token
:
url_get_params
().
token
}
})
//時間加0
function
add0
(
m
)
{
return
m
<
10
?
'0'
+
m
+
""
:
m
+
""
}
//获取url参数
function
url_get_params
()
{
var
url
=
location
.
href
;
var
theRequest
=
new
Object
();
if
(
url
.
indexOf
(
"?"
)
!=
-
1
)
{
var
str
=
url
.
substr
(
url
.
indexOf
(
"?"
)
+
1
);
strs
=
str
.
split
(
"&"
);
for
(
var
i
=
0
;
i
<
strs
.
length
;
i
++
)
{
theRequest
[
strs
[
i
].
split
(
"="
)[
0
]]
=
unescape
(
strs
[
i
].
split
(
"="
)[
1
]);
}
}
return
theRequest
;
}
function
close
()
{
var
obj
=
{
"cid"
:
14
,
"reqCode"
:
new
Date
().
getTime
(),
"data"
:
{
"msg"
:
'關閉半屏網頁'
,
}
}
var
obj2
=
JSON
.
stringify
(
obj
);
appCollaboration
(
obj2
);
}
function
appCollaboration
(
msg
)
{
var
sUserAgent
=
navigator
.
userAgent
.
toLowerCase
();
var
bIsIpad
=
sUserAgent
.
match
(
/ipad/i
)
==
"ipad"
;
var
bIsIphoneOs
=
sUserAgent
.
match
(
/iphone os/i
)
==
"iphone os"
;
var
bIsMidp
=
sUserAgent
.
match
(
/midp/i
)
==
"midp"
;
var
bIsUc7
=
sUserAgent
.
match
(
/rv:1.2.3.4/i
)
==
"rv:1.2.3.4"
;
var
bIsUc
=
sUserAgent
.
match
(
/ucweb/i
)
==
"ucweb"
;
var
bIsAndroid
=
sUserAgent
.
match
(
/android/i
)
==
"android"
;
var
bIsCE
=
sUserAgent
.
match
(
/windows ce/i
)
==
"windows ce"
;
var
bIsWM
=
sUserAgent
.
match
(
/windows mobile/i
)
==
"windows mobile"
;
if
(
!
(
bIsIpad
||
bIsIphoneOs
||
bIsMidp
||
bIsUc7
||
bIsUc
||
bIsAndroid
||
bIsCE
||
bIsWM
))
{}
else
if
(
bIsAndroid
)
{
window
.
yazhai
.
appCollaboration
(
msg
);
}
else
if
(
bIsIphoneOs
||
bIsIpad
)
{
window
.
webkit
.
messageHandlers
.
appCollaboration
.
postMessage
(
msg
);
}
}
//客户端回调结果
function
appCallback
(
msg
)
{
console
.
log
(
msg
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/data.json
deleted
100644 → 0
View file @
5e963e91
This diff is collapsed.
Click to expand it.
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