Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
9 years ago
Commit
306513dccc4591d5793ca7989b1ab2ef340eefc6
1 parent
2e9fe221
alert openid
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
static/js/me/pay.js
static/js/me/pay.js
View file @
306513d
...
...
@@ -29,7 +29,7 @@ if (window.wx) {
}
function
onBridgeReady
()
{
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
function
()
{
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
function
()
{
window
.
WeixinJSBridge
&&
window
.
WeixinJSBridge
.
call
(
'hideOptionMenu'
);
});
}
...
...
@@ -54,7 +54,7 @@ function jsApiCall(orderCode, jsApiParameters) {
window
.
WeixinJSBridge
&&
window
.
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
jsApiParameters
,
function
(
res
)
{
function
(
res
)
{
window
.
location
.
href
=
'/home/orders/detail?order_code='
+
orderCode
+
'&openId='
+
openId
;
}
);
...
...
@@ -73,6 +73,7 @@ function callpay(orderCode) {
document
.
attachEvent
(
'onWeixinJSBridgeReady'
,
jsApiCall
);
}
}
else
{
console
.
log
(
openId
,
'====='
);
$
.
ajax
({
type
:
'GET'
,
url
:
'/shopping/pay/wechatwapapi'
,
...
...
@@ -81,7 +82,7 @@ function callpay(orderCode) {
'openId'
:
openId
,
},
dataType
:
'json'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
code
===
200
)
{
jsApiParameters
=
res
.
data
.
jsApiParameters
;
jsApiCall
(
orderCode
,
jsApiParameters
);
...
...
@@ -89,10 +90,10 @@ function callpay(orderCode) {
tip
.
show
(
'微信支付调取失败'
);
}
},
error
:
function
()
{
error
:
function
()
{
tip
.
show
(
'请刷新本页面,完成微信支付'
);
},
complete
:
function
()
{
complete
:
function
()
{
$loadingToast
.
addClass
(
"hide"
);
}
});
...
...
@@ -109,7 +110,7 @@ function isWXOpen() {
function
hideWeChatPay
()
{
var
$payApps
=
$
(
'.app'
);
$payApps
.
each
(
function
(
idx
,
app
)
{
$payApps
.
each
(
function
(
idx
,
app
)
{
if
(
$
(
app
).
parent
().
attr
(
'id'
)
===
'weixin'
)
{
$
(
app
).
parent
().
css
(
'display'
,
'none'
);
return
false
;
...
...
@@ -133,7 +134,7 @@ function loadIcon() {
var
$div
=
null
;
var
appid
=
null
;
$boxs
.
each
(
function
(
idx
,
box
)
{
$boxs
.
each
(
function
(
idx
,
box
)
{
$div
=
$
(
box
).
find
(
'.icon'
).
find
(
'div'
);
if
(
$div
.
length
>
0
)
{
appid
=
$
(
box
).
attr
(
'id'
);
...
...
@@ -151,15 +152,15 @@ function showPage() {
function
bindTouchedEvent
()
{
var
$boxs
=
$
(
'.box'
);
$boxs
.
on
(
'touchstart'
,
function
(
e
)
{
$boxs
.
on
(
'touchstart'
,
function
(
e
)
{
$
(
this
).
addClass
(
'bytouch'
);
}).
on
(
'touchend touchcancel'
,
function
()
{
}).
on
(
'touchend touchcancel'
,
function
()
{
$boxs
.
removeClass
(
'bytouch'
);
});
}
if
(
wxHammer
)
{
wxHammer
.
on
(
'tap'
,
function
()
{
wxHammer
.
on
(
'tap'
,
function
()
{
callpay
(
theOrderCode
);
});
}
...
...
Please
register
or
login
to post a comment