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
1f28a273
Commit
1f28a273
authored
Jan 21, 2021
by
zeven
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
e7bbf936
f804bbfa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
77 deletions
+22
-77
CounterMixins.js
src/pages/CounterMixins.js
+12
-2
VerticalPage.js
src/pages/VerticalPage.js
+10
-75
No files found.
src/pages/CounterMixins.js
View file @
1f28a273
...
...
@@ -532,8 +532,18 @@ const CounterMixins = ComposeComponent => {
}
// 称重计价不可修改数量
this
.
goodsMap
[
barcode
]
=
data
.
data
;
let
dataReal
=
data
.
data
;
dataReal
.
num
=
data
.
data
.
num
||
1
;
goodsArr
.
push
({...
dataReal
});
let
t
=
0
;
for
(
let
i
=
0
;
i
<
goodsArr
.
length
;
i
++
)
{
if
(
goodsArr
[
i
].
barcode
===
barcode
)
{
goodsArr
[
i
].
num
+=
1
;
}
else
{
t
++
;
}
}
if
(
t
===
goodsArr
.
length
)
{
dataReal
.
num
=
data
.
data
.
num
||
1
;
goodsArr
.
push
({...
dataReal
});
}
const
current
=
Math
.
ceil
(
goodsArr
.
length
/
window
.
pageSize
);
this
.
setState
({
current
,
...
...
src/pages/VerticalPage.js
View file @
1f28a273
...
...
@@ -4,7 +4,6 @@ import AsyncStorage from '@react-native-community/async-storage';
import
Swiper
from
'react-native-swiper'
;
import
QRCode
from
'react-native-qrcode-svg'
;
import
Icon
from
'react-native-vector-icons/Ionicons'
;
import
Icons
from
'react-native-vector-icons/MaterialIcons'
;
// import { connect } from 'react-redux';
import
CounterMixins
from
'./CounterMixins'
;
import
NP
from
'../utils/np'
;
...
...
@@ -327,6 +326,7 @@ class VerticalPage extends Component {
<
View
style
=
{
styles
.
ThStyleMoney
}
>
<
Text
style
=
{
styles
.
ThText
}
>
金额
<
/Text
>
<
/View
>
<
View
/>
<
/View
>
<
/View
>
<
View
...
...
@@ -484,7 +484,6 @@ class VerticalPage extends Component {
goods
,
goodsArr
,
qrHost
,
current
,
autoplayTime
,
imgArr
,
adType
,
...
...
@@ -507,8 +506,8 @@ class VerticalPage extends Component {
}
window
.
pageSize
=
pageSize
;
contact
=
contact
||
'未授权'
;
let
goodsLength
=
Math
.
ceil
(
parseFloat
(
goodsArr
.
length
/
pageSize
));
let
gaTemp
=
goodsArr
.
slice
((
current
-
1
)
*
pageSize
,
current
*
pageSize
);
//
let goodsLength = Math.ceil(parseFloat(goodsArr.length / pageSize));
//
let gaTemp = goodsArr.slice((current - 1) * pageSize, current * pageSize);
let
total
=
0
;
// 总数量
let
totalPrice
=
0
;
// 总价
let
totalCount
=
0
;
// 总优惠
...
...
@@ -549,80 +548,16 @@ class VerticalPage extends Component {
<
/View
>
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
View
style
=
{{
width
:
'
9
0%'
}}
>
<
View
style
=
{{
width
:
'
10
0%'
}}
>
<
FlatList
style
=
{
styles
.
goodsStyle
}
ListHeaderComponent
=
{
this
.
renderHeader
}
keyExtractor
=
{
this
.
keyExtractor
}
horizontal
=
{
false
}
data
=
{
g
aTemp
}
data
=
{
g
oodsArr
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderCell
(
item
,
index
)}
/
>
<
/View
>
<
View
style
=
{{
width
:
'10%'
,
flexDirection
:
'column'
,
position
:
'relative'
,
}}
>
<
View
style
=
{{
height
:
width
>
801
?
81
:
scaleHeight
(
118
),
backgroundColor
:
'#fff'
,
}}
/
>
<
View
style
=
{{
height
:
width
>
801
?
8
:
scaleHeight
(
17.1
)}}
/
>
<
View
style
=
{
styles
.
pagination
}
>
<
Touch
disabled
=
{
current
<=
1
}
onPress
=
{()
=>
this
.
props
.
dropUp
()}
>
<
Image
source
=
{
current
>
1
?
require
(
'../assets/Vertical/arrowu01.png'
)
:
require
(
'../assets/Vertical/arrowu02.png'
)
}
style
=
{
styles
.
imgPagination
}
/
>
<
/Touch
>
<
Text
style
=
{
styles
.
paginationText
}
>
{
goodsLength
===
0
?
0
:
current
}
/{goodsLength
}
<
/Text
>
<
Touch
disabled
=
{
current
>=
goodsLength
}
onPress
=
{()
=>
this
.
props
.
dropDown
(
goodsLength
)}
>
<
Image
source
=
{
current
<
goodsLength
?
require
(
'../assets/Vertical/arrowd01.png'
)
:
require
(
'../assets/Vertical/arrowd02.png'
)
}
style
=
{
styles
.
imgPagination
}
/
>
<
/Touch
>
<
/View
>
{
!
admin
.
autoClick
&&
(
<
Touch
onPress
=
{
this
.
setting
}
style
=
{{
position
:
'absolute'
,
width
:
scaleSize
(
100
),
height
:
scaleSize
(
100
),
bottom
:
scaleSize
(
100
),
right
:
0
,
backgroundColor
:
'rgba(0,0,0,0.1)'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
borderRadius
:
10
,
zIndex
:
999
,
}}
>
<
Icons
name
=
"accessibility"
style
=
{{
fontSize
:
setSpText
(
60
),
color
:
'#fff'
}}
/
>
<
/Touch
>
)}
<
/View
>
<
/View
>
<
View
style
=
{
...
...
@@ -1255,7 +1190,7 @@ const styles = {
flexDirection
:
'row'
,
},
firstThStyle
:
{
width
:
'3
3
%'
,
width
:
'3
0
%'
,
alignItems
:
'flex-start'
,
justifyContent
:
'center'
,
paddingTop
:
width
>
801
?
18
:
scaleHeight
(
30
),
...
...
@@ -1273,7 +1208,7 @@ const styles = {
paddingRight
:
width
>
801
?
10
:
scaleSize
(
20
),
},
ThStyleMoney
:
{
width
:
'
27
%'
,
width
:
'
30
%'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
paddingTop
:
width
>
801
?
18
:
scaleHeight
(
30
),
...
...
@@ -1293,7 +1228,7 @@ const styles = {
backgroundColor
:
'#F0F0F0'
,
},
firstTdStyle
:
{
width
:
'3
3
%'
,
width
:
'3
0
%'
,
alignItems
:
'flex-start'
,
justifyContent
:
'center'
,
paddingTop
:
width
>
801
?
18
:
scaleHeight
(
30
),
...
...
@@ -1313,7 +1248,7 @@ const styles = {
},
TdStyleMoney
:
{
flexDirection
:
'row'
,
width
:
'
27
%'
,
width
:
'
30
%'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
paddingTop
:
width
>
801
?
18
:
scaleHeight
(
30
),
...
...
@@ -1324,7 +1259,7 @@ const styles = {
},
iconStyle
:
{
position
:
'absolute'
,
right
:
0
,
right
:
2
0
,
},
TdText
:
{
fontSize
:
width
>
801
?
25
:
setSpText
(
30
),
...
...
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