Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
pingan-charity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
41c48082
authored
Feb 23, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
cf570cd0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
1 deletions
+54
-1
Public/static/js/common.js
+54
-1
No files found.
Public/static/js/common.js
View file @
41c48082
...
...
@@ -87,6 +87,29 @@ const linkAddress = {
'link20'
:
'https://mp.weixin.qq.com/mp/homepage?__biz=MzU4OTQ0ODQ5OQ==&hid=7&sn=259750919ccdb2b34a17e2e64d3fb8ea&scene=1&devicetype=iOS12.3.1&version=1700092d&lang=zh_CN&nettype=3G+&ascene=7&session_us=gh_a1afb9b2b88b&fontScale=100&wx_header=1'
};
let
readingJson
=
{
// 'link1':0,
// 'link2':0,
// 'link3':0,
// 'link4':0,
// 'link5':0,
// 'link6':0,
// 'link7':0,
// 'link8':0,
// 'link9':0,
// 'link10':0,
// 'link11':0,
// 'link12':0,
// 'link13':0,
// 'link14':0,
// 'link15':0,
// 'link16':0,
// 'link17':0,
// 'link18':0,
// 'link19':0,
// 'link20':0
};
$
(
'.video1'
).
append
(
'<video controls poster="/Public/static/image2/video1.jpg" webkit-playsinline="webkit-playsinline" playsinline="playsinline" x5-playsinline="x5-playsinline" x-webkit-airplay="allow" src="/Public/static/media/video1.mp4" id="video1"></video>'
);
$
(
'.video2'
).
append
(
'<video controls poster="/Public/static/image2/video2.jpg" webkit-playsinline="webkit-playsinline" playsinline="playsinline" x5-playsinline="x5-playsinline" x-webkit-airplay="allow" src="/Public/static/media/video2.mp4" id="video2"></video>'
);
$
(
'.video3'
).
append
(
'<video controls poster="/Public/static/image2/video3.jpg" webkit-playsinline="webkit-playsinline" playsinline="playsinline" x5-playsinline="x5-playsinline" x-webkit-airplay="allow" src="/Public/static/media/video3.mp4" id="video3"></video>'
);
...
...
@@ -99,6 +122,9 @@ preloadimages(preloadImageList, function () {
},
function
(
progress
)
{});
$
(
document
).
ready
(
function
()
{
readingJson
=
JSON
.
stringify
(
getCookie
(
'reading'
));
console
.
log
(
readingJson
);
$
(
"input"
).
on
(
"blur"
,
function
()
{
window
.
scroll
(
0
,
0
);
//失焦后强制让页面归位
});
...
...
@@ -133,7 +159,8 @@ $(document).ready(function () {
},
jumpTolink
);
$
(
'.link1'
).
on
(
'click'
,
{
link
:
linkAddress
.
link1
link
:
linkAddress
.
link1
,
index
:
1
},
jumpTolink
);
$
(
'.link2'
).
on
(
'click'
,
{
link
:
linkAddress
.
link2
...
...
@@ -196,6 +223,11 @@ $(document).ready(function () {
function
jumpTolink
(
event
)
{
const
link
=
event
.
data
.
link
;
if
(
event
.
data
.
index
)
{
const
index
=
event
.
data
.
index
;
readingJson
[
'link'
+
index
]
=
1
;
setCookie
(
'reading'
,
JSON
.
parse
(
readingJson
));
}
window
.
location
.
href
=
link
;
}
...
...
@@ -248,4 +280,24 @@ function RandomNumBoth(Min, Max) {
var
Rand
=
Math
.
random
();
var
num
=
Min
+
Math
.
round
(
Rand
*
Range
);
//四舍五入
return
num
;
}
//写cookies
function
setCookie
(
name
,
value
)
{
var
Days
=
30
;
var
exp
=
new
Date
();
exp
.
setTime
(
exp
.
getTime
()
+
Days
*
24
*
60
*
60
*
1000
);
document
.
cookie
=
name
+
"="
+
escape
(
value
)
+
";expires="
+
exp
.
toGMTString
();
}
//读取cookies
function
getCookie
(
name
)
{
var
arr
,
reg
=
new
RegExp
(
"(^| )"
+
name
+
"=([^;]*)(;|$)"
);
if
(
arr
=
document
.
cookie
.
match
(
reg
))
return
unescape
(
arr
[
2
]);
else
return
null
;
}
\ 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