...
|
...
|
@@ -31,13 +31,22 @@ export default class DeliverGoods extends Component { |
|
|
});
|
|
|
this._renderRow = this._renderRow.bind(this);
|
|
|
this._picker = this._picker.bind(this);
|
|
|
this._onChangeText = this._onChangeText.bind(this);
|
|
|
this._onValueChange = this._onValueChange.bind(this);
|
|
|
|
|
|
this.state = {
|
|
|
express: '',
|
|
|
showPicker: false,
|
|
|
qrCode: ''
|
|
|
};
|
|
|
}
|
|
|
|
|
|
_onChangeText(text){
|
|
|
this.props.setExpressNum && this.props.setExpressNum(text);
|
|
|
}
|
|
|
|
|
|
_onValueChange(value){
|
|
|
this.props.setExpressId && this.props.setExpressId(value);
|
|
|
}
|
|
|
|
|
|
_renderRow(rowData, sectionID, rowID) {
|
|
|
return(
|
|
|
<DeliverGoodsCell resource={rowData}/>
|
...
|
...
|
@@ -45,7 +54,7 @@ export default class DeliverGoods extends Component { |
|
|
}
|
|
|
|
|
|
_picker() {
|
|
|
let {expressList} = this.props.resource;
|
|
|
let {expressList,expressId} = this.props.resource;
|
|
|
let list = expressList?expressList.list:[];
|
|
|
|
|
|
return (
|
...
|
...
|
@@ -57,8 +66,8 @@ export default class DeliverGoods extends Component { |
|
|
</TouchableOpacity>
|
|
|
<View style={styles.pickerSubContainer}>
|
|
|
<Picker
|
|
|
selectedValue={this.state.express}
|
|
|
onValueChange={(lang) => this.setState({express: lang})}>
|
|
|
selectedValue={expressId}
|
|
|
onValueChange={this._onValueChange}>
|
|
|
|
|
|
{list.map((value, i) => {
|
|
|
return (<Picker.Item label={value.get('companyName')} value={value.get('companyName')} />);
|
...
|
...
|
@@ -72,7 +81,7 @@ export default class DeliverGoods extends Component { |
|
|
|
|
|
render() {
|
|
|
let {initialRes,resource} = this.props;
|
|
|
let {expressList,storehouse} = resource;
|
|
|
let {expressList,storehouse,expressNum,expressId} = resource;
|
|
|
|
|
|
let address = storehouse?storehouse.get('address'):'';
|
|
|
let adminName = storehouse?storehouse.get('adminName'):'';
|
...
|
...
|
@@ -90,7 +99,7 @@ export default class DeliverGoods extends Component { |
|
|
}}>
|
|
|
<View style={styles.pickerView}>
|
|
|
<Text style={styles.pickerText} numberOfLines={1}>
|
|
|
{this.state.express}
|
|
|
{expressId}
|
|
|
</Text>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
...
|
...
|
@@ -102,8 +111,8 @@ export default class DeliverGoods extends Component { |
|
|
<TextInput style={styles.numberInputText}
|
|
|
ref = 'textInput1'
|
|
|
placeholder={'输入物流单号'}
|
|
|
onChangeText={(text) => this.setState({qrCode: text})}
|
|
|
value={this.state.qrCode}
|
|
|
onChangeText={this._onChangeText}
|
|
|
value={expressNum}
|
|
|
/>
|
|
|
<TouchableOpacity onPress={() => {
|
|
|
QRNativeConfig.startScanQRCode();
|
...
|
...
|
@@ -130,11 +139,9 @@ export default class DeliverGoods extends Component { |
|
|
componentWillMount() {
|
|
|
let that = this;
|
|
|
DeviceEventEmitter.addListener('scanQRComplete', function(param) {
|
|
|
that.setState({qrCode: param.QRCode})
|
|
|
console.log(that.state.qrCode);
|
|
|
this.props.setExpressNum && this.props.setExpressNum(param.QRCode);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
...
|
...
|
|