...
|
...
|
@@ -10,6 +10,7 @@ import ReactNative, { |
|
|
TextInput,
|
|
|
TouchableOpacity,
|
|
|
Image,
|
|
|
Dimensions,
|
|
|
} from 'react-native';
|
|
|
import Immutable from 'immutable';
|
|
|
|
...
|
...
|
@@ -24,7 +25,9 @@ export default class RegisterInfoCell extends Component { |
|
|
}
|
|
|
|
|
|
render() {
|
|
|
let {resource,cellIndex} = this.props;
|
|
|
let {resource,cellIndex,lastCell} = this.props;
|
|
|
let cellWidth = lastCell? width : width - 30;
|
|
|
let leftMargin = lastCell? 0 : 15;
|
|
|
return (
|
|
|
<TouchableOpacity activeOpacity={1.0} onPress={() => {
|
|
|
if (!resource.get('touchAction')) {
|
...
|
...
|
@@ -32,45 +35,54 @@ export default class RegisterInfoCell extends Component { |
|
|
}
|
|
|
this.props.onPressRegisterInfoCell && this.props.onPressRegisterInfoCell(resource,cellIndex);
|
|
|
}}>
|
|
|
|
|
|
<View style={styles.container}>
|
|
|
<Text style={styles.leftTitle}>
|
|
|
{resource.get('title')}
|
|
|
</Text>
|
|
|
<TextInput
|
|
|
placeholder={resource.get('placeholderText')}
|
|
|
style={styles.rightTextInput}
|
|
|
editable={resource.get('touchAction')?false:true}
|
|
|
defaultValue={resource.get('text')}
|
|
|
maxLength={18}
|
|
|
onEndEditing={(event) => {
|
|
|
if (resource.get('touchAction')) {
|
|
|
return;
|
|
|
} else {
|
|
|
let resourceJson = resource.toJS();
|
|
|
resourceJson.text = event.nativeEvent.text;
|
|
|
this.props.updateRegisterCellsInfo && this.props.updateRegisterCellsInfo(Immutable.fromJS(resourceJson));
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
{resource.get('touchAction')?
|
|
|
<Image style={styles.arrow}
|
|
|
source={require('../../images/right_arrow.png')}
|
|
|
<View style={{width:width,height:44.5,backgroundColor:'white',flexDirection:'column'}}>
|
|
|
<View style={styles.container}>
|
|
|
<Text style={styles.leftTitle}>
|
|
|
{resource.get('title')}
|
|
|
</Text>
|
|
|
<TextInput
|
|
|
placeholder={resource.get('placeholderText')}
|
|
|
style={styles.rightTextInput}
|
|
|
editable={resource.get('touchAction')?false:true}
|
|
|
defaultValue={resource.get('text')}
|
|
|
maxLength={18}
|
|
|
onEndEditing={(event) => {
|
|
|
if (resource.get('touchAction')) {
|
|
|
return;
|
|
|
} else {
|
|
|
let resourceJson = resource.toJS();
|
|
|
resourceJson.text = event.nativeEvent.text;
|
|
|
this.props.updateRegisterCellsInfo && this.props.updateRegisterCellsInfo(Immutable.fromJS(resourceJson));
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
: null
|
|
|
}
|
|
|
|
|
|
{resource.get('touchAction')?
|
|
|
<Image style={styles.arrow}
|
|
|
source={require('../../images/right_arrow.png')}
|
|
|
/>
|
|
|
: null
|
|
|
}
|
|
|
</View>
|
|
|
<View style={{width:cellWidth,left:leftMargin,height:0.5,backgroundColor:'#dfe3e2'}}>
|
|
|
</View>
|
|
|
</View>
|
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
|
|
let styles = StyleSheet.create({
|
|
|
container: {
|
|
|
backgroundColor: 'white',
|
|
|
height: 44,
|
|
|
flexDirection: 'row',
|
|
|
marginLeft: 15,
|
|
|
marginRight: 15,
|
|
|
},
|
|
|
leftTitle: {
|
|
|
width: 102,
|
...
|
...
|
@@ -88,7 +100,6 @@ let styles = StyleSheet.create({ |
|
|
arrow: {
|
|
|
width: 8,
|
|
|
height: 13,
|
|
|
top: 11,
|
|
|
marginRight: 15,
|
|
|
top: 14,
|
|
|
}
|
|
|
}); |
...
|
...
|
|