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
fc72d23f
Commit
fc72d23f
authored
Oct 29, 2022
by
黄日华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
感应进店后续前端修改
parent
c9ecd7bb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
13 deletions
+124
-13
CounterMixins.js
src/pages/CounterMixins.js
+114
-3
VerticalPage.js
src/pages/VerticalPage.js
+8
-8
store.js
src/services/store.js
+2
-2
No files found.
src/pages/CounterMixins.js
View file @
fc72d23f
...
...
@@ -19,6 +19,8 @@ import {width, height, scaleSize} from '../utils/screen';
import
EnterEvent
from
'../utils/EnterEvent'
;
import
Printer
from
'../utils/Printer'
;
import
AutoClick
from
'../utils/AutoClick'
;
import
QRCode
from
'react-native-qrcode-svg'
;
import
{
login
,
ossLink
}
from
'../utils/config'
;
window
.
RN
=
RN
;
window
.
Toast
=
Toast
;
...
...
@@ -67,6 +69,8 @@ const CounterMixins = ComposeComponent => {
printer
:
[],
receiptTime
:
5
,
cloudFinishModal
:
false
,
noBuyModal
:
false
,
logoVisible
:
true
,
};
componentWillMount
=
async
()
=>
{
...
...
@@ -81,6 +85,8 @@ const CounterMixins = ComposeComponent => {
adType
:
data
.
data
.
type
,
});
}
this
.
initSetting
();
await
this
.
refreshLogo
();
const
stype
=
await
AsyncStorage
.
getItem
(
'STYPE'
);
const
qrHost
=
await
AsyncStorage
.
getItem
(
'QRHOST'
);
await
this
.
setState
({
qrHost
,
stype
});
...
...
@@ -128,6 +134,46 @@ const CounterMixins = ComposeComponent => {
this
.
listen
();
};
initSetting
=
()
=>
{
AutoClick
.
isSettingsOn
().
then
(
setting
=>
{
if
(
!
setting
)
this
.
setState
({
setting
:
true
});
// 展示辅助按钮
});
AsyncStorage
.
getItem
(
'hideLogo'
).
then
(
hide
=>
{
if
(
hide
===
'true'
)
this
.
setState
({
logoVisible
:
false
});
// 隐藏LOGO
});
};
refreshLogo
=
async
()
=>
{
let
group
=
await
AsyncStorage
.
getItem
(
'KEY'
);
let
{
data
}
=
await
this
.
props
.
dispatch
({
type
:
'store/findModuleSetting'
,
group
,
});
if
(
data
.
code
===
1
&&
data
.
data
)
{
const
state
=
{
priceVisible
:
data
.
data
.
priceVisible
};
if
(
data
.
data
.
cardCounter
)
{
// 是否支持刷卡
state
.
isCard
=
true
;
window
.
cardCounter
=
data
.
data
.
cardCounter
;
}
if
(
data
.
data
.
logo
)
state
.
logo
=
`
${
ossLink
}
/
${
data
.
data
.
logo
}
`
;
this
.
setState
(
state
);
}
};
hideLogo
=
async
()
=>
{
if
(
!
this
.
num
)
this
.
num
=
0
;
this
.
num
++
;
if
(
this
.
num
>=
10
)
{
this
.
num
=
0
;
let
{
logoVisible
}
=
this
.
state
;
AsyncStorage
.
setItem
(
'hideLogo'
,
String
(
logoVisible
));
this
.
setState
({
logoVisible
:
!
logoVisible
,
});
}
};
handleCard
=
async
cardId
=>
{
Toast
.
hide
();
if
(
!
cardId
)
return
;
...
...
@@ -945,6 +991,7 @@ const CounterMixins = ComposeComponent => {
onOpen
=
async
()
=>
{
const
{
data
}
=
await
this
.
props
.
dispatch
({
type
:
'store/open'
,
orderId
:
this
.
orderId
,
});
if
(
data
.
code
===
1
)
{
this
.
setState
({
...
...
@@ -952,12 +999,15 @@ const CounterMixins = ComposeComponent => {
});
Speech
.
speak
(
data
.
msg
||
'门已经打开,谢谢惠顾'
);
}
else
{
Toast
.
info
(
data
.
msg
||
'开门失败,请联系客服处理'
,
2
);
Speech
.
speak
(
data
.
msg
||
'开门失败,请联系客服处理'
);
setTimeout
(()
=>
{
this
.
setState
({
await
this
.
setState
({
cloudFinishModal
:
false
,
});
this
.
setState
({
noBuyModal
:
true
,
});
setTimeout
(()
=>
{
this
.
setState
({
noBuyModal
:
false
});
},
10000
);
}
this
.
clearList
();
...
...
@@ -981,9 +1031,55 @@ const CounterMixins = ComposeComponent => {
amount
,
visible
,
receiptTime
,
noBuyModal
,
logoVisible
,
qrHost
,
}
=
this
.
state
;
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
RN
.
Modal
style
=
{{
margin
:
0
,
padding
:
0
}}
visible
=
{
noBuyModal
}
transparent
>
<
View
style
=
{{
width
:
'100%'
,
height
:
'100%'
,
margin
:
0
,
position
:
'relative'
,
}}
>
<
Touch
style
=
{{
width
:
'100%'
,
height
:
'100%'
,
backgroundColor
:
'#000'
,
opacity
:
0.5
,
}}
onPress
=
{()
=>
this
.
setState
({
noBuyModal
:
false
})}
>
<
View
/>
<
/Touch
>
<
View
style
=
{
styles
.
HintPhone
}
>
<
Image
source
=
{
require
(
'../assets/Vertical/realname.png'
)}
style
=
{{
left
:
20
,
position
:
'absolute'
}}
/
>
<
Image
source
=
{
require
(
'../assets/Vertical/police.png'
)}
style
=
{{
right
:
20
,
position
:
'absolute'
}}
/
>
<
Text
style
=
{{
fontSize
:
scaleSize
(
50
),
marginBottom
:
20
}}
>
请扫码出店
<
/Text
>
<
QRCode
logoSize
=
{
width
>
801
?
50
:
scaleSize
(
100
)}
// logoBackgroundColor="#fc4000"
logo
=
{
logoVisible
&&
require
(
'../assets/logo2.png'
)}
size
=
{
width
>
801
?
200
:
scaleSize
(
400
)}
value
=
{
`
${
qrHost
||
login
}
/#/store-leave-g
${
this
.
storeKey
}
`
}
/
>
<
/View
>
<
/View
>
<
/RN.Modal
>
<
Modal
visible
=
{
visible
}
transparent
>
{
/*<View style={{width,height,backgroundColor:'rgba(0,0,0,.5)'}} />*/
}
<
View
...
...
@@ -1156,4 +1252,19 @@ const CloseButton = ({onClose, style}) => {
);
};
const
styles
=
{
HintPhone
:
{
width
:
width
>
801
?
'50%'
:
'80%'
,
height
:
width
>
801
?
'25%'
:
'40%'
,
backgroundColor
:
'#ffffff'
,
position
:
'absolute'
,
top
:
'20%'
,
left
:
width
>
801
?
'25%'
:
'10%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
opacity
:
40
,
},
};
export
default
CounterMixins
;
src/pages/VerticalPage.js
View file @
fc72d23f
...
...
@@ -52,7 +52,7 @@ class VerticalPage extends Component {
priceVisible
:
true
,
isCard
:
false
,
cardVisible
:
false
,
no
b
uyModal
:
false
,
no
B
uyModal
:
false
,
};
async
componentWillMount
()
{
...
...
@@ -574,12 +574,12 @@ class VerticalPage extends Component {
},
8000
);
};
show
Nob
uyModal
=
()
=>
{
show
noB
uyModal
=
()
=>
{
Speech
.
speak
(
'请扫码出店'
);
this
.
setState
({
no
b
uyModal
:
true
});
this
.
setState
({
no
B
uyModal
:
true
});
clearTimeout
(
this
.
nobuyTimeout
);
this
.
nobuyTimeout
=
setTimeout
(()
=>
{
this
.
setState
({
no
b
uyModal
:
false
});
this
.
setState
({
no
B
uyModal
:
false
});
},
10000
);
};
...
...
@@ -601,7 +601,7 @@ class VerticalPage extends Component {
priceVisible
,
stype
,
isCard
,
no
b
uyModal
,
no
B
uyModal
,
}
=
this
.
state
;
pageSize
=
goods
&&
goods
.
bags
.
length
>
0
...
...
@@ -642,7 +642,7 @@ class VerticalPage extends Component {
this
.
state
.
faceType
===
'wxpay'
?
this
.
wxFacepay
:
this
.
smilepay
;
return
(
<
View
style
=
{{
flex
:
1
,
position
:
'relative'
}}
>
<
Modal
visible
=
{
no
b
uyModal
}
transparent
>
<
Modal
visible
=
{
no
B
uyModal
}
transparent
>
<
View
>
<
Touch
style
=
{{
...
...
@@ -650,7 +650,7 @@ class VerticalPage extends Component {
height
:
'100%'
,
backgroundColor
:
'rgba(0, 0, 0, .5)'
,
}}
onPress
=
{()
=>
this
.
setState
({
no
b
uyModal
:
false
})}
>
onPress
=
{()
=>
this
.
setState
({
no
B
uyModal
:
false
})}
>
<
View
/>
<
/Touch
>
<
View
style
=
{
styles
.
HintPhone
}
>
...
...
@@ -687,7 +687,7 @@ class VerticalPage extends Component {
<
Text
style
=
{
styles
.
callText
}
>
呼叫客服
<
/Text
>
<
/View
>
<
/Touch
>
<
Touch
onPress
=
{()
=>
this
.
show
Nob
uyModal
()}
>
<
Touch
onPress
=
{()
=>
this
.
show
noB
uyModal
()}
>
<
View
style
=
{
styles
.
guardModal_button_nobuy
}
>
<
Text
style
=
{
styles
.
callText
}
>
无购物出店
<
/Text
>
<
/View
>
...
...
src/services/store.js
View file @
fc72d23f
...
...
@@ -35,8 +35,8 @@ export function door({userId}) {
return
axios
.
post
(
'/store/door'
,
qs
.
stringify
({
userId
}));
}
export
function
open
()
{
return
axios
.
post
(
'/store/openDoor'
);
export
function
open
(
{
orderId
}
)
{
return
axios
.
post
(
'/store/openDoor'
,
qs
.
stringify
({
orderId
})
);
}
export
function
wxdoor
({
...
...
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