Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
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
viitto
mallapp
Commits
6f81d969
Commit
6f81d969
authored
Oct 13, 2022
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
b10d89e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
23 deletions
+24
-23
submit2Pay.vue
components/pay/submit2Pay.vue
+24
-23
No files found.
components/pay/submit2Pay.vue
View file @
6f81d969
...
...
@@ -84,11 +84,11 @@ export default {
res
=>
{
this
.
loading
=
false
uni
.
hideLoading
()
if
(
res
.
D
ata
!=
''
){
if
(
res
.
d
ata
!=
''
){
if
(
this
.
payType
!=
'wx_lite'
){
this
.
aliPay
(
res
.
D
ata
)
this
.
aliPay
(
res
.
d
ata
)
}
else
{
this
.
wxPay
(
JSON
.
parse
(
res
.
D
ata
))
this
.
wxPay
(
JSON
.
parse
(
res
.
d
ata
))
}
}
else
{
uni
.
showToast
({
...
...
@@ -110,28 +110,29 @@ export default {
uni
.
showLoading
({
title
:
'支付中...'
})
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
{
"appId"
:
payData
.
appId
,
//公众号名称,由商户传入
"timeStamp"
:
payData
.
timeStamp
,
//时间戳,自1970年以来的秒数
"nonceStr"
:
payData
.
nonceStr
,
//随机串
"package"
:
payData
.
package
,
"signType"
:
payData
.
signType
,
//微信签名方式:
"paySign"
:
payData
.
paySign
//微信签名
uni
.
requestPayment
({
provider
:
'wxpay'
,
"timeStamp"
:
payData
.
timeStamp
,
//时间戳,自1970年以来的秒数
"nonceStr"
:
payData
.
nonceStr
,
//随机串
"package"
:
payData
.
package
,
"signType"
:
payData
.
signType
,
//微信签名方式:
"paySign"
:
payData
.
paySign
,
//微信签名
success
:
function
(
res
)
{
if
(
that
.
payInfo
.
successType
==
1
){
uni
.
navigateTo
({
url
:
'/pages/reserve/offline-success?payInfo='
+
JSON
.
stringify
(
that
.
payInfo
)
});
}
else
{
uni
.
navigateTo
({
url
:
'/pages/order-submit/pay-success?payInfo='
+
JSON
.
stringify
(
that
.
payInfo
)
});
}
},
function
(
res
)
{
if
(
res
.
errMsg
===
"get_brand_wcpay_request:ok"
)
{
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
that
.
isSuccess
=
true
that
.
isSuccessTitle
=
'支付成功!'
}
else
{
that
.
isSuccess
=
false
that
.
isSuccessTitle
=
'支付失败!'
}
uni
.
hideLoading
();
fail
:
function
(
err
)
{
console
.
log
(
'fail:'
,
err
);
}
);
}
);
},
}
};
...
...
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