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
c6ccf236
Commit
c6ccf236
authored
Jan 23, 2021
by
zeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化刷脸支付分判断
parent
8639732b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
FacePage.js
src/pages/FacePage.js
+12
-10
WxFacepay.js
src/utils/WxFacepay.js
+2
-0
No files found.
src/pages/FacePage.js
View file @
c6ccf236
...
...
@@ -49,6 +49,7 @@ class FacePage extends Component {
};
phone
=
''
;
// 监听用户输入手机
// sense = true; // 测试即拿刷脸设备
async
componentWillMount
()
{
this
.
storeKey
=
await
AsyncStorage
.
getItem
(
'KEY'
);
...
...
@@ -69,14 +70,7 @@ class FacePage extends Component {
await
AutoClick
.
clickBackKey
();
if
(
this
.
faceBusy
)
return
;
this
.
faceBusy
=
true
;
// await this.wechatFace(); // 点击开通重新调用
if
(
WxFacepay
.
getUserPayScoreStatus
)
{
// 开通支付分
await
this
.
payscore
();
}
else
{
// 微信刷脸
await
this
.
wechatFace
();
}
await
this
.
face
();
// 点击开通重新调用
this
.
faceBusy
=
false
;
});
// 监听微信输入手机号事件
...
...
@@ -245,7 +239,7 @@ class FacePage extends Component {
face
=
()
=>
{
const
{
faceType
}
=
this
.
state
;
if
(
faceType
===
'wxpay'
)
{
if
(
WxFacepay
.
getUserPayScoreStatus
&&
this
.
sense
)
{
if
(
this
.
sense
)
{
// 开通支付分
this
.
payscore
();
}
else
{
...
...
@@ -428,10 +422,18 @@ class FacePage extends Component {
// 出现订单弹窗,不做人脸识别
return
;
}
cons
t
tipText
=
!
this
.
payscoreEnable
le
t
tipText
=
!
this
.
payscoreEnable
?
'正在人脸识别,请看向屏幕,靠中间站稳'
:
'正在开通支付分,请看向屏幕'
;
if
(
!
WxFacepay
.
getUserPayScoreStatus
)
{
tipText
=
'请扫码确认'
;
if
(
this
.
sense
)
tipText
=
'请扫码开通支付分进店'
;
}
Speech
.
speak
(
tipText
);
if
(
!
WxFacepay
.
getUserPayScoreStatus
)
{
this
.
setQrcode
({
action
:
this
.
action
,
tip
:
tipText
,
qrcode
:
true
});
return
;
}
const
data
=
await
this
.
payscoreinfo
();
if
(
data
.
code
===
1
)
{
const
out_trade_no
=
data
.
data
.
orderId
;
...
...
src/utils/WxFacepay.js
View file @
c6ccf236
...
...
@@ -13,4 +13,6 @@ NativeModules.WxFacepay.initialize = ms => {
return
Promise
.
race
([
init
,
timeout
(
ms
)]);
};
// delete NativeModules.WxFacepay.getUserPayScoreStatus; // 测试刷脸支付分兼容问题
export
default
NativeModules
.
WxFacepay
;
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