/** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow */ import React, { Component } from "react"; import { Platform, StyleSheet, Text, View, Image, TouchableOpacity, ImageBackground, Button, StatusBar, Modal, TouchableHighlight, DeviceEventEmitter } from "react-native"; import AndroidUtil from "../../util/AndroidUtil"; import BasePage from "../BasePage"; import CourseTitle from "./CourseTitle"; import ChosePhoto from "./ChosePhoto"; import RegionModal from "./RegionModal"; import GradeSelectionModal from "./GradeSelectionModal"; import Header from "./Header"; import PersonalInfoDialog from "./PersonalInfoDialog"; type Props = {}; export default class PersonalInfo extends BasePage { state = { nickName: "初始昵称", schoolName: "未设置", cisys: "北京市", grade_text: "七年级", grade_index: 6 }; updateState(data) { this.setState(data); } render() { return ( (this.dialog = view)} updateParentState={this.updateState.bind(this)} /> (this.chosephoto = view)} /> (this.regionmodal = view)} cityscommit={this.cityscommit.bind(this)} /> (this.gradeselectionModal = view)} commitGrade={this.commitGrade.bind(this)} grade_index={this.state.grade_index} /> this.goBack()} lefttype={2} righttype={0} textcolor={"white"} backPress={() => this.goBack()} /> this.arrowpress(0)} > 修改头像 {this.getArraowImg(0)} this.arrowpress(1)} > {this.choseheadericon(1)} 昵称 {this.state.nickName} {this.getArraowImg(1)} this.arrowpress(2)} > {this.choseheadericon(2)} 生日 生日。。。。 {this.getArraowImg(2)} this.arrowpress(3)} > {this.choseheadericon(3)} 所在地区 {this.state.cisys} {this.getArraowImg(3)} this.arrowpress(4)} > {this.choseheadericon(4)} 我的学校 {this.state.schoolName} {this.getArraowImg(4)} this.arrowpress(5)} > {this.choseheadericon(5)} 我的年级 {this.state.grade_text} {this.getArraowImg(5)} this.logout()} > 退出登录 ); } // userInfo123() { // return ( // ); // } getArraowImg(type) { return ( this.arrowpress(type)} > ); } choseheadericon(type) { let headerpath; switch (type) { case 0: headerpath = require("../images/userInfo/headportrait.png"); break; case 1: headerpath = require("../images/userInfo/nickname.png"); break; case 2: headerpath = require("../images/userInfo/birthday.png"); break; case 3: headerpath = require("../images/userInfo/location.png"); break; case 4: headerpath = require("../images/userInfo/school.png"); break; case 5: headerpath = require("../images/userInfo/grade.png"); break; } // alert(headerpath); return ( ); } arrowpress(type) { switch (type) { case 0: this.chosephoto.setModalVisible(true); break; case 1: this.dialog.setInfo("修改昵称", "昵称"); this.dialog.setModalVisible(true, 1); break; case 2: alert("生日"); break; case 3: this.regionmodal.setModalVisible(true); break; case 4: this.dialog.setInfo("我的学校", "学校名称"); this.dialog.setModalVisible(true, 2); break; case 5: this.gradeselectionModal.setModalVisible(true); break; } } logout() { alert("点击退出了"); } cityscommit(provinces_name, citys_name) { this.setState({ cisys: provinces_name + citys_name }); } commitGrade(text, index) { this.setState({ grade_text: text, grade_index: index }); } } const styles = StyleSheet.create({ item: { flex: 1, width: "100%", flexDirection: "row", backgroundColor: "white", marginTop: 1 }, item_text: { flex: 3, textAlignVertical: "center", color: "black", fontSize: 16 } });