Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bh_face_counter
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
黄天晨
bh_face_counter
Commits
c8da3eb8
Commit
c8da3eb8
authored
Jan 28, 2021
by
修福龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收银系统刷脸支付兼容余额支付
parent
46a1ef94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
8 deletions
+55
-8
goods.js
src/models/goods.js
+3
-0
CounterMixins.js
src/pages/CounterMixins.js
+33
-2
VerticalPage.js
src/pages/VerticalPage.js
+15
-6
goods.js
src/services/goods.js
+4
-0
No files found.
src/models/goods.js
View file @
c8da3eb8
...
@@ -93,5 +93,8 @@ export default {
...
@@ -93,5 +93,8 @@ export default {
*
payscoreinfo
(
action
,
{
call
})
{
*
payscoreinfo
(
action
,
{
call
})
{
return
yield
call
(
api
.
payscoreinfo
,
action
);
return
yield
call
(
api
.
payscoreinfo
,
action
);
},
},
*
balancePay
(
action
,
{
call
})
{
return
yield
call
(
api
.
balancePay
,
action
);
},
},
},
};
};
src/pages/CounterMixins.js
View file @
c8da3eb8
...
@@ -18,6 +18,7 @@ import RedPacketModal from '../components/RedPacketModal';
...
@@ -18,6 +18,7 @@ import RedPacketModal from '../components/RedPacketModal';
import
{
width
,
height
,
scaleSize
}
from
'../utils/screen'
;
import
{
width
,
height
,
scaleSize
}
from
'../utils/screen'
;
import
EnterEvent
from
'../utils/EnterEvent'
;
import
EnterEvent
from
'../utils/EnterEvent'
;
import
Printer
from
'../utils/Printer'
;
import
Printer
from
'../utils/Printer'
;
import
AutoClick
from
'../utils/AutoClick'
;
window
.
RN
=
RN
;
window
.
RN
=
RN
;
window
.
Toast
=
Toast
;
window
.
Toast
=
Toast
;
...
@@ -365,9 +366,11 @@ const CounterMixins = ComposeComponent => {
...
@@ -365,9 +366,11 @@ const CounterMixins = ComposeComponent => {
return
'门店设置已解锁'
;
return
'门店设置已解锁'
;
};
};
successPay
=
async
()
=>
{
successPay
=
async
balance
=>
{
Toast
.
hide
();
Toast
.
hide
();
const
msg
=
'付款成功,祝您生活愉快~'
;
const
msg
=
balance
?
'余额付款成功,祝您生活愉快~'
:
'付款成功,祝您生活愉快~'
;
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
// 购物完成步骤
// 购物完成步骤
type
:
'app/step'
,
type
:
'app/step'
,
...
@@ -771,6 +774,33 @@ const CounterMixins = ComposeComponent => {
...
@@ -771,6 +774,33 @@ const CounterMixins = ComposeComponent => {
return
true
;
return
true
;
};
};
balancePay
=
async
openid
=>
{
if
(
this
.
barcodeBusy
)
{
return
true
;
}
Toast
.
loading
(
'正在付款,请稍后~'
);
this
.
barcodeBusy
=
true
;
const
{
ids
,
noBarcode
}
=
this
.
getGoods
();
const
{
data
}
=
await
this
.
props
.
dispatch
({
type
:
'goods/balancePay'
,
ids
,
noBarcode
,
openid
,
});
if
(
data
.
code
===
1
)
{
// 付款成功
this
.
orderId
=
data
.
data
.
orderId
;
this
.
successPay
(
true
);
await
AutoClick
.
clickBackKey
();
await
wait
(
1200
);
await
this
.
setState
({
voiceModal
:
false
});
this
.
barcodeBusy
=
false
;
return
data
;
}
this
.
barcodeBusy
=
false
;
return
data
;
};
selectUserModal
=
()
=>
selectUserModal
=
()
=>
new
Promise
(
async
resolve
=>
{
new
Promise
(
async
resolve
=>
{
this
.
barcodeResolve
=
resolve
;
this
.
barcodeResolve
=
resolve
;
...
@@ -955,6 +985,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -955,6 +985,7 @@ const CounterMixins = ComposeComponent => {
dropUp
=
{
this
.
dropUp
}
dropUp
=
{
this
.
dropUp
}
dropDown
=
{
this
.
dropDown
}
dropDown
=
{
this
.
dropDown
}
speak
=
{
this
.
speak
}
speak
=
{
this
.
speak
}
balancePay
=
{
this
.
balancePay
}
/
>
/
>
<
/View
>
<
/View
>
);
);
...
...
src/pages/VerticalPage.js
View file @
c8da3eb8
...
@@ -236,11 +236,10 @@ class VerticalPage extends Component {
...
@@ -236,11 +236,10 @@ class VerticalPage extends Component {
res
=
await
WxFacepay
.
facepay
(
params
);
res
=
await
WxFacepay
.
facepay
(
params
);
}
}
if
(
res
.
face_code
)
{
if
(
res
.
face_code
)
{
await
this
.
props
.
barcodepay
(
res
.
face_code
,
true
,
res
.
sub_openid
);
const
data
=
await
this
.
props
.
balancePay
(
res
.
sub_openid
);
// const ret = await this.props.barcodepay(res.face_code, true);
if
(
data
.
code
!==
1
)
{
// const result = { ...params, payresult: ret };
await
this
.
props
.
barcodepay
(
res
.
face_code
,
true
,
res
.
sub_openid
);
// if (ret !== 'SUCCESS') result.payresult = 'ERROR';
}
// WxFacepay.update(result);
this
.
faceRetry
=
false
;
this
.
faceRetry
=
false
;
}
}
};
};
...
@@ -266,7 +265,17 @@ class VerticalPage extends Component {
...
@@ -266,7 +265,17 @@ class VerticalPage extends Component {
Toast
.
show
(
res
.
msg
);
Toast
.
show
(
res
.
msg
);
return
;
return
;
}
}
await
this
.
props
.
barcodepay
(
res
.
fToken
,
true
,
null
,
res
.
fToken
,
res
.
uid
);
const
balanceData
=
await
this
.
props
.
balancePay
(
res
.
uid
);
if
(
balanceData
.
code
!==
1
)
{
await
this
.
props
.
barcodepay
(
res
.
fToken
,
true
,
null
,
res
.
fToken
,
res
.
uid
,
);
}
// await this.props.barcodepay(res.fToken, true, null, res.fToken, res.uid);
}
}
};
};
...
...
src/services/goods.js
View file @
c8da3eb8
...
@@ -70,3 +70,7 @@ export function wxauthinfo({rawdata}) {
...
@@ -70,3 +70,7 @@ export function wxauthinfo({rawdata}) {
export
function
payscoreinfo
()
{
export
function
payscoreinfo
()
{
return
axios
.
post
(
'/store/goods/payscore/info'
);
return
axios
.
post
(
'/store/goods/payscore/info'
);
}
}
export
function
balancePay
(
action
)
{
return
axios
.
post
(
'/store/goods/balancePay'
,
qs
.
stringify
(
action
));
}
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