Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SURPRISED
Project
Project
Details
Activity
Releases
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
华国豪
SURPRISED
Commits
4c5ce7f6
Commit
4c5ce7f6
authored
Nov 15, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/huaguohao/surprised
parents
6c1d7b7c
328d0756
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
31 deletions
+30
-31
jquery.dataStatistics.js
js/jquery.dataStatistics.js
+30
-31
No files found.
js/jquery.dataStatistics.js
View file @
4c5ce7f6
...
...
@@ -8,10 +8,10 @@ $.fn.dataStatistics = function(options) {
couponId
:
0
,
//订单id
platform
:
'app'
,
count
:
0
,
login
:
true
,
activityStartDate
:
0
,
activityEndDate
:
0
,
nowDate
:
0
login
:
true
,
activityStartDate
:
0
,
activityEndDate
:
0
,
nowDate
:
0
},
options
||
{});
var
ths
=
this
;
//解决this指向问题
...
...
@@ -63,7 +63,8 @@ $.fn.dataStatistics = function(options) {
var
difference
=
0
;
//执行次数
var
nownumber
=
options
.
min
;
//优惠券数量
var
Activityendtime
=
''
;
//活动结束时间
let
nodisplay
=
false
;
let
nodisplay
=
false
;
function
run
(
diff
)
{
if
(
diff
)
{
difference
=
diff
...
...
@@ -83,7 +84,7 @@ $.fn.dataStatistics = function(options) {
$
(
'.img_btn p'
).
html
(
'活动结束'
)
$
(
'.box_content_t'
).
hide
()
$
(
'.img_btn'
).
css
(
"background-image"
,
"url(../images/nobuy_btn.png)"
);
if
(
nodisplay
==
true
)
{
//显示活动预告
if
(
nodisplay
==
true
)
{
//显示活动预告
$
(
'.dataStatistics'
).
css
(
'display'
,
"none"
);
$
(
'.deta_replace'
).
css
(
'display'
,
"flex"
);
$
(
'#notice'
).
css
(
'display'
,
"block"
);
...
...
@@ -147,7 +148,7 @@ $.fn.dataStatistics = function(options) {
type
:
"POST"
,
url
:
`
${
getApiUrl
().
urlJava
}
api/appActivity/getCurrentActivity`
,
contentType
:
"application/json"
,
data
:
getJavaData
({
couponId
:
options
.
couponId
}),
data
:
getJavaData
({
couponId
:
options
.
couponId
}),
async
:
false
,
success
:
function
(
res
)
{
if
(
res
.
resultCode
===
1
)
{
...
...
@@ -157,7 +158,7 @@ $.fn.dataStatistics = function(options) {
nownumber
=
res
.
data
.
repertory
;
// 算出现在的数字
if
(
num
>
0
)
{
if
(
num
>
5
)
{
if
(
num
>
5
)
{
$
(
'.digit_set'
).
empty
()
clearInterval
(
timer2
);
$
(
'.dataStatistics'
).
dataStatistics
({
...
...
@@ -168,16 +169,16 @@ $.fn.dataStatistics = function(options) {
price
:
options
.
price
,
couponId
:
options
.
couponId
,
platform
:
options
.
platform
,
login
:
options
.
login
,
login
:
options
.
login
,
count
:
options
.
count
,
//判断是否可以抢购 0为不可以
activityStartDate
:
options
.
activityStartDate
,
activityEndDate
:
options
.
activityEndDate
,
activityStartDate
:
options
.
activityStartDate
,
activityEndDate
:
options
.
activityEndDate
,
});
//刚进入页面不执行动画
}
else
{
}
else
{
run
(
num
)
}
}
else
if
(
num
<
0
)
{
}
else
if
(
num
<
0
)
{
$
(
'.digit_set'
).
empty
()
clearInterval
(
timer2
);
$
(
'.dataStatistics'
).
dataStatistics
({
...
...
@@ -188,10 +189,10 @@ $.fn.dataStatistics = function(options) {
price
:
options
.
price
,
couponId
:
options
.
couponId
,
platform
:
options
.
platform
,
login
:
options
.
login
,
login
:
options
.
login
,
count
:
options
.
count
,
//判断是否可以抢购 0为不可以
activityStartDate
:
options
.
activityStartDate
,
activityEndDate
:
options
.
activityEndDate
,
activityStartDate
:
options
.
activityStartDate
,
activityEndDate
:
options
.
activityEndDate
,
});
//刚进入页面不执行动画
}
...
...
@@ -269,19 +270,17 @@ $.fn.dataStatistics = function(options) {
$
(
'.img_btn'
).
click
(
function
()
{
if
(
$
(
'.img_btn p'
).
css
(
'color'
)
==
'rgb(224, 50, 52)'
)
{
//判断按钮是否可以点击
if
(
options
.
login
==
true
)
{
if
(
$
(
'.img_btn p'
).
css
(
'color'
)
==
'rgb(224, 50, 52)'
)
{
//判断按钮是否可以点击
if
(
options
.
login
==
true
)
{
if
(
options
.
count
!=
0
)
{
//判断是可以抢购
let
buyInfo
=
{
redemptionPrice
:
options
.
price
,
couponId
:
options
.
couponId
,
platform
:
options
.
platform
,
}
localStorage
.
buyInfo
=
JSON
.
stringify
(
buyInfo
)
window
.
location
.
href
=
'https://activity.oytour.com/html/Rushbuy.html'
;
// window.location.href = './Rushbuy.html' ;
// let buyInfo = {
// redemptionPrice: options.price,
// couponId: options.couponId,
// platform: options.platform,
// }
// localStorage.buyInfo = JSON.stringify(buyInfo)
window
.
location
.
href
=
`https://activity.oytour.com/html/Rushbuy.html?redemptionPrice=
${
options
.
price
}
&couponId=
${
options
.
couponId
}
&platform=
${
options
.
platform
}
`
;
}
else
{
let
data
=
{
'action'
:
'jump'
,
// showToast->一个提示信息 showHud->一个黑色的loading
...
...
@@ -292,12 +291,12 @@ $.fn.dataStatistics = function(options) {
}
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
(
data
));
}
else
if
(
options
.
platform
==
'H5'
)
{
}
else
if
(
options
.
platform
==
'H5'
)
{
window
.
location
.
href
=
'https://activity.oytour.com/html/downloadApp.html'
}
}
}
else
{
}
else
{
window
.
location
.
href
=
'https://activity.oytour.com/html/login.html'
}
}
else
{
...
...
@@ -318,4 +317,4 @@ $.fn.dataStatistics = function(options) {
}
})
};
};
\ 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