Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
doublescreen-front
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengguangpu
doublescreen-front
Commits
2c3fb903
Commit
2c3fb903
authored
Feb 13, 2020
by
jiangjiantao
Browse files
Options
Browse Files
Download
Plain Diff
支付bugfix
parents
c4bb1b19
90227f26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
18 deletions
+44
-18
balance.js
pages/balance/balance.js
+41
-16
payUtils.js
utils/payUtils.js
+3
-2
No files found.
pages/balance/balance.js
View file @
2c3fb903
...
...
@@ -34,17 +34,6 @@ Page({
},
facePay
()
{
},
qrPay
()
{
//todo 这里增加唤起弹窗的逻辑
this
.
setData
({
qrPayShow
:
true
});
},
/**
* 保存最近支付成功的相关信息,每次支付成功都需刷新
* @param paySuccessGoodsList 支付成功的商品列表信息
...
...
@@ -73,7 +62,7 @@ Page({
payUtils
.
getOrder
(
/*this.data.payPrice*/
1
,
this
.
data
.
list
,
function
(
res
){
if
(
res
!=
null
){
console
.
log
(
"callback调用,res="
+
JSON
.
stringify
(
res
));
console
.
log
(
"callback调用,res="
+
JSON
.
stringify
(
res
));
if
(
res
.
resultCode
==
1
){
this
.
setData
({
orderNo
:
res
.
data
...
...
@@ -84,6 +73,7 @@ Page({
}.
bind
(
this
));
},
//调用收款接口
doPay
(
orderNo
,
payCode
)
{
console
.
log
(
"doPay调用"
+
orderNo
);
...
...
@@ -120,8 +110,7 @@ Page({
/**
* 打开收银台,进行扫码收款
*/
payWithOpenCashier
(
orderNo
){
payWithOpenCashier
(){
try
{
console
.
info
(
"收银台版本"
+
my
.
ix
.
getVersionSync
({
packageName
:
'zoloz.phone.android.alipay.com.dragonfly'
...
...
@@ -135,10 +124,10 @@ Page({
success
:
(
res
)
=>
{
console
.
log
(
"收银台启动回调 success==>"
+
JSON
.
stringify
(
res
));
if
(
res
.
codeType
==
"F"
)
{
this
.
doPay
(
orderNo
,
res
.
barCode
);
this
.
doPay
(
this
.
data
.
orderNo
,
res
.
barCode
);
}
else
{
this
.
data
.
isCashierClosed
=
true
;
this
.
doPay
(
orderNo
,
res
.
barCode
);
this
.
doPay
(
this
.
data
.
orderNo
,
res
.
barCode
);
}
},
fail
:(
res
)
=>
{
my
.
showToast
({
...
...
@@ -186,4 +175,40 @@ Page({
}
},
//调用收款接口
doPay
(
orderNo
,
payCode
)
{
console
.
log
(
"doPay调用"
);
this
.
setData
({
isPaying
:
true
});
//使用barCode来当面付
payUtils
.
startPay
(
orderNo
,
payCode
,
1
,
this
.
data
.
list
,
function
(
res
){
my
.
hideLoading
();
console
.
log
(
"支付回调 ===>"
+
JSON
.
stringify
(
res
));
this
.
setData
({
isPaying
:
false
});
if
(
res
==
null
){
return
;
}
if
(
res
.
code
>
0
){
//成功
console
.
log
(
"支付回调成功,跳转 "
);
// if(data.isCashierClosed == true){
my
.
ix
.
offCashierEventReceive
();
my
.
redirectTo
({
url
:
'/pages/paysuccess/paysuccess?orderPrice='
+
this
.
data
.
totalPrice
+
"&couponPrice="
+
this
.
data
.
couponPrice
+
"&payPrice="
+
this
.
data
.
payPrice
+
"&totalCount="
+
this
.
data
.
totalCount
,
});
// }
}
else
{
console
.
log
(
"支付回调失败,toast提示 "
);
my
.
ix
.
offCashierEventReceive
();
my
.
showToast
({
type
:
'fail'
,
content
:
res
.
data
,
duration
:
2000
});
}
}.
bind
(
this
));
},
});
utils/payUtils.js
View file @
2c3fb903
...
...
@@ -194,8 +194,9 @@ function pay(tradeNo, payCode, payPrice, list, callback, retryCount){
success
:
(
res
)
=>
{
console
.
log
(
"支付接口回掉 ==>"
+
JSON
.
stringify
(
res
));
//增加数据判断,增加重试
if
(
res
==
null
||
res
.
data
==
null
||
res
.
data
.
success
!=
true
||
res
.
data
.
data
==
null
)
{
console
.
log
(
"支付未成功 ==>"
+
res
.
data
.
message
);
console
.
log
(
"支付接口回调 ==>"
+
JSON
.
stringify
(
res
));
if
(
res
==
null
||
res
.
data
==
null
||
res
.
data
.
success
!=
true
/*||res.data.data == null*/
)
{
console
.
log
(
"支付未成功 ==>"
+
JSON
.
stringify
(
res
.
data
.
message
));
retryOrFailed
(
tradeNo
,
payCode
,
payPrice
,
list
,
callback
,
retryCount
);
}
else
{
console
.
log
(
"支付返回值 ==>"
+
JSON
.
stringify
(
res
.
data
));
...
...
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