Commit 3ac1b1d9 by 修福龙

商家端可控制收银台的输入价格功能的显示

parent df9657b6
...@@ -93,25 +93,28 @@ class OrderDetailMini extends Component { ...@@ -93,25 +93,28 @@ class OrderDetailMini extends Component {
</View> </View>
<View style={styles.TdStyle}> <View style={styles.TdStyle}>
{item.num ? ( {item.num ? (
<Text style={styles.TdText}> {NP.round(item.num, 0).toFixed(0)} </Text> <Text style={styles.TdText}>
{' '}
{NP.round(item.num, 0).toFixed(0)}{' '}
</Text>
) : ( ) : (
<Text style={styles.TdText}> 0 </Text> <Text style={styles.TdText}> 0 </Text>
)} )}
</View> </View>
<View style={styles.TdStyle}> <View style={styles.TdStyle}>
{ item.num ? ( {item.num ? (
item.price ? ( item.price ? (
<Text style={styles.TdText}> <Text style={styles.TdText}>
{NP.round(item.price * item.num, 2).toFixed(2)} {NP.round(item.price * item.num, 2).toFixed(2)}
</Text> </Text>
) : ( ) : (
<Text style={styles.TdText}> <Text style={styles.TdText}>
{NP.round(item.prePrice * item.num, 2).toFixed(2)} {NP.round(item.prePrice * item.num, 2).toFixed(2)}
</Text> </Text>
) )
) : ( ) : (
<Text style={styles.TdText}> 0.00 </Text> <Text style={styles.TdText}> 0.00 </Text>
) } )}
</View> </View>
</View> </View>
); );
......
...@@ -42,6 +42,7 @@ class VerticalPage extends Component { ...@@ -42,6 +42,7 @@ class VerticalPage extends Component {
setting: false, setting: false,
logoVisible: true, logoVisible: true,
logo: '', logo: '',
priceVisible: true,
}; };
async componentWillMount() { async componentWillMount() {
...@@ -102,9 +103,12 @@ class VerticalPage extends Component { ...@@ -102,9 +103,12 @@ class VerticalPage extends Component {
// logo改变 // logo改变
if (!window.socket.hasListeners('storeSetting')) { if (!window.socket.hasListeners('storeSetting')) {
window.socket.on('storeSetting', async data => { window.socket.on('storeSetting', async ({logo, priceVisible}) => {
// 重新获取logo // 重新获取logo
await this.refreshLogo(); if (logo) {
await this.setState({logo: `${ossLink}/${logo}`});
}
await this.setState({priceVisible});
}); });
} }
...@@ -525,7 +529,7 @@ class VerticalPage extends Component { ...@@ -525,7 +529,7 @@ class VerticalPage extends Component {
imgArr, imgArr,
adType, adType,
} = this.props; } = this.props;
let {contact, hintVisible, logoVisible, logo} = this.state; let {contact, hintVisible, logoVisible, logo, priceVisible} = this.state;
pageSize = pageSize =
goods && goods.bags.length > 0 goods && goods.bags.length > 0
? goods && goods.bags.length > 3 ? goods && goods.bags.length > 3
...@@ -574,9 +578,12 @@ class VerticalPage extends Component { ...@@ -574,9 +578,12 @@ class VerticalPage extends Component {
<View style={styles.left}> <View style={styles.left}>
{logoVisible && {logoVisible &&
(logo ? ( (logo ? (
<Image style={{width: 100, height: 100}} source={{uri: logo}} /> <Image style={styles.logo} source={{uri: logo}} />
) : ( ) : (
<Image source={require('../assets/Vertical/logo.png')} /> <Image
style={styles.logo}
source={require('../assets/Vertical/logo.png')}
/>
))} ))}
<Image style={styles.counterText} source={counterText} /> <Image style={styles.counterText} source={counterText} />
<Image source={img24h} /> <Image source={img24h} />
...@@ -787,15 +794,17 @@ class VerticalPage extends Component { ...@@ -787,15 +794,17 @@ class VerticalPage extends Component {
style={{backgroundColor: '#fc4000', marginRight: 50}}> style={{backgroundColor: '#fc4000', marginRight: 50}}>
<Text style={styles.btnText}>输入条码</Text> <Text style={styles.btnText}>输入条码</Text>
</Touch> </Touch>
<Touch {priceVisible && (
onPress={() => this.props.handleCodeless()} <Touch
style={{ onPress={() => this.props.handleCodeless()}
backgroundColor: '#fc4000', style={{
marginRight: 50, backgroundColor: '#fc4000',
marginLeft: 50, marginRight: 50,
}}> marginLeft: 50,
<Text style={styles.btnText}>输入价格</Text> }}>
</Touch> <Text style={styles.btnText}>输入价格</Text>
</Touch>
)}
<Touch <Touch
onPress={this.props.clearList} onPress={this.props.clearList}
style={{backgroundColor: '#fc4000', marginLeft: 50}}> style={{backgroundColor: '#fc4000', marginLeft: 50}}>
...@@ -1082,9 +1091,9 @@ const styles = { ...@@ -1082,9 +1091,9 @@ const styles = {
height: '100%', height: '100%',
}, },
header: { header: {
alignItems: 'center',
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-around', justifyContent: 'space-around',
alignItems: 'center',
backgroundColor: '#fc4000', backgroundColor: '#fc4000',
height: '6%', height: '6%',
paddingRight: width > 801 ? 40 : scaleSize(25), paddingRight: width > 801 ? 40 : scaleSize(25),
...@@ -1094,6 +1103,10 @@ const styles = { ...@@ -1094,6 +1103,10 @@ const styles = {
flexDirection: 'row', flexDirection: 'row',
width: width > 801 ? '60%' : '55%', width: width > 801 ? '60%' : '55%',
}, },
logo: {
width: width > 801 ? 100 : scaleSize(75),
height: width > 801 ? 100 : scaleSize(75),
},
counterText: { counterText: {
marginLeft: width > 801 ? 40 : scaleSize(22), marginLeft: width > 801 ? 40 : scaleSize(22),
marginRight: width > 801 ? 40 : scaleSize(22), marginRight: width > 801 ? 40 : scaleSize(22),
......
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