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
b897e3b5
Commit
b897e3b5
authored
Jun 26, 2023
by
黄日华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开门离店弹窗可配置和其余弹窗消失时间
parent
40d50d43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
60 deletions
+123
-60
NumberModal.js
src/components/NumberModal.js
+20
-15
CounterMixins.js
src/pages/CounterMixins.js
+86
-30
VerticalPage.js
src/pages/VerticalPage.js
+17
-15
No files found.
src/components/NumberModal.js
View file @
b897e3b5
...
@@ -23,7 +23,6 @@ export default class KeyboardModal extends React.Component {
...
@@ -23,7 +23,6 @@ export default class KeyboardModal extends React.Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
value
:
''
,
clickDot
:
true
,
clickDot
:
true
,
};
};
}
}
...
@@ -66,33 +65,39 @@ export default class KeyboardModal extends React.Component {
...
@@ -66,33 +65,39 @@ export default class KeyboardModal extends React.Component {
};
};
pressKey
=
index
=>
{
pressKey
=
index
=>
{
let
{
value
,
clickDot
}
=
this
.
state
;
let
{
clickDot
}
=
this
.
state
;
const
{
dot
}
=
this
.
props
;
const
{
dot
,
operateCb
,
value
,
setValue
}
=
this
.
props
;
let
numberValue
=
value
;
if
(
index
<
10
)
{
if
(
index
<
10
)
{
v
alue
+=
index
;
numberV
alue
+=
index
;
}
else
if
(
index
===
10
&&
!
dot
)
{
}
else
if
(
index
===
10
&&
!
dot
)
{
value
=
value
.
substr
(
0
,
v
alue
.
length
-
1
);
numberValue
=
numberValue
.
substr
(
0
,
numberV
alue
.
length
-
1
);
}
else
if
(
index
===
10
&&
dot
&&
clickDot
)
{
}
else
if
(
index
===
10
&&
dot
&&
clickDot
)
{
v
alue
+=
'.'
;
numberV
alue
+=
'.'
;
clickDot
=
false
;
clickDot
=
false
;
}
else
if
(
index
===
11
)
{
}
else
if
(
index
===
11
)
{
v
alue
+=
0
;
numberV
alue
+=
0
;
}
else
if
(
index
===
12
)
{
}
else
if
(
index
===
12
)
{
this
.
props
.
onSubmit
(
v
alue
);
this
.
props
.
onSubmit
(
numberV
alue
);
this
.
handleClose
();
this
.
handleClose
();
return
;
return
;
}
}
this
.
setState
({
value
,
clickDot
});
this
.
setState
({
clickDot
});
operateCb
();
setValue
(
numberValue
);
};
};
handleClose
=
()
=>
{
handleClose
=
clear
=>
{
this
.
setState
({
value
:
''
,
clickDot
:
true
});
const
{
onClose
,
setValue
}
=
this
.
props
;
this
.
props
.
onClose
();
this
.
setState
({
clickDot
:
true
});
setValue
(
''
);
if
(
!
clear
)
{
onClose
();
}
};
};
render
()
{
render
()
{
const
{
title
,
visible
}
=
this
.
props
;
const
{
title
,
visible
,
value
}
=
this
.
props
;
const
{
value
}
=
this
.
state
;
return
(
return
(
<
Modal
<
Modal
styles
=
{
mStyles
}
styles
=
{
mStyles
}
...
@@ -134,7 +139,7 @@ export default class KeyboardModal extends React.Component {
...
@@ -134,7 +139,7 @@ export default class KeyboardModal extends React.Component {
<
/Text
>
<
/Text
>
<
/View
>
<
/View
>
<
Touch
<
Touch
onPress
=
{()
=>
this
.
setState
({
value
:
''
,
clickDot
:
true
}
)}
onPress
=
{()
=>
this
.
handleClose
(
true
)}
style
=
{{
style
=
{{
position
:
'absolute'
,
position
:
'absolute'
,
right
:
30
,
right
:
30
,
...
...
src/pages/CounterMixins.js
View file @
b897e3b5
...
@@ -72,6 +72,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -72,6 +72,7 @@ const CounterMixins = ComposeComponent => {
noBuyModal
:
false
,
noBuyModal
:
false
,
logoVisible
:
true
,
logoVisible
:
true
,
nobodyVoice
:
false
,
nobodyVoice
:
false
,
numberValue
:
''
,
};
};
componentWillMount
=
async
()
=>
{
componentWillMount
=
async
()
=>
{
...
@@ -484,13 +485,26 @@ const CounterMixins = ComposeComponent => {
...
@@ -484,13 +485,26 @@ const CounterMixins = ComposeComponent => {
});
});
// this.setState({voiceModal: true, voiceTitle: msg});
// this.setState({voiceModal: true, voiceTitle: msg});
if
(
!
facepay
)
{
if
(
!
facepay
)
{
Speech
.
speak
(
'付款成功'
);
await
Speech
.
speak
(
'付款成功'
);
}
}
if
(
this
.
state
.
stype
===
'guard'
)
{
if
(
this
.
state
.
stype
===
'guard'
)
{
this
.
showLeaveModal
();
let
group
=
await
AsyncStorage
.
getItem
(
'KEY'
);
let
{
data
}
=
await
this
.
props
.
dispatch
({
type
:
'store/getStore'
,
group
,
});
if
(
data
.
code
===
1
)
{
if
(
data
.
data
&&
data
.
data
.
payLeave
)
{
await
this
.
onOpen
();
}
else
{
this
.
showLeaveModal
();
}
}
else
{
this
.
showLeaveModal
();
}
}
else
{
}
else
{
this
.
storeSetting
(
goodsArr
);
await
this
.
storeSetting
(
goodsArr
);
this
.
onLucky
();
await
this
.
onLucky
();
}
}
this
.
clearList
();
this
.
clearList
();
};
};
...
@@ -634,6 +648,52 @@ const CounterMixins = ComposeComponent => {
...
@@ -634,6 +648,52 @@ const CounterMixins = ComposeComponent => {
});
});
};
};
modalResult
=
()
=>
{
clearTimeout
(
this
.
mrTimeout
);
this
.
mrTimeout
=
setTimeout
(()
=>
{
this
.
setState
({
modalS
:
false
,
numberValue
:
''
,
});
},
15000
);
};
refreshModalResult
=
()
=>
{
clearTimeout
(
this
.
mrTimeout
);
this
.
mrTimeout
=
setTimeout
(()
=>
{
this
.
setState
({
modalS
:
false
,
numberValue
:
''
,
});
},
15000
);
};
setNumberValue
=
numberValue
=>
{
this
.
setState
({
numberValue
,
});
};
handleBarcode
=
()
=>
{
this
.
handleScan
=
this
.
submitBarcode
;
this
.
setState
({
modalS
:
true
,
title
:
'录入条码'
,
dot
:
false
,
});
this
.
modalResult
();
};
handleCodeless
=
()
=>
{
this
.
handleScan
=
this
.
submitCodeless
;
this
.
setState
({
modalS
:
true
,
title
:
'无码商品'
,
dot
:
true
,
});
this
.
modalResult
();
};
numChange
=
index
=>
{
numChange
=
index
=>
{
this
.
handleScan
=
this
.
submitGoodNum
;
this
.
handleScan
=
this
.
submitGoodNum
;
this
.
numIndex
=
index
;
this
.
numIndex
=
index
;
...
@@ -641,6 +701,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -641,6 +701,7 @@ const CounterMixins = ComposeComponent => {
modalS
:
true
,
modalS
:
true
,
title
:
'修改数量'
,
title
:
'修改数量'
,
});
});
this
.
modalResult
();
};
};
numAdd
=
(
num
,
index
)
=>
{
numAdd
=
(
num
,
index
)
=>
{
...
@@ -1011,24 +1072,6 @@ const CounterMixins = ComposeComponent => {
...
@@ -1011,24 +1072,6 @@ const CounterMixins = ComposeComponent => {
}
}
};
};
handleBarcode
=
()
=>
{
this
.
handleScan
=
this
.
submitBarcode
;
this
.
setState
({
modalS
:
true
,
title
:
'录入条码'
,
dot
:
false
,
});
};
handleCodeless
=
()
=>
{
this
.
handleScan
=
this
.
submitCodeless
;
this
.
setState
({
modalS
:
true
,
title
:
'无码商品'
,
dot
:
true
,
});
};
clearList
=
()
=>
{
clearList
=
()
=>
{
this
.
setDelay
();
this
.
setDelay
();
this
.
goodsMap
=
{};
this
.
goodsMap
=
{};
...
@@ -1100,7 +1143,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -1100,7 +1143,7 @@ const CounterMixins = ComposeComponent => {
});
});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
noBuyModal
:
false
});
this
.
setState
({
noBuyModal
:
false
});
},
1
0000
);
},
3
0000
);
}
}
this
.
clearList
();
this
.
clearList
();
};
};
...
@@ -1113,6 +1156,15 @@ const CounterMixins = ComposeComponent => {
...
@@ -1113,6 +1156,15 @@ const CounterMixins = ComposeComponent => {
Toast
.
success
(
data
.
msg
);
Toast
.
success
(
data
.
msg
);
};
};
onNumberClose
=
()
=>
{
clearTimeout
(
this
.
mrTimeout
);
this
.
setState
({
modalS
:
false
,
dot
:
false
,
numberValue
:
''
,
});
};
render
=
()
=>
{
render
=
()
=>
{
let
{
let
{
cloudFinishModal
,
cloudFinishModal
,
...
@@ -1127,6 +1179,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -1127,6 +1179,7 @@ const CounterMixins = ComposeComponent => {
logoVisible
,
logoVisible
,
qrHost
,
qrHost
,
nobodyVoice
,
nobodyVoice
,
numberValue
,
}
=
this
.
state
;
}
=
this
.
state
;
return
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
...
@@ -1232,10 +1285,13 @@ const CounterMixins = ComposeComponent => {
...
@@ -1232,10 +1285,13 @@ const CounterMixins = ComposeComponent => {
<
/Modal
>
<
/Modal
>
<
NumberModal
<
NumberModal
title
=
{
title
}
title
=
{
title
}
onClose
=
{
()
=>
this
.
setState
({
modalS
:
false
,
dot
:
false
})
}
onClose
=
{
this
.
onNumberClose
}
visible
=
{
this
.
state
.
modalS
}
visible
=
{
this
.
state
.
modalS
}
onSubmit
=
{
this
.
handleScan
}
onSubmit
=
{
this
.
handleScan
}
dot
=
{
this
.
state
.
dot
}
dot
=
{
this
.
state
.
dot
}
operateCb
=
{
this
.
refreshModalResult
}
value
=
{
numberValue
}
setValue
=
{
this
.
setNumberValue
}
/
>
/
>
<
RedPacketModal
<
RedPacketModal
luckyVisible
=
{
luckyVisible
}
luckyVisible
=
{
luckyVisible
}
...
@@ -1268,8 +1324,8 @@ const CounterMixins = ComposeComponent => {
...
@@ -1268,8 +1324,8 @@ const CounterMixins = ComposeComponent => {
style
=
{{
style
=
{{
width
:
100
,
width
:
100
,
height
:
100
,
height
:
100
,
marginLeft
:
-
1
0
,
marginLeft
:
0
,
marginTop
:
-
1
8
,
marginTop
:
-
8
,
resizeMode
:
'contain'
,
resizeMode
:
'contain'
,
alignSelf
:
'flex-start'
,
alignSelf
:
'flex-start'
,
}}
}}
...
@@ -1281,7 +1337,7 @@ const CounterMixins = ComposeComponent => {
...
@@ -1281,7 +1337,7 @@ const CounterMixins = ComposeComponent => {
alignItems
:
'center'
,
alignItems
:
'center'
,
flex
:
1
,
flex
:
1
,
}}
>
}}
>
<
Text
style
=
{{
color
:
'#000000'
,
fontSize
:
28
}}
>
云值守店
<
/Text
>
<
Text
style
=
{{
color
:
'#000000'
,
fontSize
:
32
}}
>
云值守店
<
/Text
>
<
/View
>
<
/View
>
<
Touch
<
Touch
onPress
=
{()
=>
this
.
onCloseCloudFinish
()}
onPress
=
{()
=>
this
.
onCloseCloudFinish
()}
...
@@ -1307,14 +1363,14 @@ const CounterMixins = ComposeComponent => {
...
@@ -1307,14 +1363,14 @@ const CounterMixins = ComposeComponent => {
onPress
=
{()
=>
this
.
onOpen
()}
onPress
=
{()
=>
this
.
onOpen
()}
style
=
{{
style
=
{{
width
:
'90%'
,
width
:
'90%'
,
height
:
7
0
,
height
:
8
0
,
borderRadius
:
5
,
borderRadius
:
5
,
justifyContent
:
'center'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
backgroundColor
:
'#FC4000'
,
backgroundColor
:
'#FC4000'
,
marginVertical
:
25
,
marginVertical
:
30
,
}}
>
}}
>
<
Text
style
=
{{
color
:
'#ffffff'
,
fontSize
:
2
2
}}
>
开门离店
<
/Text
>
<
Text
style
=
{{
color
:
'#ffffff'
,
fontSize
:
2
8
}}
>
开门离店
<
/Text
>
<
/Touch
>
<
/Touch
>
<
/View
>
<
/View
>
<
/Modal
>
<
/Modal
>
...
...
src/pages/VerticalPage.js
View file @
b897e3b5
...
@@ -354,21 +354,22 @@ class VerticalPage extends Component {
...
@@ -354,21 +354,22 @@ class VerticalPage extends Component {
onCall
=
async
()
=>
{
onCall
=
async
()
=>
{
const
{
talkCall
}
=
this
.
state
;
const
{
talkCall
}
=
this
.
state
;
console
.
warn
(
talkCall
,
Date
.
now
());
if
(
talkCall
===
2
)
{
if
(
talkCall
===
2
)
{
Speech
.
speak
(
'正在接通中请稍候'
);
this
.
talkCall
();
clearInterval
(
this
.
noTalkCall
);
this
.
noTalkCall
=
setInterval
(()
=>
this
.
talkCall
(),
10000
);
this
.
setState
({
this
.
setState
({
talkCall
:
0
,
talkCall
:
0
,
});
});
clearInterval
(
this
.
callTimeout
);
Speech
.
speak
(
'正在接通中请稍候'
);
this
.
callTimeout
=
setTimeout
(()
=>
{
this
.
talkCall
();
clearInterval
(
this
.
noTalkCall
);
// clearInterval(this.noTalkCall);
this
.
setState
({
// this.noTalkCall = setInterval(() => this.talkCall(), 10000);
talkCall
:
2
,
// clearInterval(this.callTimeout);
});
// this.callTimeout = setTimeout(() => {
},
30000
);
// clearInterval(this.noTalkCall);
// this.setState({
// talkCall: 2,
// });
// }, 30000);
}
}
this
.
setState
({
this
.
setState
({
hintVisible
:
true
,
hintVisible
:
true
,
...
@@ -376,7 +377,7 @@ class VerticalPage extends Component {
...
@@ -376,7 +377,7 @@ class VerticalPage extends Component {
clearTimeout
(
this
.
callModalTimeout
);
clearTimeout
(
this
.
callModalTimeout
);
this
.
callModalTimeout
=
setTimeout
(()
=>
{
this
.
callModalTimeout
=
setTimeout
(()
=>
{
this
.
setState
({
hintVisible
:
false
});
this
.
setState
({
hintVisible
:
false
});
},
12
000
);
},
60
000
);
};
};
onNoBuy
=
async
()
=>
{
onNoBuy
=
async
()
=>
{
...
@@ -387,6 +388,7 @@ class VerticalPage extends Component {
...
@@ -387,6 +388,7 @@ class VerticalPage extends Component {
closeHint
=
()
=>
{
closeHint
=
()
=>
{
this
.
setState
({
this
.
setState
({
hintVisible
:
false
,
hintVisible
:
false
,
talkCall
:
2
,
});
});
};
};
...
@@ -578,7 +580,7 @@ class VerticalPage extends Component {
...
@@ -578,7 +580,7 @@ class VerticalPage extends Component {
clearTimeout
(
this
.
nobuyTimeout
);
clearTimeout
(
this
.
nobuyTimeout
);
this
.
nobuyTimeout
=
setTimeout
(()
=>
{
this
.
nobuyTimeout
=
setTimeout
(()
=>
{
this
.
setState
({
noBuyModal
:
false
});
this
.
setState
({
noBuyModal
:
false
});
},
1
0000
);
},
3
0000
);
};
};
render
()
{
render
()
{
...
@@ -1259,8 +1261,8 @@ class HintPhone extends React.Component {
...
@@ -1259,8 +1261,8 @@ class HintPhone extends React.Component {
<
Image
style
=
{{
width
:
'60%'
,
height
:
'60%'
}}
source
=
{
call
}
/
>
<
Image
style
=
{{
width
:
'60%'
,
height
:
'60%'
}}
source
=
{
call
}
/
>
<
Text
style
=
{{
fontSize
:
scaleSize
(
30
)}}
>
正在呼叫客服
<
/Text
>
<
Text
style
=
{{
fontSize
:
scaleSize
(
30
)}}
>
正在呼叫客服
<
/Text
>
<
View
style
=
{{
display
:
'flex'
,
marginTop
:
10
}}
>
<
View
style
=
{{
display
:
'flex'
,
marginTop
:
10
}}
>
<
Text
style
=
{{
fontSize
:
scaleSize
(
2
0
),
color
:
'#FC4000'
}}
>
<
Text
style
=
{{
fontSize
:
scaleSize
(
2
5
),
color
:
'#FC4000'
}}
>
如无法接通客服
,
可拨打电话
:
{
contact
}
如无法接通客服
,
可拨打电话
:
{
contact
}
<
/Text
>
<
/Text
>
<
/View
>
<
/View
>
<
Touch
onPress
=
{
closeHint
}
>
<
Touch
onPress
=
{
closeHint
}
>
...
...
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