Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
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
baiguangyao
mr-julyedu
Commits
00a52f54
Commit
00a52f54
authored
Aug 21, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zhifu
parent
9a5268f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/components/order/payOrder/PayOrder.js
+4
-6
No files found.
src/components/order/payOrder/PayOrder.js
View file @
00a52f54
...
@@ -109,7 +109,7 @@ export default class PayOrder extends Component {
...
@@ -109,7 +109,7 @@ export default class PayOrder extends Component {
weixinPay
=
(
orderId
)
=>
{
weixinPay
=
(
orderId
)
=>
{
// 微信内部-支付
// 微信内部-支付
if
(
is_weixin
())
{
if
(
is_weixin
())
{
window
.
location
.
href
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri="
+
encodeURIComponent
(
window
.
location
.
href
+
"&aa=bb
&oid="
+
orderId
).
toLowerCase
()
+
"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"
;
window
.
location
.
href
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri="
+
encodeURIComponent
(
window
.
location
.
href
+
"&aa=bb
"
).
toLowerCase
()
+
"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"
;
}
else
{
}
else
{
// 微信外部-支付
// 微信外部-支付
http
.
get
(
`
${
API
[
'base-api'
]}
/pay/wxpay/wap_charge/oid/
${
orderId
}
`
).
then
((
res
)
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/pay/wxpay/wap_charge/oid/
${
orderId
}
`
).
then
((
res
)
=>
{
...
@@ -131,8 +131,8 @@ export default class PayOrder extends Component {
...
@@ -131,8 +131,8 @@ export default class PayOrder extends Component {
}
else
{
}
else
{
http
.
get
(
`
${
API
[
'base-api'
]}
/pay/wxpay/pub_charge/oid/
${
getParam
(
'oid'
)}
/code/
${
weixin_code
}
`
).
then
((
res
)
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/pay/wxpay/pub_charge/oid/
${
getParam
(
'oid'
)}
/code/
${
weixin_code
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
errno
===
0
)
{
if
(
res
.
data
.
errno
===
0
)
{
this
.
bridgeD
ata
=
res
.
data
.
data
;
let
d
ata
=
res
.
data
.
data
;
this
.
onBridgeReady
();
this
.
onBridgeReady
(
data
);
if
(
typeof
WeixinJSBridge
==
"undefined"
)
{
if
(
typeof
WeixinJSBridge
==
"undefined"
)
{
if
(
document
.
addEventListener
)
{
if
(
document
.
addEventListener
)
{
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
this
.
onBridgeReady
,
false
)
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
this
.
onBridgeReady
,
false
)
...
@@ -175,9 +175,7 @@ export default class PayOrder extends Component {
...
@@ -175,9 +175,7 @@ export default class PayOrder extends Component {
},
1000
)
},
1000
)
}
}
onBridgeReady
=
()
=>
{
onBridgeReady
=
(
data
)
=>
{
const
data
=
this
.
bridgeData
;
console
.
log
(
this
.
bridgeData
);
WeixinJSBridge
.
invoke
(
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
{
'getBrandWCPayRequest'
,
{
"appId"
:
data
.
appId
,
//公众号名称,由商户传入
"appId"
:
data
.
appId
,
//公众号名称,由商户传入
...
...
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