Commit 1f28a273 by zeven

Merge remote-tracking branch 'origin/master'

parents e7bbf936 f804bbfa
......@@ -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,
......
......@@ -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: '90%'}}>
<View style={{width: '100%'}}>
<FlatList
style={styles.goodsStyle}
ListHeaderComponent={this.renderHeader}
keyExtractor={this.keyExtractor}
horizontal={false}
data={gaTemp}
data={goodsArr}
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: '33%',
width: '30%',
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: '33%',
width: '30%',
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: 20,
},
TdText: {
fontSize: width > 801 ? 25 : setSpText(30),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment