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
eceb4f05
Commit
eceb4f05
authored
Nov 13, 2019
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改丢失的代码
parent
7b532a90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
22 deletions
+25
-22
jquery.dataStatistics.js
js/jquery.dataStatistics.js
+25
-22
No files found.
js/jquery.dataStatistics.js
View file @
eceb4f05
...
...
@@ -7,7 +7,7 @@ $.fn.dataStatistics = function(options){
len
:
4
,
//数字是几位数
price
:
0
,
//金额
couponId
:
0
,
//订单id
platform
:
'
A
pp'
,
platform
:
'
a
pp'
,
count
:
0
,
},
options
||
{});
...
...
@@ -168,10 +168,8 @@ $.fn.dataStatistics = function(options){
$
(
'.img_bg_M'
).
css
(
"background-image"
,
"url(../images/MJ_200@3x.png)"
);
$
(
'.img_bg_p1'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p2'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_btn p'
).
css
(
"color"
,
"#FFFFFF"
);
$
(
'.img_btn'
).
css
(
"background-color"
,
"#CCCCCC"
);
$
(
'.img_btn p'
).
html
(
'活动结束'
)
$
(
'.box_content_t'
).
hide
()
clearInterval
(
timer2
);
//活动结束 清楚定时器
...
...
@@ -220,7 +218,7 @@ $.fn.dataStatistics = function(options){
if
(
$
(
'.img_btn p'
).
css
(
'color'
)
==
'rgb(224, 50, 52)'
){
//判断按钮是否可以点击
if
(
options
.
count
!=
0
){
//判断是可以抢购
if
(
options
.
platform
==
'
A
pp'
){
if
(
options
.
platform
==
'
a
pp'
){
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showHud'
,
'message'
:
'抢购中...'
}));
}
$
.
ajax
({
...
...
@@ -230,21 +228,17 @@ $.fn.dataStatistics = function(options){
data
:
getJavaData
({
redemptionPrice
:
options
.
price
,
couponId
:
options
.
couponId
}),
async
:
false
,
success
:
function
(
res
)
{
if
(
options
.
platform
==
'
A
pp'
){
if
(
options
.
platform
==
'
a
pp'
){
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'dismissHud'
}));
}
if
(
res
.
resultCode
===
1
)
{
if
(
options
.
platform
==
'App'
){
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
res
.
message
}));
}
else
{
layer
.
msg
(
res
.
message
)
}
var
timer3
=
setInterval
(()
=>
{
//1,需要timer2的定时器走完了 才走timer3的定时器
nownumber
=
nownumber
-
1
;
run
(
1
)
clearInterval
(
timer3
)
//2,执行动画之后清除timer3
},
difference
*
1000
)
// var timer3 = setInterval(()=>{ //1,需要timer2的定时器走完了 才走timer3的定时器
//
// nownumber = nownumber -1;
// run(1)
// clearInterval(timer3) //2,执行动画之后清除timer3
// },difference*1000)
let
title
=
'200元'
+
$
(
'.img_bg_p1'
).
html
();
let
data
=
{
...
...
@@ -255,11 +249,11 @@ $.fn.dataStatistics = function(options){
'couponId'
:
res
.
data
.
couponId
,
'title'
:
title
,
'price'
:
res
.
data
.
preferPrice
,
'back
Key
'
:
'reload'
,
'back
Type
'
:
'reload'
,
'data'
:
res
.
data
}
}
if
(
options
.
platform
==
'
A
pp'
){
if
(
options
.
platform
==
'
a
pp'
){
window
.
postMessage
(
JSON
.
stringify
(
data
));
}
// 跳转到支付
...
...
@@ -292,7 +286,7 @@ $.fn.dataStatistics = function(options){
}
else
{
if
(
options
.
platform
==
'
A
pp'
){
if
(
options
.
platform
==
'
a
pp'
){
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
res
.
message
}));
}
else
{
layer
.
msg
(
res
.
message
)
...
...
@@ -303,7 +297,7 @@ $.fn.dataStatistics = function(options){
},
error
:
function
(
res
)
{
console
.
log
(
options
.
platform
)
if
(
options
.
platform
==
'
A
pp'
){
if
(
options
.
platform
==
'
a
pp'
){
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'dismissHud'
}));
}
else
{
...
...
@@ -313,18 +307,27 @@ $.fn.dataStatistics = function(options){
}
});
}
else
{
layer
.
msg
(
'去使用优惠券'
)
let
data
=
{
'action'
:
'jump'
,
// showToast->一个提示信息 showHud->一个黑色的loading
'page'
:
'teamWalker_2'
,
'pageData'
:
{
'backType'
:
'pop'
,
}
}
if
(
options
.
platform
==
'app'
){
window
.
postMessage
(
JSON
.
stringify
(
data
));
}
}
}
else
{
if
(
$
(
'.img_btn p'
).
text
()
==
'活动结束'
){
if
(
options
.
platform
==
'
A
pp'
){
if
(
options
.
platform
==
'
a
pp'
){
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
'活动已结束'
}));
}
else
{
layer
.
msg
(
'活动已结束'
)
}
}
else
{
if
(
options
.
platform
==
'
A
pp'
){
if
(
options
.
platform
==
'
a
pp'
){
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
'活动还未开始'
}));
}
else
{
...
...
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