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
81dc7d6b
Commit
81dc7d6b
authored
Jan 22, 2021
by
zeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化收银台回车事件触发按钮问题
parent
b6882f09
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
Touch.js
src/components/Touch.js
+7
-4
CounterMixins.js
src/pages/CounterMixins.js
+5
-0
EnterEvent.js
src/utils/EnterEvent.js
+5
-0
No files found.
src/components/Touch.js
View file @
81dc7d6b
...
@@ -6,6 +6,7 @@ import {
...
@@ -6,6 +6,7 @@ import {
TouchableWithoutFeedback
,
TouchableWithoutFeedback
,
View
,
View
,
}
from
'react-native'
;
}
from
'react-native'
;
import
EnterEvent
from
'../utils/EnterEvent'
;
let
TouchableComponent
;
let
TouchableComponent
;
...
@@ -30,7 +31,11 @@ export default class PlatformTouchable extends React.Component {
...
@@ -30,7 +31,11 @@ export default class PlatformTouchable extends React.Component {
static
Ripple
=
TouchableComponent
.
Ripple
;
static
Ripple
=
TouchableComponent
.
Ripple
;
static
canUseNativeForeground
=
TouchableComponent
.
canUseNativeForeground
;
static
canUseNativeForeground
=
TouchableComponent
.
canUseNativeForeground
;
onPress
=
()
=>
{
onPress
=
e
=>
{
if
(
e
.
constructor
.
name
===
'SyntheticEvent'
)
{
EnterEvent
.
emit
(
'Trigger'
);
return
;
}
let
{
onPress
}
=
this
.
props
;
let
{
onPress
}
=
this
.
props
;
window
.
count
=
window
.
defaultCount
;
window
.
count
=
window
.
defaultCount
;
if
(
onPress
)
{
if
(
onPress
)
{
...
@@ -50,9 +55,7 @@ export default class PlatformTouchable extends React.Component {
...
@@ -50,9 +55,7 @@ export default class PlatformTouchable extends React.Component {
...
props
...
props
}
=
this
.
props
;
}
=
this
.
props
;
if
(
feedback
===
false
)
{
if
(
!
feedback
)
TouchableComponent
=
TouchableWithoutFeedback
;
TouchableComponent
=
TouchableWithoutFeedback
;
}
props
.
onPress
=
this
.
onPress
;
props
.
onPress
=
this
.
onPress
;
// Even though it works for TouchableWithoutFeedback and
// Even though it works for TouchableWithoutFeedback and
...
...
src/pages/CounterMixins.js
View file @
81dc7d6b
...
@@ -16,6 +16,7 @@ import NP from '../utils/np';
...
@@ -16,6 +16,7 @@ import NP from '../utils/np';
import
{
total
}
from
'../utils/validity'
;
import
{
total
}
from
'../utils/validity'
;
import
RedPacketModal
from
'../components/RedPacketModal'
;
import
RedPacketModal
from
'../components/RedPacketModal'
;
import
{
width
,
scaleSize
}
from
'../utils/screen'
;
import
{
width
,
scaleSize
}
from
'../utils/screen'
;
import
EnterEvent
from
'../utils/EnterEvent'
;
window
.
RN
=
RN
;
window
.
RN
=
RN
;
window
.
Toast
=
Toast
;
window
.
Toast
=
Toast
;
...
@@ -110,6 +111,10 @@ const CounterMixins = ComposeComponent => {
...
@@ -110,6 +111,10 @@ const CounterMixins = ComposeComponent => {
this
.
barcode
+=
pressedKey
;
this
.
barcode
+=
pressedKey
;
}
}
});
});
EnterEvent
.
on
(
'Trigger'
,
async
()
=>
{
await
handleScan
();
this
.
barcode
=
''
;
});
this
.
listen
();
this
.
listen
();
};
};
...
...
src/utils/EnterEvent.js
0 → 100644
View file @
81dc7d6b
import
mitt
from
'./mitt'
;
const
emitter
=
mitt
();
export
default
emitter
;
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