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
cbf01efa
Commit
cbf01efa
authored
Nov 13, 2019
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JS支付
parent
4e6a81a6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
476 additions
and
437 deletions
+476
-437
GT_activities.html
html/GT_activities.html
+1
-1
pay.html
html/pay.html
+151
-107
jquery.dataStatistics.js
js/jquery.dataStatistics.js
+324
-329
No files found.
html/GT_activities.html
View file @
cbf01efa
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
<!--<script type="text/javascript" src="js/countdown.js"></script>-->
<!--<script type="text/javascript" src="js/countdown.js"></script>-->
<script
type=
"text/javascript"
src=
"../js/md5.js"
></script>
<script
type=
"text/javascript"
src=
"../js/md5.js"
></script>
<script
type=
"text/javascript"
src=
"../js/mian.js"
></script>
<script
type=
"text/javascript"
src=
"../js/mian.js"
></script>
<script
src=
"../js/jquery.dataStatistics.js"
></script>
<script
src=
"../js/jquery.dataStatistics.js
?r=1354341
"
></script>
<script
type=
"text/javascript"
src=
"https://res.wx.qq.com/open/js/jweixin-1.3.2.js"
></script>
<script
type=
"text/javascript"
src=
"https://res.wx.qq.com/open/js/jweixin-1.3.2.js"
></script>
<script
type=
"text/javascript"
src=
"../js/layer/layer.js"
></script>
<script
type=
"text/javascript"
src=
"../js/layer/layer.js"
></script>
<script
type=
"text/javascript"
src=
"../js/yql.js"
></script>
<script
type=
"text/javascript"
src=
"../js/yql.js"
></script>
...
...
html/pay.html
View file @
cbf01efa
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
http-equiv=
"Content-Type"
content=
"span/html; charset=utf-8"
/>
<meta
http-equiv=
"Content-Type"
content=
"span/html; charset=utf-8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"divport"
<meta
name=
"divport"
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"
/>
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
>
<meta
name=
"screen-orientation"
content=
"portrait"
>
</meta>
</meta>
<meta
name=
"x5-orientation"
content=
"portrait"
>
<meta
name=
"x5-orientation"
content=
"portrait"
>
...
@@ -11,93 +11,134 @@
...
@@ -11,93 +11,134 @@
<title>
支付订单
</title>
<title>
支付订单
</title>
</head>
</head>
<style>
<style>
body
,
div
,
dl
,
dt
,
dd
,
ul
,
ol
,
li
,
h1
,
h2
,
h3
,
h4
,
h5
,
h6
,
pre
,
code
,
form
,
fieldset
,
legend
,
input
,
button
,
spanarea
,
p
,
blockquote
,
th
,
td
{
body
,
div
,
dl
,
dt
,
dd
,
ul
,
ol
,
li
,
h1
,
h2
,
h3
,
h4
,
h5
,
h6
,
pre
,
code
,
form
,
fieldset
,
legend
,
input
,
button
,
spanarea
,
p
,
blockquote
,
th
,
td
{
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
}
}
.pay_page
{
width
:
100%
;
.pay_page
{
height
:
100%
;
width
:
100%
;
height
:
100%
;
background-color
:
#F4F4F4
;
background-color
:
#F4F4F4
;
position
:
relative
;
position
:
relative
;
}
}
.pay_time
{
width
:
100%
;
.pay_time
{
width
:
100%
;
text-align
:
center
;
text-align
:
center
;
font-size
:
2rem
;
font-size
:
2rem
;
color
:
#999999
;
color
:
#999999
;
padding
:
5rem
0
2rem
0
;
padding
:
5rem
0
2rem
0
;
}
}
.pay_time
span
{
margin-left
:
1rem
;
.pay_time
span
{
margin-left
:
1rem
;
}
}
.pay_price
{
font-size
:
4rem
;
.pay_price
{
width
:
100%
;
font-size
:
4rem
;
width
:
100%
;
text-align
:
center
;
text-align
:
center
;
}
}
.pay_price
span
:first-child
{
font-size
:
2rem
;
.pay_price
span
:first-child
{
font-size
:
2rem
;
}
}
.pay_quan
{
margin
:
2rem
0
0
0
;
.pay_quan
{
width
:
100%
;
margin
:
2rem
0
0
0
;
width
:
100%
;
text-align
:
center
;
text-align
:
center
;
color
:
#999999
;
color
:
#999999
;
font-size
:
2rem
;
font-size
:
2rem
;
}
}
.price_Top
{
.price_Top
{
background-color
:
#fff
;
background-color
:
#fff
;
}
}
.pay_zhifu
{
width
:
90%
;
.pay_zhifu
{
height
:
10rem
;
width
:
90%
;
height
:
10rem
;
display
:
flex
;
display
:
flex
;
margin
:
4rem
auto
;
margin
:
4rem
auto
;
align-items
:
center
;
align-items
:
center
;
}
}
.pay_circle
{
width
:
3rem
;
.pay_circle
{
height
:
3rem
;
width
:
3rem
;
border
:
1px
solid
#CCCCCC
;
height
:
3rem
;
border
:
1px
solid
#CCCCCC
;
border-radius
:
50%
;
border-radius
:
50%
;
}
}
.pay_one
{
width
:
3rem
;
.pay_one
{
height
:
3rem
;
width
:
3rem
;
height
:
3rem
;
}
}
.pay_two
{
.pay_two
{
display
:
inline-block
;
display
:
inline-block
;
font-size
:
2.5rem
;
font-size
:
2.5rem
;
margin-left
:
3rem
;
margin-left
:
3rem
;
width
:
47rem
;
width
:
47rem
;
}
}
.pay_three
{
display
:
inline-block
;
.pay_three
{
display
:
inline-block
;
}
}
.pay_three
img
{
width
:
3rem
;
.pay_three
img
{
height
:
3rem
;
width
:
3rem
;
height
:
3rem
;
}
}
.pay_btndiv
{
width
:
100%
;
.pay_btndiv
{
width
:
100%
;
position
:
absolute
;
position
:
absolute
;
bottom
:
4rem
;
bottom
:
4rem
;
text-align
:
center
;
text-align
:
center
;
}
}
.pay_btn
{
width
:
92%
;
.pay_btn
{
height
:
8rem
;
width
:
92%
;
height
:
8rem
;
background-color
:
#EE4454
;
background-color
:
#EE4454
;
color
:
#fff
;
color
:
#fff
;
font-size
:
2.5rem
;
font-size
:
2.5rem
;
outline
:
none
;
outline
:
none
;
border
:
0
;
border
:
0
;
border-radius
:
1.5rem
;
border-radius
:
1.5rem
;
}
}
.layui-layer-content
{
font-size
:
1.8rem
!important
;
.layui-layer-content
{
padding
:
2rem
1rem
!important
;
font-size
:
1.8rem
!important
;
padding
:
2rem
1rem
!important
;
}
}
</style>
</style>
...
@@ -114,11 +155,11 @@
...
@@ -114,11 +155,11 @@
</div>
</div>
<div
class=
"pay_zhifu"
>
<div
class=
"pay_zhifu"
>
<img
class=
"pay_one"
src=
"../images/login/wechat.png"
alt=
""
/>
<img
class=
"pay_one"
src=
"../images/login/wechat.png"
alt=
""
/>
<span
class=
"pay_two"
>
微信支付
</span>
<span
class=
"pay_two"
>
微信支付
</span>
<div
class=
"pay_three"
>
<div
class=
"pay_three"
>
<!-- <div class="pay_circle"></div> -->
<!-- <div class="pay_circle"></div> -->
<img
src=
"../images/login/checkbox.png"
aly=
""
/>
<img
src=
"../images/login/checkbox.png"
aly=
""
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -133,33 +174,34 @@
...
@@ -133,33 +174,34 @@
<script
src=
"../js/md5.js"
></script>
<script
src=
"../js/md5.js"
></script>
<script>
<script>
$
(
function
(){
$
(
function
()
{
if
(
sessionStorage
.
getItem
(
"payInfo"
))
{
if
(
sessionStorage
.
getItem
(
"payInfo"
))
{
let
msgList
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"payInfo"
));
let
msgList
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"payInfo"
));
$
(
"#pay_money"
).
html
(
msgList
.
dTotalPrice
);
$
(
"#pay_money"
).
html
(
msgList
.
dTotalPrice
);
$
(
".pay_quan"
).
html
(
msgList
.
sProductName
);
$
(
".pay_quan"
).
html
(
msgList
.
sProductName
);
}
}
countdown
();
countdown
();
})
})
var
second
=
180000
;
var
second
=
180000
;
var
payBtn
=
true
;
var
payBtn
=
true
;
var
changesecond
=
''
;
var
changesecond
=
''
;
//倒计时
//倒计时
function
countdown
()
{
function
countdown
()
{
if
(
second
==
0
)
{
if
(
second
==
0
)
{
payBtn
=
false
;
payBtn
=
false
;
changesecond
=
'00:00'
;
changesecond
=
'00:00'
;
$
(
".daojishi"
).
html
(
changesecond
);
$
(
".daojishi"
).
html
(
changesecond
);
return
;
return
;
}
}
var
time
=
setTimeout
(
function
()
{
var
time
=
setTimeout
(
function
()
{
let
str
=
formatSeconds
(
second
);
let
str
=
formatSeconds
(
second
);
second
=
second
-
1
;
second
=
second
-
1
;
changesecond
=
str
;
changesecond
=
str
;
$
(
".daojishi"
).
html
(
changesecond
);
$
(
".daojishi"
).
html
(
changesecond
);
countdown
();
countdown
();
},
1000
)
},
1000
)
};
};
function
formatSeconds
(
value
)
{
function
formatSeconds
(
value
)
{
var
theTime
=
parseInt
(
value
);
// 秒
var
theTime
=
parseInt
(
value
);
// 秒
var
theTime1
=
0
;
// 分
var
theTime1
=
0
;
// 分
...
@@ -185,53 +227,54 @@
...
@@ -185,53 +227,54 @@
return
result
;
return
result
;
};
};
function
pay
()
{
function
pay
()
{
if
(
!
localStorage
.
openid
)
{
if
(
!
localStorage
.
openid
)
{
window
.
location
.
href
=
'http://activity.oytour.com/html/GT_activities.html'
;
window
.
location
.
href
=
'http://activity.oytour.com/html/GT_activities.html'
;
}
}
if
(
!
payBtn
)
{
if
(
!
payBtn
)
{
layer
.
msg
(
'您已经超出支付时间!'
);
layer
.
msg
(
'您已经超出支付时间!'
);
}
}
var
payMsg
;
var
payMsg
;
if
(
sessionStorage
.
getItem
(
"payInfo"
))
{
if
(
sessionStorage
.
getItem
(
"payInfo"
))
{
payMsg
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"payInfo"
));
payMsg
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"payInfo"
));
}
}
let
msg
=
{
let
msg
=
{
sOrderNo
:
payMsg
.
sOrderNo
,
//订单号
sOrderNo
:
payMsg
.
sOrderNo
,
//订单号
dTotalPrice
:
payMsg
.
dTotalPrice
,
//总价
dTotalPrice
:
payMsg
.
dTotalPrice
,
//总价
sProductName
:
payMsg
.
sProductName
,
sProductName
:
payMsg
.
sProductName
,
sCurOpenID
:
localStorage
.
openid
sCurOpenID
:
localStorage
.
openid
}
}
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
url
:
`https://reborn.oytour.com/api/WeChatNotify/
WechatOpenId?sOrderNo=
${
payMsg
.
sOrderNo
}
&sCurOpenID=
${
localStorage
.
openid
}
&domainName=http://reborn.oytour.com/api/WeChatNotify/DoPay
`
,
url
:
`https://reborn.oytour.com/api/WeChatNotify/
DoPay?sOrderNo=
${
payMsg
.
sOrderNo
}
&sCurOpenID=
${
localStorage
.
openid
}
`
,
contentType
:
"application/json"
,
contentType
:
"application/json"
,
async
:
false
,
async
:
false
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
resultCode
===
1
)
{
if
(
res
.
resultCode
===
1
)
{
let
d
=
JSON
.
parse
(
res
.
data
);
let
d
=
JSON
.
parse
(
res
.
data
);
onBridgeReady
(
d
.
appId
,
d
.
timeStamp
,
d
.
nonceStr
,
d
.
package
,
d
.
payS
ign
);
onBridgeReady
(
d
.
appId
,
d
.
timeStamp
,
d
.
nonceStr
,
d
.
package
,
d
.
s
ign
);
}
else
{
}
else
{
layer
.
msg
(
res
.
message
);
layer
.
msg
(
res
.
message
);
}
}
},
},
error
:
function
(
res
)
{
error
:
function
(
res
)
{
// layer.msg(res.message);
// layer.msg(res.message);
}
}
});
});
if
(
typeof
WeixinJSBridge
==
"undefined"
){
if
(
typeof
WeixinJSBridge
==
"undefined"
)
{
if
(
document
.
addEventListener
)
{
if
(
document
.
addEventListener
)
{
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
onBridgeReady
,
false
);
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
onBridgeReady
,
false
);
}
else
if
(
document
.
attachEvent
)
{
}
else
if
(
document
.
attachEvent
)
{
document
.
attachEvent
(
'WeixinJSBridgeReady'
,
onBridgeReady
);
document
.
attachEvent
(
'WeixinJSBridgeReady'
,
onBridgeReady
);
document
.
attachEvent
(
'onWeixinJSBridgeReady'
,
onBridgeReady
);
document
.
attachEvent
(
'onWeixinJSBridgeReady'
,
onBridgeReady
);
}
}
}
else
{
}
else
{
// onBridgeReady();
// onBridgeReady();
}
}
}
}
function
onBridgeReady
(
id
,
ts
,
ns
,
pa
,
ps
)
{
function
onBridgeReady
(
id
,
ts
,
ns
,
pa
,
ps
)
{
WeixinJSBridge
.
invoke
(
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
{
'getBrandWCPayRequest'
,
{
"appId"
:
id
,
//公众号名称,由商户传入
"appId"
:
id
,
//公众号名称,由商户传入
...
@@ -241,7 +284,7 @@
...
@@ -241,7 +284,7 @@
"signType"
:
"MD5"
,
//微信签名方式:
"signType"
:
"MD5"
,
//微信签名方式:
"paySign"
:
ps
//微信签名
"paySign"
:
ps
//微信签名
},
},
function
(
res
)
{
function
(
res
)
{
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
)
{
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
)
{
// 使用以上方式判断前端返回,微信团队郑重提示:
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
...
@@ -250,4 +293,5 @@
...
@@ -250,4 +293,5 @@
});
});
}
}
</script>
</script>
</html>
</html>
\ No newline at end of file
js/jquery.dataStatistics.js
View file @
cbf01efa
$
.
fn
.
dataStatistics
=
function
(
options
)
{
$
.
fn
.
dataStatistics
=
function
(
options
){
options
=
$
.
extend
({
options
=
$
.
extend
({
max
:
500
,
//初始数值
max
:
500
,
//初始数值
min
:
0
,
//最大数字
min
:
0
,
//最大数字
time
:
60000
,
//时长
time
:
60000
,
//时长
len
:
4
,
//数字是几位数
len
:
4
,
//数字是几位数
price
:
0
,
//金额
price
:
0
,
//金额
couponId
:
0
,
//订单id
couponId
:
0
,
//订单id
platform
:
'app'
,
platform
:
'app'
,
count
:
0
,
count
:
0
,
},
options
||
{});
},
options
||
{});
var
ths
=
this
;
//解决this指向问题
var
ths
=
this
;
//解决this指向问题
//初始化---------------------------------------start
//初始化---------------------------------------start
...
@@ -31,27 +30,27 @@ $.fn.dataStatistics = function(options){
...
@@ -31,27 +30,27 @@ $.fn.dataStatistics = function(options){
//初始化值
//初始化值
var
nowNums
=
zfill
(
options
.
max
,
options
.
len
).
toString
().
split
(
""
);
var
nowNums
=
zfill
(
options
.
max
,
options
.
len
).
toString
().
split
(
""
);
//补0
//补0
function
zfill
(
num
,
size
)
{
function
zfill
(
num
,
size
)
{
var
s
=
"000"
+
num
;
var
s
=
"000"
+
num
;
return
s
.
substr
(
s
.
length
-
size
);
return
s
.
substr
(
s
.
length
-
size
);
}
}
ths
.
find
(
'.digit_set'
).
each
(
function
()
{
ths
.
find
(
'.digit_set'
).
each
(
function
()
{
for
(
i
=
0
;
i
<=
9
;
i
++
)
{
for
(
i
=
0
;
i
<=
9
;
i
++
)
{
$
(
this
).
append
(
html
);
$
(
this
).
append
(
html
);
currentDigit
=
$
(
this
).
find
(
'.digit'
)[
i
];
currentDigit
=
$
(
this
).
find
(
'.digit'
)[
i
];
$
(
currentDigit
).
find
(
'.digit_wrap'
).
append
(
9
-
i
);
$
(
currentDigit
).
find
(
'.digit_wrap'
).
append
(
9
-
i
);
}
}
});
});
//初始化数值填入
//初始化数值填入
$
.
each
(
nowNums
,
function
(
index
,
val
)
{
$
.
each
(
nowNums
,
function
(
index
,
val
)
{
var
set
=
ths
.
find
(
'.digit_set'
).
eq
(
index
);
var
set
=
ths
.
find
(
'.digit_set'
).
eq
(
index
);
var
i
=
parseInt
(
val
)
var
i
=
parseInt
(
val
)
set
.
find
(
'.digit'
).
eq
(
9
-
i
).
addClass
(
'active'
);
set
.
find
(
'.digit'
).
eq
(
9
-
i
).
addClass
(
'active'
);
set
.
find
(
'.digit'
).
eq
(
9
-
i
+
1
).
addClass
(
'previous'
);
set
.
find
(
'.digit'
).
eq
(
9
-
i
+
1
).
addClass
(
'previous'
);
});
});
//初始化---------------------------------------end
//初始化---------------------------------------end
...
@@ -60,23 +59,23 @@ $.fn.dataStatistics = function(options){
...
@@ -60,23 +59,23 @@ $.fn.dataStatistics = function(options){
var
difference
=
0
;
//执行次数
var
difference
=
0
;
//执行次数
var
nownumber
=
options
.
min
;
//优惠券数量
var
nownumber
=
options
.
min
;
//优惠券数量
var
Activityendtime
=
''
;
//活动结束时间
var
Activityendtime
=
''
;
//活动结束时间
function
run
(
diff
)
{
function
run
(
diff
)
{
if
(
diff
)
{
if
(
diff
)
{
difference
=
diff
difference
=
diff
}
else
{
}
else
{
difference
=
options
.
max
-
options
.
min
;
//要执行动画的次数
difference
=
options
.
max
-
options
.
min
;
//要执行动画的次数
}
}
if
(
nownumber
==
0
)
{
//优惠券没有的时候处理
if
(
nownumber
==
0
)
{
//优惠券没有的时候处理
clearInterval
(
timer2
);
//优惠券用完 清楚定时器
clearInterval
(
timer2
);
//优惠券用完 清楚定时器
$
(
".received_img"
).
attr
(
"src"
,
""
);
$
(
".received_img"
).
attr
(
"src"
,
""
);
$
(
'.img_bg_M'
).
css
(
"background-image"
,
"url(../images/MJ_200@3x.png)"
);
$
(
'.img_bg_M'
).
css
(
"background-image"
,
"url(../images/MJ_200@3x.png)"
);
$
(
'.img_bg_p1'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p1'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p2'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p2'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_btn p'
).
css
(
"color"
,
"#FFFFFF"
);
$
(
'.img_btn p'
).
css
(
"color"
,
"#FFFFFF"
);
$
(
'.img_btn p'
).
html
(
'活动结束'
)
$
(
'.img_btn p'
).
html
(
'活动结束'
)
$
(
'.box_content_t'
).
hide
()
$
(
'.box_content_t'
).
hide
()
$
(
'.img_btn'
).
css
(
"background-color"
,
"#CCCCCC"
);
$
(
'.img_btn'
).
css
(
"background-color"
,
"#CCCCCC"
);
...
@@ -87,7 +86,7 @@ $.fn.dataStatistics = function(options){
...
@@ -87,7 +86,7 @@ $.fn.dataStatistics = function(options){
//后一位数
//后一位数
function
increase
()
{
function
increase
()
{
//执行次数为0时,停止执行
//执行次数为0时,停止执行
if
(
difference
<
1
)
{
if
(
difference
<
1
)
{
clearInterval
(
timer1
);
clearInterval
(
timer1
);
return
false
;
return
false
;
...
@@ -110,11 +109,11 @@ $.fn.dataStatistics = function(options){
...
@@ -110,11 +109,11 @@ $.fn.dataStatistics = function(options){
}
}
}
}
var
timer1
=
setInterval
(
increase
,
1000
);
var
timer1
=
setInterval
(
increase
,
1000
);
}
}
//当数字翻到9的时候,前一位数执行一次动画
//当数字翻到9的时候,前一位数执行一次动画
function
prevNumber
(
ths
)
{
function
prevNumber
(
ths
)
{
var
current
=
ths
.
find
(
'.active'
),
var
current
=
ths
.
find
(
'.active'
),
previous
=
ths
.
find
(
'.previous'
);
previous
=
ths
.
find
(
'.previous'
);
previous
.
removeClass
(
'previous'
);
previous
.
removeClass
(
'previous'
);
...
@@ -123,7 +122,7 @@ $.fn.dataStatistics = function(options){
...
@@ -123,7 +122,7 @@ $.fn.dataStatistics = function(options){
if
(
current
.
next
().
length
==
0
)
{
if
(
current
.
next
().
length
==
0
)
{
ths
.
find
(
'.digit:first-child'
).
addClass
(
'active'
);
ths
.
find
(
'.digit:first-child'
).
addClass
(
'active'
);
var
prev
=
ths
.
prev
();
var
prev
=
ths
.
prev
();
if
(
prev
.
length
>
0
)
{
if
(
prev
.
length
>
0
)
{
prevNumber
(
prev
);
prevNumber
(
prev
);
}
}
}
else
{
}
else
{
...
@@ -132,65 +131,65 @@ $.fn.dataStatistics = function(options){
...
@@ -132,65 +131,65 @@ $.fn.dataStatistics = function(options){
}
}
run
();
run
();
var
timer2
=
setInterval
(()
=>
{
var
timer2
=
setInterval
(()
=>
{
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
url
:
`
${
getApiUrl
().
urlJava
}
api/appActivity/getUserPurchaseTime`
,
url
:
`
${
getApiUrl
().
urlJava
}
api/appActivity/getUserPurchaseTime`
,
contentType
:
"application/json"
,
contentType
:
"application/json"
,
data
:
getJavaData
({}),
data
:
getJavaData
({}),
async
:
false
,
async
:
false
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
resultCode
===
1
)
{
if
(
res
.
resultCode
===
1
)
{
if
(
nownumber
>
0
)
{
if
(
nownumber
>
0
)
{
let
num
=
nownumber
-
res
.
data
.
repertory
;
// 算出动画执行的次数
let
num
=
nownumber
-
res
.
data
.
repertory
;
// 算出动画执行的次数
nownumber
=
res
.
data
.
repertory
;
// 算出现在的数字
nownumber
=
res
.
data
.
repertory
;
// 算出现在的数字
// let num = 475 ; // 算出动画执行的次数
// let num = 475 ; // 算出动画执行的次数
// nownumber = 0; // 算出现在的数字
// nownumber = 0; // 算出现在的数字
if
(
num
>
0
)
{
if
(
num
>
0
)
{
run
(
num
)
run
(
num
)
}
}
if
(
nownumber
==
0
)
{
if
(
nownumber
==
0
)
{
Activityendtime
=
res
.
data
.
expirationDate
.
replace
(
'T'
,
' '
).
replace
(
/-/g
,
'/'
);
Activityendtime
=
res
.
data
.
expirationDate
.
replace
(
'T'
,
' '
).
replace
(
/-/g
,
'/'
);
}
}
options
.
count
=
res
.
data
.
count
;
options
.
count
=
res
.
data
.
count
;
let
activityStartDate
=
new
Date
(
res
.
data
.
activityStartDate
.
replace
(
'T'
,
' '
).
replace
(
/-/g
,
'/'
)).
getTime
();
let
activityStartDate
=
new
Date
(
res
.
data
.
activityStartDate
.
replace
(
'T'
,
' '
).
replace
(
/-/g
,
'/'
)).
getTime
();
let
activityEndDate
=
new
Date
(
res
.
data
.
activityEndDate
.
replace
(
'T'
,
' '
).
replace
(
/-/g
,
'/'
)).
getTime
();
let
activityEndDate
=
new
Date
(
res
.
data
.
activityEndDate
.
replace
(
'T'
,
' '
).
replace
(
/-/g
,
'/'
)).
getTime
();
let
nowDate
=
new
Date
(
res
.
data
.
currentTime
.
replace
(
'T'
,
' '
).
replace
(
/-/g
,
'/'
)).
getTime
();
//服务器时间
let
nowDate
=
new
Date
(
res
.
data
.
currentTime
.
replace
(
'T'
,
' '
).
replace
(
/-/g
,
'/'
)).
getTime
();
//服务器时间
if
(
activityStartDate
>=
nowDate
){
//活动还没开始
if
(
activityStartDate
>=
nowDate
)
{
//活动还没开始
clearInterval
(
timer2
);
clearInterval
(
timer2
);
}
else
if
(
nowDate
>=
activityEndDate
)
{
//活动结束
}
else
if
(
nowDate
>=
activityEndDate
)
{
//活动结束
$
(
".received_img"
).
attr
(
"src"
,
""
);
$
(
".received_img"
).
attr
(
"src"
,
""
);
$
(
'.img_bg_M'
).
css
(
"background-image"
,
"url(../images/MJ_200@3x.png)"
);
$
(
'.img_bg_M'
).
css
(
"background-image"
,
"url(../images/MJ_200@3x.png)"
);
$
(
'.img_bg_p1'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p1'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p2'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p2'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_btn p'
).
css
(
"color"
,
"#FFFFFF"
);
$
(
'.img_btn p'
).
css
(
"color"
,
"#FFFFFF"
);
$
(
'.img_btn'
).
css
(
"background-color"
,
"#CCCCCC"
);
$
(
'.img_btn'
).
css
(
"background-color"
,
"#CCCCCC"
);
$
(
'.img_btn p'
).
html
(
'活动结束'
)
$
(
'.img_btn p'
).
html
(
'活动结束'
)
$
(
'.box_content_t'
).
hide
()
$
(
'.box_content_t'
).
hide
()
clearInterval
(
timer2
);
//活动结束 清楚定时器
clearInterval
(
timer2
);
//活动结束 清楚定时器
}
else
{
}
else
{
if
(
nownumber
>
0
)
{
if
(
nownumber
>
0
)
{
if
(
res
.
data
.
count
!=
0
)
{
if
(
res
.
data
.
count
!=
0
)
{
$
(
".received_img"
).
attr
(
"src"
,
""
);
$
(
".received_img"
).
attr
(
"src"
,
""
);
$
(
'.img_btn p'
).
html
(
res
.
data
.
redemptionPrice
+
'元抢购'
)
$
(
'.img_btn p'
).
html
(
res
.
data
.
redemptionPrice
+
'元抢购'
)
}
else
{
}
else
{
$
(
".received_img"
).
attr
(
"src"
,
"../images/received@3x.png"
);
$
(
".received_img"
).
attr
(
"src"
,
"../images/received@3x.png"
);
$
(
'.img_btn p'
).
html
(
'去使用'
)
$
(
'.img_btn p'
).
html
(
'去使用'
)
}
}
}
else
{
}
else
{
$
(
".received_img"
).
attr
(
"src"
,
""
);
$
(
".received_img"
).
attr
(
"src"
,
""
);
$
(
'.img_bg_M'
).
css
(
"background-image"
,
"url(../images/MJ_200@3x.png)"
);
$
(
'.img_bg_M'
).
css
(
"background-image"
,
"url(../images/MJ_200@3x.png)"
);
$
(
'.img_bg_p1'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p1'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p2'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_bg_p2'
).
css
(
"color"
,
"#CCCCCC"
);
$
(
'.img_btn p'
).
css
(
"color"
,
"#FFFFFF"
);
$
(
'.img_btn p'
).
css
(
"color"
,
"#FFFFFF"
);
$
(
'.img_btn p'
).
html
(
'活动结束'
)
$
(
'.img_btn p'
).
html
(
'活动结束'
)
$
(
'.box_content_t'
).
hide
()
$
(
'.box_content_t'
).
hide
()
$
(
'.img_btn'
).
css
(
"background-color"
,
"#CCCCCC"
);
$
(
'.img_btn'
).
css
(
"background-color"
,
"#CCCCCC"
);
...
@@ -199,37 +198,37 @@ $.fn.dataStatistics = function(options){
...
@@ -199,37 +198,37 @@ $.fn.dataStatistics = function(options){
}
}
}
else
{
}
else
{
clearInterval
(
timer2
);
//没有优惠券 清楚定时器
clearInterval
(
timer2
);
//没有优惠券 清楚定时器
}
}
}
else
{
}
else
{
clearInterval
(
timer2
);
//没有优惠券 清楚定时器
clearInterval
(
timer2
);
//没有优惠券 清楚定时器
}
}
},
},
error
:
function
(
res
)
{
error
:
function
(
res
)
{
}
}
});
});
},(
difference
+
5
)
*
1000
)
//5s请求一次接口
},
(
difference
+
5
)
*
1000
)
//5s请求一次接口
$
(
'.img_btn'
).
click
(
function
()
{
$
(
'.img_btn'
).
click
(
function
()
{
if
(
$
(
'.img_btn p'
).
css
(
'color'
)
==
'rgb(224, 50, 52)'
){
//判断按钮是否可以点击
if
(
$
(
'.img_btn p'
).
css
(
'color'
)
==
'rgb(224, 50, 52)'
)
{
//判断按钮是否可以点击
if
(
options
.
count
!=
0
){
//判断是可以抢购
if
(
options
.
count
!=
0
)
{
//判断是可以抢购
if
(
options
.
platform
==
'app'
)
{
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showHud'
,
'message'
:
'抢购中...'
}));
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showHud'
,
'message'
:
'抢购中...'
}));
}
}
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
url
:
`
${
getApiUrl
().
urlJava
}
api/appActivity/PanicBuyingCoupon`
,
url
:
`
${
getApiUrl
().
urlJava
}
api/appActivity/PanicBuyingCoupon`
,
contentType
:
"application/json"
,
contentType
:
"application/json"
,
data
:
getJavaData
({
redemptionPrice
:
options
.
price
,
couponId
:
options
.
couponId
,
productName
:
'印象之旅-200元无敌优惠券'
}),
data
:
getJavaData
({
redemptionPrice
:
options
.
price
,
couponId
:
options
.
couponId
,
productName
:
'印象之旅-200元无敌优惠券'
}),
async
:
false
,
async
:
false
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
options
.
platform
==
'app'
)
{
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'dismissHud'
}));
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'dismissHud'
}));
}
}
if
(
res
.
resultCode
===
1
)
{
if
(
res
.
resultCode
===
1
)
{
...
@@ -240,56 +239,55 @@ $.fn.dataStatistics = function(options){
...
@@ -240,56 +239,55 @@ $.fn.dataStatistics = function(options){
// clearInterval(timer3) //2,执行动画之后清除timer3
// clearInterval(timer3) //2,执行动画之后清除timer3
// },difference*1000)
// },difference*1000)
let
title
=
'印象之旅-200元无敌优惠券'
;
let
title
=
'印象之旅-200元无敌优惠券'
;
let
data
=
{
let
data
=
{
'action'
:
'jump'
,
// showToast->一个提示信息 showHud->一个黑色的loading
'action'
:
'jump'
,
// showToast->一个提示信息 showHud->一个黑色的loading
'page'
:
'payment'
,
'page'
:
'payment'
,
'pageData'
:
{
'pageData'
:
{
'couponId'
:
res
.
data
.
couponId
,
'couponId'
:
res
.
data
.
couponId
,
'title'
:
title
,
'title'
:
title
,
'price'
:
res
.
data
.
preferPrice
,
'price'
:
res
.
data
.
preferPrice
,
'backType'
:
'reload'
,
'backType'
:
'reload'
,
'data'
:
res
.
data
'data'
:
res
.
data
}
}
}
}
if
(
options
.
platform
==
'app'
)
{
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
(
data
));
window
.
postMessage
(
JSON
.
stringify
(
data
));
}
}
// 跳转到支付
// 跳转到支付
else
if
(
options
.
platform
==
'xcx'
)
{
else
if
(
options
.
platform
==
'xcx'
)
{
// window.postMessage(JSON.stringify(data));
// window.postMessage(JSON.stringify(data));
let
data
=
{};
let
data
=
{};
data
.
sOrderNo
=
res
.
data
.
id
;
data
.
sOrderNo
=
res
.
data
.
id
;
data
.
sProductName
=
title
;
data
.
sProductName
=
title
;
data
.
productId
=
res
.
data
.
couponId
;
data
.
productId
=
res
.
data
.
couponId
;
data
.
dTotalPrice
=
res
.
data
.
preferPrice
;
data
.
dTotalPrice
=
res
.
data
.
preferPrice
;
wx
.
miniProgram
.
getEnv
(
function
(
res
)
{
wx
.
miniProgram
.
getEnv
(
function
(
res
)
{
window
.
wx
.
miniProgram
.
navigateTo
({
window
.
wx
.
miniProgram
.
navigateTo
({
url
:
`/pages/Home/pay/pay?data=`
+
JSON
.
stringify
(
data
),
url
:
`/pages/Home/pay/pay?data=`
+
JSON
.
stringify
(
data
),
});
});
});
});
}
}
else
if
(
options
.
platform
==
'H5'
)
{
else
if
(
options
.
platform
==
'H5'
){
let
userInfo
=
getLocalStorage
()
let
userInfo
=
getLocalStorage
()
let
data
=
{};
let
data
=
{};
data
.
sOrderNo
=
res
.
data
.
id
;
data
.
sOrderNo
=
res
.
data
.
id
;
data
.
sProductName
=
title
;
data
.
sProductName
=
title
;
data
.
productId
=
res
.
data
.
couponId
;
data
.
productId
=
res
.
data
.
couponId
;
data
.
dTotalPrice
=
res
.
data
.
preferPrice
;
data
.
dTotalPrice
=
res
.
data
.
preferPrice
;
data
.
customerId
=
userInfo
.
customerId
;
data
.
customerId
=
userInfo
.
customerId
;
sessionStorage
.
setItem
(
"payInfo"
,
JSON
.
stringify
(
data
));
sessionStorage
.
setItem
(
"payInfo"
,
JSON
.
stringify
(
data
));
//window.location.href = 'http://127.0.0.1:5500/html/pay.html';
//window.location.href = 'http://127.0.0.1:5500/html/pay.html';
//window.location.href = 'http://192.168.0.117:5500/html/pay.html';
//window.location.href = 'http://192.168.0.117:5500/html/pay.html';
window
.
location
.
href
=
'http://
http://
activity.oytour.com/html/pay.html'
;
window
.
location
.
href
=
'http://activity.oytour.com/html/pay.html'
;
}
}
}
else
{
}
else
{
if
(
options
.
platform
==
'app'
)
{
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
res
.
message
}));
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
res
.
message
}));
}
else
{
}
else
{
layer
.
msg
(
res
.
message
)
layer
.
msg
(
res
.
message
)
}
}
layer
.
msg
(
res
.
message
)
layer
.
msg
(
res
.
message
)
...
@@ -298,39 +296,39 @@ $.fn.dataStatistics = function(options){
...
@@ -298,39 +296,39 @@ $.fn.dataStatistics = function(options){
}
}
},
},
error
:
function
(
res
)
{
error
:
function
(
res
)
{
console
.
log
(
options
.
platform
)
console
.
log
(
options
.
platform
)
if
(
options
.
platform
==
'app'
)
{
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'dismissHud'
}));
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'dismissHud'
}));
}
else
{
}
else
{
}
}
}
}
});
});
}
else
{
}
else
{
let
data
=
{
let
data
=
{
'action'
:
'jump'
,
// showToast->一个提示信息 showHud->一个黑色的loading
'action'
:
'jump'
,
// showToast->一个提示信息 showHud->一个黑色的loading
'page'
:
'teamWalker_2'
,
'page'
:
'teamWalker_2'
,
'pageData'
:
{
'pageData'
:
{
'backType'
:
'pop'
,
'backType'
:
'pop'
,
}
}
}
}
if
(
options
.
platform
==
'app'
)
{
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
(
data
));
window
.
postMessage
(
JSON
.
stringify
(
data
));
}
}
}
}
}
else
{
}
else
{
if
(
$
(
'.img_btn p'
).
text
()
==
'活动结束'
)
{
if
(
$
(
'.img_btn p'
).
text
()
==
'活动结束'
)
{
if
(
options
.
platform
==
'app'
)
{
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
'活动已结束'
}));
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
'活动已结束'
}));
}
else
{
}
else
{
layer
.
msg
(
'活动已结束'
)
layer
.
msg
(
'活动已结束'
)
}
}
}
else
{
}
else
{
if
(
options
.
platform
==
'app'
)
{
if
(
options
.
platform
==
'app'
)
{
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
'活动还未开始'
}));
window
.
postMessage
(
JSON
.
stringify
({
'action'
:
'showToast'
,
'message'
:
'活动还未开始'
}));
}
else
{
}
else
{
layer
.
msg
(
'活动还未开始'
)
layer
.
msg
(
'活动还未开始'
)
}
}
...
@@ -338,7 +336,4 @@ $.fn.dataStatistics = function(options){
...
@@ -338,7 +336,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