/** * 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 Header from "./Header"; import PersonalInfoDialog from "./PersonalInfoDialog"; type Props = {}; export default class PersonalInfo extends BasePage { state = { modalVisible: false }; setModalVisible(visible) { this.setState({ modalVisible: visible }); } render() { return ( (this.dialog = view)} /> this.goBack()} lefttype={2} textcolor={"white"} backPress={() => alert("点击左侧")} />
this.toNextPage("MainActivity")} /> {this.userInfo123()} {this.userInfo456()} this.logout()} > 退出登录 ); } userInfo123() { return ( {this.choseheadericon(0)} 头像 {this.getArraowImg(0)} {this.choseheadericon(1)} 昵称 {this.getArraowImg(1)} {this.choseheadericon(2)} 生日 {this.getArraowImg(2)} ); } userInfo456() { return ( {this.choseheadericon(3)} 所在地区 {this.getArraowImg(3)} {this.choseheadericon(4)} 我的学校 {this.getArraowImg(4)} {this.choseheadericon(5)} 我的年级 {this.getArraowImg(5)} ); } getArraowImg(type) { return ( this.arrowpress(type)} > ); } choseheadericon(type) { let headerpath; switch (type) { case 0: headerpath = require("../../imgs/headportrait.png"); break; case 1: headerpath = require("../../imgs/nickname.png"); break; case 2: headerpath = require("../../imgs/birthday.png"); break; case 3: headerpath = require("../../imgs/location.png"); break; case 4: headerpath = require("../../imgs/school.png"); break; case 5: headerpath = require("../../imgs/grade.png"); break; } // alert(headerpath); return ( ); } arrowpress(type) { switch (type) { case 0: alert("点击头像"); break; case 1: this.modalDialog(); break; case 2: alert("生日"); break; case 3: alert("所在地区"); break; case 4: alert("我的学校"); break; case 5: alert("我的年级"); break; } } logout() { alert("点击退出了"); } modalDialog() { this.dialog.setModalVisible(true); } } const styles = StyleSheet.create({ item: { flex: 1, width: "100%", flexDirection: "row", backgroundColor: "white" }, item_text: { flex: 10, marginLeft: 10, textAlignVertical: "center", color: "black", fontSize: 20 } });