Commit 719d11a0 by 黄日华

收银机增加商品数字展示

调整每行修改商品数量和删除商品触发区域
parent 360699d5
...@@ -75,6 +75,7 @@ const CounterMixins = ComposeComponent => { ...@@ -75,6 +75,7 @@ const CounterMixins = ComposeComponent => {
nobodyVoice: false, nobodyVoice: false,
numberValue: '', numberValue: '',
human: false, human: false,
totalNum: 0,
}; };
componentWillMount = async () => { componentWillMount = async () => {
...@@ -922,6 +923,9 @@ const CounterMixins = ComposeComponent => { ...@@ -922,6 +923,9 @@ const CounterMixins = ComposeComponent => {
Number(NP.round(totalNum, 2).toFixed(2)) + Number(NP.round(totalNum, 2).toFixed(2)) +
Number(NP.round(v.num, 2).toFixed(2)); Number(NP.round(v.num, 2).toFixed(2));
}); });
this.setState({
totalNum,
});
Speech.speak('共' + totalNum + '件商品'); Speech.speak('共' + totalNum + '件商品');
}; };
......
...@@ -492,12 +492,15 @@ class VerticalPage extends Component { ...@@ -492,12 +492,15 @@ class VerticalPage extends Component {
</View> </View>
<View style={styles.TdStyle}> <View style={styles.TdStyle}>
{item.numChange ? ( {item.numChange ? (
<Touch
style={styles.numChange}
onPress={() => this.props.numRemove(item.num, index)}>
<Icon <Icon
onPress={() => this.props.numRemove(item.num, index)}
name="ios-remove-circle" name="ios-remove-circle"
color={item.num === 1 ? '#909090' : '#00c670'} color={item.num === 1 ? '#909090' : '#00c670'}
size={35} size={35}
/> />
</Touch>
) : ( ) : (
<View /> <View />
)} )}
...@@ -507,12 +510,11 @@ class VerticalPage extends Component { ...@@ -507,12 +510,11 @@ class VerticalPage extends Component {
<Text style={styles.TdText}> {item.num} </Text> <Text style={styles.TdText}> {item.num} </Text>
</Touch> </Touch>
{item.numChange ? ( {item.numChange ? (
<Icon <Touch
name="ios-add-circle" style={styles.numChange}
color="#00c670" onPress={() => this.props.numAdd(item.num, index)}>
size={35} <Icon name="ios-add-circle" color="#00c670" size={35} />
onPress={() => this.props.numAdd(item.num, index)} </Touch>
/>
) : ( ) : (
<View /> <View />
)} )}
...@@ -590,6 +592,7 @@ class VerticalPage extends Component { ...@@ -590,6 +592,7 @@ class VerticalPage extends Component {
autoplayTime, autoplayTime,
imgArr, imgArr,
adType, adType,
totalNum,
} = this.props; } = this.props;
let { let {
contact, contact,
...@@ -761,7 +764,24 @@ class VerticalPage extends Component { ...@@ -761,7 +764,24 @@ class VerticalPage extends Component {
height: width > 801 && !isCard ? '62%' : '94%', height: width > 801 && !isCard ? '62%' : '94%',
}}> }}>
<View style={{flexDirection: 'row', flex: 1}}> <View style={{flexDirection: 'row', flex: 1}}>
<View style={{width: '100%'}}> <View style={{width: '100%', position: 'relative'}}>
<View
pointerEvents="none"
style={{
width: '100%',
height: width > 801 && !isCard ? '62%' : '94%',
position: 'absolute',
top: 0,
left: 0,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
opacity: 0.5,
background: '#ccc',
zIndex: 999,
}}>
<Text style={{fontSize: 500}}>{totalNum}</Text>
</View>
<View style={{backgroundColor: '#fff'}}> <View style={{backgroundColor: '#fff'}}>
<View <View
style={{ style={{
...@@ -865,6 +885,11 @@ class VerticalPage extends Component { ...@@ -865,6 +885,11 @@ class VerticalPage extends Component {
</View> </View>
<View style={styles.TdStyle}> <View style={styles.TdStyle}>
{item.numChange ? ( {item.numChange ? (
<Touch
style={styles.numChange}
onPress={() =>
this.props.numAdd(item.num, index)
}>
<Icon <Icon
onPress={() => onPress={() =>
this.props.numRemove(item.num, index) this.props.numRemove(item.num, index)
...@@ -873,6 +898,7 @@ class VerticalPage extends Component { ...@@ -873,6 +898,7 @@ class VerticalPage extends Component {
color={item.num === 1 ? '#909090' : '#00c670'} color={item.num === 1 ? '#909090' : '#00c670'}
size={35} size={35}
/> />
</Touch>
) : ( ) : (
<View /> <View />
)} )}
...@@ -884,12 +910,20 @@ class VerticalPage extends Component { ...@@ -884,12 +910,20 @@ class VerticalPage extends Component {
<Text style={styles.TdText}> {item.num} </Text> <Text style={styles.TdText}> {item.num} </Text>
</Touch> </Touch>
{item.numChange ? ( {item.numChange ? (
<Touch
style={styles.numChange}
onPress={() =>
this.props.numAdd(item.num, index)
}>
<Icon <Icon
name="ios-add-circle" name="ios-add-circle"
color="#00c670" color="#00c670"
size={35} size={35}
onPress={() => this.props.numAdd(item.num, index)} onPress={() =>
this.props.numAdd(item.num, index)
}
/> />
</Touch>
) : ( ) : (
<View /> <View />
)} )}
...@@ -904,15 +938,15 @@ class VerticalPage extends Component { ...@@ -904,15 +938,15 @@ class VerticalPage extends Component {
{NP.round(item.prePrice * item.num, 2).toFixed(2)} {NP.round(item.prePrice * item.num, 2).toFixed(2)}
</Text> </Text>
)} )}
<View style={styles.iconStyle}> <Touch
onPress={() => this.props.removeIndex(index)}
style={styles.iconStyle}>
<Icon <Icon
style={{marginLeft: 0}}
name="ios-close-circle" name="ios-close-circle"
size={35} size={35}
color={colors.bg} color={colors.bg}
onPress={() => this.props.removeIndex(index)}
/> />
</View> </Touch>
</View> </View>
</View> </View>
); );
...@@ -1712,8 +1746,9 @@ const styles = { ...@@ -1712,8 +1746,9 @@ const styles = {
position: 'relative', position: 'relative',
}, },
iconStyle: { iconStyle: {
paddingHorizontal: 10,
position: 'absolute', position: 'absolute',
right: 20, right: 10,
}, },
TdText: { TdText: {
fontSize: width > 801 ? 25 : setSpText(30), fontSize: width > 801 ? 25 : setSpText(30),
...@@ -1829,6 +1864,9 @@ const styles = { ...@@ -1829,6 +1864,9 @@ const styles = {
fontSize: scaleSize(45), fontSize: scaleSize(45),
color: '#ffffff', color: '#ffffff',
}, },
numChange: {
paddingHorizontal: 10,
},
}; };
export default CounterMixins(VerticalPage); export default CounterMixins(VerticalPage);
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