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
f638d60e
Commit
f638d60e
authored
Aug 18, 2020
by
修福龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加了带字母的条码识别功能,刷脸支付余额抵扣功能
parent
ca060e88
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
15 deletions
+38
-15
VerifyCodeModal.js
src/components/VerifyCodeModal.js
+1
-1
CounterMixins.js
src/pages/CounterMixins.js
+7
-3
VerticalPage.js
src/pages/VerticalPage.js
+28
-9
goods.js
src/services/goods.js
+2
-2
No files found.
src/components/VerifyCodeModal.js
View file @
f638d60e
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Modal
,
View
,
Text
,
Image
}
from
'react-native'
;
import
{
Modal
,
View
,
Text
,
Image
}
from
'react-native'
;
import
Icon
from
'react-native-vector-icons/Ionicons'
;
//
import Icon from 'react-native-vector-icons/Ionicons';
import
MIcon
from
'react-native-vector-icons/MaterialCommunityIcons'
;
import
MIcon
from
'react-native-vector-icons/MaterialCommunityIcons'
;
import
ModalStyles
from
'./Modal/styles'
;
import
ModalStyles
from
'./Modal/styles'
;
import
{
colors
,
font
}
from
'../utils/common'
;
import
{
colors
,
font
}
from
'../utils/common'
;
...
...
src/pages/CounterMixins.js
View file @
f638d60e
...
@@ -81,13 +81,15 @@ const CounterMixins = ComposeComponent => {
...
@@ -81,13 +81,15 @@ const CounterMixins = ComposeComponent => {
const
handleScan
=
this
.
submitBarcode
;
const
handleScan
=
this
.
submitBarcode
;
// if you want to react to keyUp
// if you want to react to keyUp
KeyEvent
.
onKeyUpListener
(
async
e
=>
{
KeyEvent
.
onKeyUpListener
(
async
e
=>
{
const
{
keyCode
}
=
e
;
const
{
keyCode
,
pressedKey
}
=
e
;
if
(
keyCode
===
66
)
{
if
(
keyCode
===
66
)
{
// 回车事件
// 回车事件
await
handleScan
();
await
handleScan
();
this
.
barcode
=
''
;
this
.
barcode
=
''
;
}
else
if
(
keyCode
>=
7
&&
keyCode
<=
16
)
{
}
else
if
(
keyCode
>=
7
&&
keyCode
<=
16
)
{
this
.
barcode
+=
keyCode
-
7
;
this
.
barcode
+=
keyCode
-
7
;
}
else
if
(
keyCode
>=
29
&&
keyCode
<=
54
)
{
this
.
barcode
+=
pressedKey
;
}
}
});
});
this
.
listen
();
this
.
listen
();
...
@@ -449,7 +451,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -449,7 +451,7 @@ const CounterMixins = ComposeComponent => {
const
good
=
{
const
good
=
{
barcode
:
'000000'
,
barcode
:
'000000'
,
name
:
'无码商品'
,
name
:
'无码商品'
,
unit
:
1
,
//
unit: 1,
num
:
1
,
num
:
1
,
// price: NP.round(price, 2).toFixed(2),
// price: NP.round(price, 2).toFixed(2),
prePrice
:
NP
.
round
(
price
,
2
).
toFixed
(
2
),
prePrice
:
NP
.
round
(
price
,
2
).
toFixed
(
2
),
...
@@ -487,6 +489,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -487,6 +489,7 @@ const CounterMixins = ComposeComponent => {
purPrice
:
0
,
purPrice
:
0
,
prePrice
,
prePrice
,
num
,
num
,
weight
:
0
,
});
});
}
}
});
});
...
@@ -494,7 +497,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -494,7 +497,7 @@ const CounterMixins = ComposeComponent => {
};
};
// 付款码支付
// 付款码支付
barcodepay
=
async
(
code
,
facepay
)
=>
{
barcodepay
=
async
(
code
,
facepay
,
openid
)
=>
{
if
(
this
.
barcodeBusy
)
{
if
(
this
.
barcodeBusy
)
{
return
true
;
return
true
;
}
}
...
@@ -512,6 +515,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -512,6 +515,7 @@ const CounterMixins = ComposeComponent => {
code
,
code
,
facepay
,
facepay
,
noBarcode
,
noBarcode
,
openid
,
});
});
if
(
res
.
code
!==
1
)
{
if
(
res
.
code
!==
1
)
{
await
this
.
setState
({
voiceModal
:
true
,
voiceTitle
:
res
.
msg
});
await
this
.
setState
({
voiceModal
:
true
,
voiceTitle
:
res
.
msg
});
...
...
src/pages/VerticalPage.js
View file @
f638d60e
...
@@ -194,7 +194,8 @@ class VerticalPage extends Component {
...
@@ -194,7 +194,8 @@ 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
);
await
this
.
props
.
barcodepay
(
res
.
face_code
,
true
,
res
.
sub_openid
);
// const ret = await this.props.barcodepay(res.face_code, true);
// const ret = await this.props.barcodepay(res.face_code, true);
// const result = { ...params, payresult: ret };
// const result = { ...params, payresult: ret };
// if (ret !== 'SUCCESS') result.payresult = 'ERROR';
// if (ret !== 'SUCCESS') result.payresult = 'ERROR';
...
@@ -287,16 +288,34 @@ class VerticalPage extends Component {
...
@@ -287,16 +288,34 @@ class VerticalPage extends Component {
}}
>
}}
>
¥
{
NP
.
round
(
item
.
prePrice
,
2
).
toFixed
(
2
)}
¥
{
NP
.
round
(
item
.
prePrice
,
2
).
toFixed
(
2
)}
<
/Text
>
<
/Text
>
<
Text
style
=
{{
fontSize
:
25
,
color
:
colors
.
textXSActive
}}
>
{
item
.
unit
?
(
¥
{
NP
.
round
(
item
.
price
,
2
).
toFixed
(
2
)}
/
<
Text
style
=
{{
fontSize
:
25
,
color
:
colors
.
textXSActive
}}
>
<
Text
style
=
{
styles
.
TdText
}
>
{
item
.
unit
}
<
/Text
>
¥
{
NP
.
round
(
item
.
price
,
2
).
toFixed
(
2
)}
/
<
/Text
>
<
Text
style
=
{
styles
.
TdText
}
>
{
item
.
unit
}
<
/Text
>
<
/Text
>
)
:
(
<
Text
style
=
{{
fontSize
:
25
,
color
:
colors
.
textXSActive
}}
>
¥
{
NP
.
round
(
item
.
price
,
2
).
toFixed
(
2
)}
<
/Text
>
)}
<
/View
>
<
/View
>
)
:
(
)
:
(
<
Text
style
=
{
styles
.
TdText
}
>
<
View
{
' '
}
style
=
{{
¥
{
NP
.
round
(
item
.
prePrice
,
2
).
toFixed
(
2
)}
/{item.unit}{' '
}
justifyContent
:
'center'
,
<
/Text
>
alignItems
:
'center'
,
flexDirection
:
'row'
,
}}
>
{
item
.
unit
?
(
<
Text
style
=
{
styles
.
TdText
}
>
¥
{
NP
.
round
(
item
.
prePrice
,
2
).
toFixed
(
2
)}
/{item.unit
}
<
/Text
>
)
:
(
<
Text
style
=
{
styles
.
TdText
}
>
¥
{
NP
.
round
(
item
.
prePrice
,
2
).
toFixed
(
2
)}
<
/Text
>
)}
<
/View
>
)}
)}
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
TdStyle
}
>
<
View
style
=
{
styles
.
TdStyle
}
>
...
...
src/services/goods.js
View file @
f638d60e
...
@@ -9,10 +9,10 @@ export function getBags() {
...
@@ -9,10 +9,10 @@ export function getBags() {
return
axios
.
get
(
'/store/goods/bags'
);
return
axios
.
get
(
'/store/goods/bags'
);
}
}
export
function
barcodepay
({
ids
,
code
,
facepay
,
noBarcode
})
{
export
function
barcodepay
({
ids
,
code
,
facepay
,
noBarcode
,
openid
})
{
return
axios
.
post
(
return
axios
.
post
(
'/store/goods/barcodepay'
,
'/store/goods/barcodepay'
,
qs
.
stringify
({
ids
,
code
,
facepay
,
noBarcode
}),
qs
.
stringify
({
ids
,
code
,
facepay
,
noBarcode
,
openid
}),
);
);
}
}
...
...
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