|
|
'use strict';
|
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
import LoadMoreIndicator from '../indicator/LoadMoreIndicator';
|
|
|
import LoadingIndicator from '../indicator/LoadingIndicator';
|
|
|
import moment from 'moment';
|
|
|
import DeliverGoodsCell from './DeliverGoodsCell';
|
|
|
|
|
|
import {
|
|
|
StyleSheet,
|
|
|
View,
|
|
|
Text,
|
|
|
ListView,
|
|
|
Image,
|
|
|
Dimensions,
|
|
|
TouchableOpacity,
|
|
|
TextInput,
|
|
|
Picker,
|
|
|
} from 'react-native';
|
|
|
|
|
|
export default class DeliverGoods extends Component {
|
|
|
|
|
|
constructor(props) {
|
|
|
super (props);
|
|
|
this.dataSource = new ListView.DataSource({
|
|
|
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
|
|
|
});
|
|
|
this._renderRow = this._renderRow.bind(this);
|
|
|
this._picker = this._picker.bind(this);
|
|
|
this.state = {
|
|
|
express: '1',
|
|
|
showPicker: false,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
_renderRow(rowData, sectionID, rowID) {
|
|
|
return(
|
|
|
<DeliverGoodsCell />
|
|
|
);
|
|
|
}
|
|
|
|
|
|
_picker() {
|
|
|
return (
|
|
|
<View style={styles.pickerContainer}>
|
|
|
<TouchableOpacity onPress={() => {
|
|
|
this.setState({showPicker: false});
|
|
|
}}>
|
|
|
<View style={styles.pickerSpaceContainer}/>
|
|
|
</TouchableOpacity>
|
|
|
<View style={styles.pickerSubContainer}>
|
|
|
<Picker
|
|
|
selectedValue={this.state.express}
|
|
|
onValueChange={(lang) => this.setState({express: lang})}>
|
|
|
<Picker.Item label="Java" value="java" />
|
|
|
<Picker.Item label="1" value="1" />
|
|
|
<Picker.Item label="2" value="2" />
|
|
|
<Picker.Item label="JavaScript" value="js" />
|
|
|
</Picker>
|
|
|
</View>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
<View style={styles.cell0}>
|
|
|
<Text style={styles.numberName} numberOfLines={1}>
|
|
|
物流公司:
|
|
|
</Text>
|
|
|
<TouchableOpacity onPress={() => {
|
|
|
this.setState({showPicker: !this.state.showPicker});
|
|
|
}}>
|
|
|
<View style={styles.pickerView}>
|
|
|
<Text style={styles.pickerText} numberOfLines={1}>
|
|
|
{this.state.express}
|
|
|
</Text>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
<View style={styles.cell0}>
|
|
|
<Text style={styles.numberName} numberOfLines={1}>
|
|
|
物流单号:
|
|
|
</Text>
|
|
|
<TextInput style={styles.numberInputText}
|
|
|
ref = 'textInput1'
|
|
|
placeholder={'输入物流单号'}
|
|
|
/>
|
|
|
<TouchableOpacity onPress={() => {
|
|
|
}}>
|
|
|
<View style={styles.camera}>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
<View style={styles.cellAddress}>
|
|
|
<Text style={styles.cellAddressText} numberOfLines={3}>
|
|
|
收货地址:南京1号仓库 江苏省南京市江宁区江宁开发经济技术开发区 苏源大道87号YOHO!有货物流中心东一楼 曾庆红
|
|
|
</Text>
|
|
|
</View>
|
|
|
<ListView
|
|
|
style={styles.listContainer}
|
|
|
dataSource={this.dataSource.cloneWithRows([1,1,11,1,1,1,1])}
|
|
|
renderRow={this._renderRow}
|
|
|
/>
|
|
|
{this.state.showPicker ? this._picker() : null}
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
|
|
const styles = StyleSheet.create({
|
|
|
container: {
|
|
|
flex: 1,
|
|
|
backgroundColor: 'white',
|
|
|
},
|
|
|
cell0: {
|
|
|
width: width,
|
|
|
height: 50,
|
|
|
backgroundColor: 'white',
|
|
|
flexDirection: 'row',
|
|
|
borderBottomWidth: 1,
|
|
|
borderBottomColor: 'black',
|
|
|
alignItems: 'center',
|
|
|
},
|
|
|
|
|
|
numberName: {
|
|
|
backgroundColor: 'transparent',
|
|
|
fontSize:15,
|
|
|
alignItems: 'center',
|
|
|
textAlign: 'left',
|
|
|
marginLeft: 10,
|
|
|
},
|
|
|
numberInputText:{
|
|
|
width: width - 150,
|
|
|
height: 40,
|
|
|
backgroundColor:'transparent',
|
|
|
fontSize:15,
|
|
|
marginLeft: 5,
|
|
|
borderWidth: 1,
|
|
|
borderColor: '#CCC',
|
|
|
borderRadius: 4,
|
|
|
marginTop: 5,
|
|
|
},
|
|
|
pickerView: {
|
|
|
width: width - 150,
|
|
|
height: 40,
|
|
|
backgroundColor:'transparent',
|
|
|
marginLeft: 5,
|
|
|
borderWidth: 1,
|
|
|
borderColor: '#CCC',
|
|
|
borderRadius: 4,
|
|
|
justifyContent: 'center',
|
|
|
},
|
|
|
pickerText: {
|
|
|
|
|
|
},
|
|
|
camera: {
|
|
|
width: 30,
|
|
|
height: 30,
|
|
|
backgroundColor: 'red',
|
|
|
marginLeft: 10,
|
|
|
},
|
|
|
cellAddress: {
|
|
|
width: width,
|
|
|
height: 60,
|
|
|
backgroundColor: 'white',
|
|
|
alignItems: 'center',
|
|
|
justifyContent: 'center',
|
|
|
},
|
|
|
cellAddressText: {
|
|
|
width: width - 20,
|
|
|
backgroundColor: 'white',
|
|
|
fontSize:15,
|
|
|
alignItems: 'center',
|
|
|
textAlign: 'left',
|
|
|
},
|
|
|
listContainer: {
|
|
|
flex: 1,
|
|
|
},
|
|
|
pickerContainer: {
|
|
|
flex: 1,
|
|
|
flexDirection: 'column',
|
|
|
top: 0,
|
|
|
left: 0,
|
|
|
width: width,
|
|
|
height: height ,
|
|
|
position: 'absolute',
|
|
|
backgroundColor: 'transparent',
|
|
|
},
|
|
|
pickerSpaceContainer: {
|
|
|
width: width,
|
|
|
height: height - 400 ,
|
|
|
backgroundColor: 'transparent',
|
|
|
},
|
|
|
pickerSubContainer: {
|
|
|
flex: 1,
|
|
|
flexDirection: 'column',
|
|
|
bottom: 0,
|
|
|
width: width,
|
|
|
height: 400 ,
|
|
|
backgroundColor: 'white',
|
|
|
},
|
|
|
}); |
...
|
...
|
|