Authored by 张丽霞

学生认证UI,review by redding

... ... @@ -33,7 +33,6 @@ export default class Register extends Component {
this.needMove = false;//弹出键盘时,textInputView是否需要滑动
this.renderRow = this.renderRow.bind(this);
this.renderSeparator = this.renderSeparator.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
sectionHeaderHasChanged: (s1, s2) => !Immutable.is(s1, s2),
... ... @@ -153,12 +152,6 @@ export default class Register extends Component {
this.props.showTipMesage && this.props.showTipMesage('');
}
renderSeparator(sectionID, rowID, adjacentRowHighlighted) {
return (
<View key={'sep' + rowID} style={styles.separator}>
</View>
);
}
renderRow(rowData, sectionID, rowID, highlightRow) {
switch (sectionID) {
case 'totalStudentRegister':
... ... @@ -177,16 +170,20 @@ export default class Register extends Component {
</View>
</View>
);
case 'registerPageCellsInfo':
return (
<RegisterInfoCell
key={sectionID + rowID}
resource={rowData}
cellIndex={rowID}
onPressRegisterInfoCell={this._onPressRegisterInfoCell}
updateRegisterCellsInfo={this.props.updateRegisterCellsInfo}
/>
);
case 'registerPageCellsInfo': {
let registerPageCellsLength = this.props.registerPageInfo.get('registerPageCells').size;
return (
<RegisterInfoCell
key={sectionID + rowID}
resource={rowData}
cellIndex={rowID}
lastCell={rowID==registerPageCellsLength - 1?true:false}
onPressRegisterInfoCell={this._onPressRegisterInfoCell}
updateRegisterCellsInfo={this.props.updateRegisterCellsInfo}
/>
);
}
}
}
... ... @@ -212,7 +209,6 @@ export default class Register extends Component {
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRowsAndSections(dataSource)}
renderRow={this.renderRow}
renderSeparator={this.renderSeparator}
onContentSizeChange ={(contentWidth, contentHeight)=>{
this.contentHeight = parseInt(contentHeight);
}}
... ...
... ... @@ -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,
}
});
... ...

1.23 KB | W: | H:

1.17 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.37 KB | W: | H:

1.31 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -530,7 +530,7 @@ export function registerNow() {
break;
}
});
if (!agreeYohoProtocol) {
if (!agreeYohoProtocol && tipMessage == '') {
tipMessage = '请同意有货网学生认证协议';
}
if (tipMessage !== '') {
... ...