Commit 3ac1b1d9 by 修福龙

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

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