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
c6ebdb49
Commit
c6ebdb49
authored
Jun 30, 2020
by
修福龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收银台界面
parent
b305ec79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
23 deletions
+14
-23
FacePage.js
src/pages/FacePage.js
+14
-23
No files found.
src/pages/FacePage.js
View file @
c6ebdb49
...
...
@@ -151,14 +151,6 @@ class FacePage extends Component {
});
};
// 判断传感器上没人
noPerson
=
async
()
=>
{
const
data
=
await
this
.
props
.
dispatch
({
type
:
'store/scaleData'
,
});
return
data
&&
data
.
stableWeight
===
0
;
};
// device 代表当前打开的门
handleScaleChange
=
({
count
})
=>
{
if
(
count
===
-
1
)
{
...
...
@@ -166,12 +158,12 @@ class FacePage extends Component {
this
.
wechatFace
();
}
else
if
(
count
===
0
)
{
// 重力感应归零
clearInterval
(
this
.
noTalkCall
);
this
.
setState
({
orderDetailsModal
:
false
,
current
:
1
});
}
};
handleDoorLogin
=
async
ret
=>
{
// console.warn(ret);
if
(
ret
)
{
if
(
ret
.
code
<
0
||
ret
.
code
===
401
)
{
// 未授权,提示用户扫码验证
...
...
@@ -183,11 +175,12 @@ class FacePage extends Component {
this
.
setState
({
phoneModal
:
true
});
}
else
{
let
goodsArr
=
[];
ret
.
orders
.
map
(
v1
=>
{
v1
.
goods
.
map
(
v2
=>
{
goodsArr
.
push
(
v2
);
ret
.
orders
&&
ret
.
orders
.
map
(
v1
=>
{
v1
.
goods
.
map
(
v2
=>
{
goodsArr
.
push
(
v2
);
});
});
});
this
.
setState
({
orderDetailsModal
:
true
,
goodsArr
,
...
...
@@ -195,6 +188,10 @@ class FacePage extends Component {
current
:
1
,
});
}
}
else
if
(
ret
.
msg
)
{
let
tipText
=
ret
.
msg
.
replace
(
/扫码/g
,
'人脸识别'
);
Speech
.
speak
(
tipText
);
this
.
setState
({
tip
:
tipText
});
}
}
else
{
Speech
.
speak
(
'正在重新识别,请靠中间站稳'
);
...
...
@@ -212,9 +209,9 @@ class FacePage extends Component {
// 微信人脸身份识别
wechatFace
=
async
()
=>
{
// if (this.state.qrcode
) {
//
return;
// } // 出现二维码
,不做人脸识别
if
(
this
.
state
.
orderDetailsModal
)
{
return
;
}
// 出现订单弹窗
,不做人脸识别
const
tipText
=
'正在人脸识别,请看向屏幕,靠中间站稳'
;
Speech
.
speak
(
tipText
);
this
.
setState
({
tip
:
tipText
});
...
...
@@ -234,13 +231,7 @@ class FacePage extends Component {
face_authtype
:
'FACEID-ONCE'
,
ask_unionid
:
1
,
};
let
res
=
{};
while
(
!
res
.
openid
&&
!
(
await
this
.
noPerson
())
// 没识别到人脸,重新识别
)
{
res
=
await
WxFacepay
.
faceinfo
(
params
);
}
let
res
=
(
await
WxFacepay
.
faceinfo
(
params
))
||
{};
if
(
window
.
socket
)
{
window
.
socket
.
connect
();
}
// 返回结果,立即重新连接socket
...
...
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