Bläddra i källkod

Merge branch 'master' of http://gogs.efunbox.cn/Rorschach/efunbox-mobile-8

Rorschach 5 år sedan
förälder
incheckning
e7c6809206

+ 2 - 0
android/app/build.gradle

@@ -148,9 +148,11 @@ android {
 }
 
 dependencies {
+    implementation project(':react-native-image-picker')
     implementation project(':react-native-orientation')
     implementation project(':react-native-video')
     implementation project(':react-native-gesture-handler')
+    implementation project(':react-native-image-picker')
     implementation fileTree(dir: "libs", include: ["*.jar"])
     implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
     implementation "com.facebook.react:react-native:+"  // From node_modules

+ 2 - 3
android/app/src/main/AndroidManifest.xml

@@ -2,13 +2,10 @@
     package="com.edufound.mobile">
 
     <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
     <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
-    <uses-permission android:name="android.permission.WAKE_LOCK" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.WRITE_SETTINGS" />
     <uses-permission android:name="android.permission.WAKE_LOCK" />
@@ -18,6 +15,8 @@
     <!--Android6.0需要动态申请一下权限-->
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
     <uses-permission android:name="com.xiaomi.permission.AUTH_THIRDPAY" />
+    <uses-permission android:name="android.permission.CAMERA" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
 
     <application
         android:name="com.edufound.MainApplication"

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 98 - 91
android/app/src/main/assets/index.android.bundle


+ 3 - 1
android/app/src/main/java/com/edufound/MainApplication.java

@@ -11,6 +11,7 @@ import com.facebook.react.bridge.ReactApplicationContext;
 import com.facebook.react.shell.MainReactPackage;
 import com.facebook.soloader.SoLoader;
 import com.github.yamill.orientation.OrientationPackage;
+import com.imagepicker.ImagePickerPackage;
 import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
 
 import java.util.Arrays;
@@ -32,7 +33,8 @@ public class MainApplication extends Application implements ReactApplication {
                     new RNGestureHandlerPackage(),
                     new CustomPackage(),
                     new ReactVideoPackage(),
-                    new OrientationPackage()
+                    new OrientationPackage(),
+                    new ImagePickerPackage()
             );
         }
 

+ 2 - 0
android/settings.gradle

@@ -1,4 +1,6 @@
 rootProject.name = 'efunbox_mobile_8'
+include ':react-native-image-picker'
+project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
 include ':react-native-orientation'
 project(':react-native-orientation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-orientation/android')
 include ':react-native-video'

+ 19 - 0
ios/efunbox_mobile_8.xcodeproj/project.pbxproj

@@ -43,6 +43,7 @@
 		40B60160FAE8416EABF8F455 /* libRNGestureHandler-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 63E89BCAA43940789F6CD17E /* libRNGestureHandler-tvOS.a */; };
 		9CB969D57DBB44968F57230A /* libRCTVideo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D361E312399E41ABA1C9CF77 /* libRCTVideo.a */; };
 		BE43474A85F54112A6EA6E37 /* libRCTOrientation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 977DC2E26A1E45688924C43C /* libRCTOrientation.a */; };
+		E7126B830D54449191E5A4A3 /* libRNImagePicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D4C934671D884A4AAA31603D /* libRNImagePicker.a */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -357,6 +358,8 @@
 		D361E312399E41ABA1C9CF77 /* libRCTVideo.a */ = {isa = PBXFileReference; name = "libRCTVideo.a"; path = "libRCTVideo.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
 		13F318D169DD4BA79CB54ED5 /* RCTOrientation.xcodeproj */ = {isa = PBXFileReference; name = "RCTOrientation.xcodeproj"; path = "../node_modules/react-native-orientation/iOS/RCTOrientation.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
 		977DC2E26A1E45688924C43C /* libRCTOrientation.a */ = {isa = PBXFileReference; name = "libRCTOrientation.a"; path = "libRCTOrientation.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
+		B11B05F3205C483583EB7421 /* RNImagePicker.xcodeproj */ = {isa = PBXFileReference; name = "RNImagePicker.xcodeproj"; path = "../node_modules/react-native-image-picker/ios/RNImagePicker.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
+		D4C934671D884A4AAA31603D /* libRNImagePicker.a */ = {isa = PBXFileReference; name = "libRNImagePicker.a"; path = "libRNImagePicker.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -388,6 +391,7 @@
 				E4A0D76E036246C0B94364AD /* libRNGestureHandler.a in Frameworks */,
 				9CB969D57DBB44968F57230A /* libRCTVideo.a in Frameworks */,
 				BE43474A85F54112A6EA6E37 /* libRCTOrientation.a in Frameworks */,
+				E7126B830D54449191E5A4A3 /* libRNImagePicker.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -581,6 +585,7 @@
 				CB9C1A0696FE4DC596B9C15D /* RNGestureHandler.xcodeproj */,
 				C6CF52A56D1E43279554ACA6 /* RCTVideo.xcodeproj */,
 				13F318D169DD4BA79CB54ED5 /* RCTOrientation.xcodeproj */,
+				B11B05F3205C483583EB7421 /* RNImagePicker.xcodeproj */,
 			);
 			name = Libraries;
 			sourceTree = "<group>";
@@ -1212,12 +1217,14 @@
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 				);
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-video\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-orientation\iOS\RCTOrientation/**",
+					"$(SRCROOT)\..\node_modules\react-native-image-picker\ios",
 				);
 			};
 			name = Debug;
@@ -1243,12 +1250,14 @@
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 				);
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-video\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-orientation\iOS\RCTOrientation/**",
+					"$(SRCROOT)\..\node_modules\react-native-image-picker\ios",
 				);
 			};
 			name = Release;
@@ -1274,6 +1283,7 @@
 					"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-video\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-orientation\iOS\RCTOrientation/**",
+					"$(SRCROOT)\..\node_modules\react-native-image-picker\ios",
 				);
 			};
 			name = Debug;
@@ -1298,6 +1308,7 @@
 					"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-video\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-orientation\iOS\RCTOrientation/**",
+					"$(SRCROOT)\..\node_modules\react-native-image-picker\ios",
 				);
 			};
 			name = Release;
@@ -1331,12 +1342,14 @@
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 				);
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-video\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-orientation\iOS\RCTOrientation/**",
+					"$(SRCROOT)\..\node_modules\react-native-image-picker\ios",
 				);
 			};
 			name = Debug;
@@ -1370,12 +1383,14 @@
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 				);
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-video\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-orientation\iOS\RCTOrientation/**",
+					"$(SRCROOT)\..\node_modules\react-native-image-picker\ios",
 				);
 			};
 			name = Release;
@@ -1408,12 +1423,14 @@
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 				);
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-video\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-orientation\iOS\RCTOrientation/**",
+					"$(SRCROOT)\..\node_modules\react-native-image-picker\ios",
 				);
 			};
 			name = Debug;
@@ -1446,12 +1463,14 @@
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 					"\"$(SRCROOT)/$(TARGET_NAME)\"",
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
 				);
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(SRCROOT)\..\node_modules\react-native-gesture-handler\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-video\ios/**",
 					"$(SRCROOT)\..\node_modules\react-native-orientation\iOS\RCTOrientation/**",
+					"$(SRCROOT)\..\node_modules\react-native-image-picker\ios",
 				);
 			};
 			name = Release;

+ 5 - 0
package-lock.json

@@ -6953,6 +6953,11 @@
         "prop-types": "^15.5.10"
       }
     },
+    "react-native-image-picker": {
+      "version": "0.28.1",
+      "resolved": "https://registry.npm.taobao.org/react-native-image-picker/download/react-native-image-picker-0.28.1.tgz",
+      "integrity": "sha1-ESdGBSLgyXQfxi89BAJx0pj7am4="
+    },
     "react-native-orientation": {
       "version": "3.1.3",
       "resolved": "https://registry.npm.taobao.org/react-native-orientation/download/react-native-orientation-3.1.3.tgz",

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
     "react-dom": "^16.8.6",
     "react-native": "0.59.4",
     "react-native-gesture-handler": "^1.1.0",
+    "react-native-image-picker": "^0.28.1",
     "react-native-orientation": "^3.1.3",
     "react-native-swiper": "^1.5.14",
     "react-native-video": "^4.4.1",

+ 2 - 2
pages/components/BirthdayModal.js

@@ -506,7 +506,7 @@ export default class BirthdayModal extends Component<Props> {
 const styles = StyleSheet.create({
   item_text: {
     color: "rgba(77, 77, 77, 1)",
-    fontSize: 20,
+    fontSize: 18,
     justifyContent: "center",
     alignItems: "center",
     marginTop: 20,
@@ -516,7 +516,7 @@ const styles = StyleSheet.create({
   },
   item_text_click: {
     color: "rgba(59, 149, 243, 1)",
-    fontSize: 20,
+    fontSize: 18,
     justifyContent: "center",
     alignItems: "center",
     marginTop: 20,

+ 16 - 3
pages/components/ChosePhoto.js

@@ -22,8 +22,9 @@ import {
   TouchableHighlight,
   DeviceEventEmitter
 } from "react-native";
-
+import ImagePicker from "react-native-image-picker";
 type Props = {};
+const options = {};
 export default class ChosePhoto extends Component<Props> {
   state = {
     modalVisible: false
@@ -191,10 +192,22 @@ export default class ChosePhoto extends Component<Props> {
     );
   }
   photograph() {
-    alert("拍照");
+    //拍照
+    ImagePicker.launchCamera(options, response => {
+      if (response.error) {
+        alert("ImagePicker Error: " + response.error);
+      }
+      this.props.photoback(response.uri);
+    });
   }
 
   album_selection() {
-    alert("相册选择");
+    //打开系统相册
+    ImagePicker.launchImageLibrary(options, response => {
+      if (response.error) {
+        alert("ImagePicker Error: " + response.error);
+      }
+      this.props.photoback(response.uri);
+    });
   }
 }

+ 392 - 377
pages/components/PersonalInfo.js

@@ -36,495 +36,499 @@ export default class PersonalInfo extends BasePage {
   state = {
     nickName: "初始昵称",
     schoolName: "未设置",
-    cisys: "北京市",
+    provinceName: "广东省",
+    citys: "深圳市",
     grade_text: "七年级",
     grade_index: 6,
     birthday_year: 0,
     birthday_month: 0,
     birthday_day: 0,
-    birthday_time: 0
+    birthday_time: 0,
+    photo_uri: require("../images/userInfo/default_photo.png")
   };
   updateState(data) {
     this.setState(data);
   }
   render() {
     return (
-      <View style={{backgroundColor: '#F0F1F5', flex : 1}}>
-      <View style={{ width: "100%", height: this.getWindowHeight() }}>
-        <PersonalInfoDialog
-          ref={view => (this.dialog = view)}
-          updateParentState={this.updateState.bind(this)}
-        />
-        <ChosePhoto ref={view => (this.chosephoto = view)} />
-        <RegionModal
-          ref={view => (this.regionmodal = view)}
-          cityscommit={this.cityscommit.bind(this)}
-        />
-        <GradeSelectionModal
-          ref={view => (this.gradeselectionModal = view)}
-          commitGrade={this.commitGrade.bind(this)}
-          grade_index={this.state.grade_index}
-        />
-        <BirthdayModal
-          ref={view => (this.birthdaymodal = view)}
-          birthdaycommit={this.birthdaycommit.bind(this)}
-          year={this.state.birthday_year}
-          month={this.state.birthday_month}
-          day={this.state.birthday_day}
-        />
-        <StatusBar backgroundColor={"transparent"} translucent={true} />
+      <View style={{ backgroundColor: "#F0F1F5", flex: 1 }}>
+        <View style={{ width: "100%", height: this.getWindowHeight() }}>
+          <PersonalInfoDialog
+            ref={view => (this.dialog = view)}
+            updateParentState={this.updateState.bind(this)}
+          />
+          <ChosePhoto
+            ref={view => (this.chosephoto = view)}
+            photoback={this.photoback.bind(this)}
+          />
+          <RegionModal
+            ref={view => (this.regionmodal = view)}
+            cityscommit={this.cityscommit.bind(this)}
+            provinceName={this.state.provinceName}
+            citys={this.state.citys}
+          />
+          <GradeSelectionModal
+            ref={view => (this.gradeselectionModal = view)}
+            commitGrade={this.commitGrade.bind(this)}
+            grade_index={this.state.grade_index}
+          />
+          <BirthdayModal
+            ref={view => (this.birthdaymodal = view)}
+            birthdaycommit={this.birthdaycommit.bind(this)}
+            year={this.state.birthday_year}
+            month={this.state.birthday_month}
+            day={this.state.birthday_day}
+          />
+          <StatusBar backgroundColor={"transparent"} translucent={true} />
 
-        <View
-          style={{
-            flex: 1,
-            flexDirection: "column"
-          }}
-        >
-          <ImageBackground
-            source={require("../images/userInfo/top.png")}
+          <View
             style={{
-              flex: 2.8,
-              width: "100%",
-              backgroundColor: "#F0F1F5",
-              height: "75%"
+              flex: 1,
+              flexDirection: "column"
             }}
-            imageStyle={{ resizeMode: "cover" }}
           >
-            <View
+            <ImageBackground
+              source={require("../images/userInfo/top.png")}
               style={{
-                flex: 1,
-                alignItems: "center",
-                justifyContent: "center",
-                flexDirection: "column"
+                flex: 2.8,
+                width: "100%",
+                backgroundColor: "#F0F1F5",
+                height: "75%"
               }}
+              imageStyle={{ resizeMode: "cover" }}
             >
-              <CourseTitle
-                style={{ flex: 4 }}
-                width={this.getWindowWidth()}
-                title="个人信息"
-                backPress={() => this.goBack()}
-                lefttype={2}
-                righttype={0}
-                textcolor={"white"}
-                backPress={() => this.goBack()}
-              />
-
-              <TouchableOpacity
+              <View
                 style={{
                   flex: 1,
-                  backgroundColor: "white",
-                  width: "90%",
-                  bottom: 0,
                   alignItems: "center",
                   justifyContent: "center",
-                  borderRadius: 20,
-                  overflow: "hidden"
+                  flexDirection: "column"
                 }}
-                activeOpacity={1}
-                onPress={() => this.arrowpress(0)}
               >
-                <View
+                <CourseTitle
+                  style={{ flex: 4 }}
+                  width={this.getWindowWidth()}
+                  title="个人信息"
+                  backPress={() => this.goBack()}
+                  lefttype={2}
+                  righttype={0}
+                  textcolor={"white"}
+                  backPress={() => this.goBack()}
+                />
+
+                <TouchableOpacity
                   style={{
                     flex: 1,
-                    borderRadius: 20,
-                    overflow: "hidden",
+                    backgroundColor: "white",
+                    width: "90%",
+                    bottom: 0,
                     alignItems: "center",
                     justifyContent: "center",
-                    flexDirection: "row"
+                    borderRadius: 20,
+                    overflow: "hidden"
                   }}
+                  activeOpacity={1}
+                  onPress={() => this.arrowpress(0)}
                 >
-                  <View style={{ flex: 0.5 }} />
-
                   <View
                     style={{
-                      flex: 3,
-                      height: "100%",
+                      flex: 1,
+                      borderRadius: 20,
+                      overflow: "hidden",
                       alignItems: "center",
-                      justifyContent: "center"
+                      justifyContent: "center",
+                      flexDirection: "row"
                     }}
                   >
-                    <Image
+                    <View style={{ flex: 0.5 }} />
+
+                    <View
                       style={{
-                        borderRadius: 50,
-                        width: "80%",
-                        height: "70%"
-                        // borderWidth: 3
-                        // borderColor: "red"
+                        flex: 3,
+                        height: "100%",
+                        alignItems: "center",
+                        justifyContent: "center"
                       }}
-                      source={{
-                        uri:
-                          "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg"
+                    >
+                      <Image
+                        style={{
+                          borderRadius: 50,
+                          width: "80%",
+                          height: "70%"
+                          // borderWidth: 3
+                          // borderColor: "red"
+                        }}
+                        source={this.state.photo_uri}
+                      />
+                    </View>
+                    <View
+                      style={{
+                        flex: 9,
+                        backgroundColor: "white",
+                        height: "100%",
+                        justifyContent: "center"
                       }}
-                    />
-                  </View>
-                  <View
-                    style={{
-                      flex: 9,
-                      backgroundColor: "white",
-                      height: "100%",
-                      justifyContent: "center"
-                    }}
-                  >
-                    <Text style={{ left: 10, color: "black", fontSize: 20 }}>
-                      修改头像
-                    </Text>
-                  </View>
-                  <View
-                    style={{
-                      flex: 1.5,
-                      height: "65%",
-                      alignItems: "center",
-                      justifyContent: "center"
-                    }}
-                  >
-                    {this.getArraowImg(0)}
+                    >
+                      <Text style={{ left: 10, color: "black", fontSize: 20 }}>
+                        修改头像
+                      </Text>
+                    </View>
+                    <View
+                      style={{
+                        flex: 1.5,
+                        height: "65%",
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.getArraowImg(0)}
+                    </View>
                   </View>
-                </View>
-              </TouchableOpacity>
-            </View>
-          </ImageBackground>
-          <View style={{ flex: 0.5, backgroundColor: "#F0F1F5" }} />
-          <View
-            style={{
-              width: "100%",
-              flex: 4.3,
-              alignItems: "center",
-              backgroundColor: "#F0F1F5"
-            }}
-          >
+                </TouchableOpacity>
+              </View>
+            </ImageBackground>
+            <View style={{ flex: 0.5, backgroundColor: "#F0F1F5" }} />
             <View
               style={{
-                backgroundColor: "rgb(242, 242, 242)",
-                width: "90%",
+                width: "100%",
+                flex: 4.3,
                 alignItems: "center",
-                justifyContent: "center",
-                height: "100%",
-                overflow: "hidden",
-                borderRadius: 10
+                backgroundColor: "#F0F1F5"
               }}
             >
               <View
                 style={{
-                  width: "100%",
+                  backgroundColor: "rgb(242, 242, 242)",
+                  width: "90%",
                   alignItems: "center",
                   justifyContent: "center",
-                  height: "100%"
+                  height: "100%",
+                  overflow: "hidden",
+                  borderRadius: 10
                 }}
               >
-                <TouchableOpacity
+                <View
                   style={{
-                    flex: 1,
-                    marginVertical: 1,
                     width: "100%",
-                    flexDirection: "row",
-                    backgroundColor: "white"
+                    alignItems: "center",
+                    justifyContent: "center",
+                    height: "100%"
                   }}
-                  activeOpacity={1}
-                  onPress={() => this.arrowpress(1)}
                 >
-                  <View
-                    style={{
-                      flex: 2,
-                      alignItems: "center",
-                      justifyContent: "center"
-                    }}
-                  >
-                    {this.choseheadericon(1)}
-                  </View>
-                  <Text style={styles.item_text}>昵称</Text>
-                  <View
+                  <TouchableOpacity
                     style={{
-                      flex: 5,
-                      alignItems: "flex-end"
+                      flex: 1,
+                      marginVertical: 1,
+                      width: "100%",
+                      flexDirection: "row",
+                      backgroundColor: "white"
                     }}
+                    activeOpacity={1}
+                    onPress={() => this.arrowpress(1)}
                   >
-                    <Text
+                    <View
                       style={{
-                        flex: 1,
-                        fontSize: 15,
-                        textAlignVertical: "center"
+                        flex: 2,
+                        alignItems: "center",
+                        justifyContent: "center"
                       }}
-                      numberOfLines={1}
-                      ellipsizeMode={"tail"}
                     >
-                      {this.state.nickName}
-                    </Text>
-                  </View>
-                  <View
-                    style={{
-                      flex: 1.1,
-                      alignItems: "center",
-                      justifyContent: "center"
-                    }}
-                  >
-                    {this.getArraowImg(1)}
-                  </View>
-                </TouchableOpacity>
-                <TouchableOpacity
-                  style={{
-                    flex: 1,
-                    width: "100%",
-                    flexDirection: "row",
-                    backgroundColor: "white",
-                    marginVertical: 1
-                  }}
-                  activeOpacity={1}
-                  onPress={() => this.arrowpress(2)}
-                >
-                  <View
-                    style={{
-                      flex: 2,
-                      alignItems: "center",
-                      justifyContent: "center"
-                    }}
-                  >
-                    {this.choseheadericon(2)}
-                  </View>
-                  <Text style={styles.item_text}>生日</Text>
-                  <View
-                    style={{
-                      flex: 5,
-                      alignItems: "flex-end"
-                    }}
-                  >
-                    <Text
+                      {this.choseheadericon(1)}
+                    </View>
+                    <Text style={styles.item_text}>昵称</Text>
+                    <View
                       style={{
-                        flex: 1,
-                        fontSize: 15,
-                        textAlignVertical: "center"
+                        flex: 5,
+                        alignItems: "flex-end"
                       }}
-                      numberOfLines={1}
-                      ellipsizeMode={"tail"}
                     >
-                      {this.state.birthday_time}
-                    </Text>
-                  </View>
-                  <View
+                      <Text
+                        style={{
+                          flex: 1,
+                          fontSize: 15,
+                          textAlignVertical: "center"
+                        }}
+                        numberOfLines={1}
+                        ellipsizeMode={"tail"}
+                      >
+                        {this.state.nickName}
+                      </Text>
+                    </View>
+                    <View
+                      style={{
+                        flex: 1.1,
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.getArraowImg(1)}
+                    </View>
+                  </TouchableOpacity>
+                  <TouchableOpacity
                     style={{
-                      flex: 1.1,
-                      alignItems: "center",
-                      justifyContent: "center"
+                      flex: 1,
+                      width: "100%",
+                      flexDirection: "row",
+                      backgroundColor: "white",
+                      marginVertical: 1
                     }}
+                    activeOpacity={1}
+                    onPress={() => this.arrowpress(2)}
                   >
-                    {this.getArraowImg(2)}
-                  </View>
-                </TouchableOpacity>
-                <TouchableOpacity
-                  style={{
-                    flex: 1,
-                    width: "100%",
-                    flexDirection: "row",
-                    backgroundColor: "white",
-                    marginVertical: 1
-                  }}
-                  activeOpacity={1}
-                  onPress={() => this.arrowpress(3)}
-                >
-                  <View
+                    <View
+                      style={{
+                        flex: 2,
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.choseheadericon(2)}
+                    </View>
+                    <Text style={styles.item_text}>生日</Text>
+                    <View
+                      style={{
+                        flex: 5,
+                        alignItems: "flex-end"
+                      }}
+                    >
+                      <Text
+                        style={{
+                          flex: 1,
+                          fontSize: 15,
+                          textAlignVertical: "center"
+                        }}
+                        numberOfLines={1}
+                        ellipsizeMode={"tail"}
+                      >
+                        {this.state.birthday_time}
+                      </Text>
+                    </View>
+                    <View
+                      style={{
+                        flex: 1.1,
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.getArraowImg(2)}
+                    </View>
+                  </TouchableOpacity>
+                  <TouchableOpacity
                     style={{
-                      flex: 2,
-                      alignItems: "center",
-                      justifyContent: "center"
+                      flex: 1,
+                      width: "100%",
+                      flexDirection: "row",
+                      backgroundColor: "white",
+                      marginVertical: 1
                     }}
+                    activeOpacity={1}
+                    onPress={() => this.arrowpress(3)}
                   >
-                    {this.choseheadericon(3)}
-                  </View>
+                    <View
+                      style={{
+                        flex: 2,
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.choseheadericon(3)}
+                    </View>
 
-                  <Text style={styles.item_text}>所在地区</Text>
-                  <View
-                    style={{
-                      flex: 5,
-                      alignItems: "flex-end"
-                    }}
-                  >
-                    <Text
+                    <Text style={styles.item_text}>所在地区</Text>
+                    <View
                       style={{
-                        flex: 1,
-                        fontSize: 15,
-                        textAlignVertical: "center"
+                        flex: 5,
+                        alignItems: "flex-end"
                       }}
-                      numberOfLines={1}
-                      ellipsizeMode={"tail"}
                     >
-                      {this.state.cisys}
-                    </Text>
-                  </View>
-                  <View
-                    style={{
-                      flex: 1.1,
-                      alignItems: "center",
-                      justifyContent: "center"
-                    }}
-                  >
-                    {this.getArraowImg(3)}
-                  </View>
-                </TouchableOpacity>
-                <TouchableOpacity
-                  style={{
-                    flex: 1,
-                    width: "100%",
-                    flexDirection: "row",
-                    backgroundColor: "white",
-                    marginVertical: 1
-                  }}
-                  activeOpacity={1}
-                  onPress={() => this.arrowpress(4)}
-                >
-                  <View
+                      <Text
+                        style={{
+                          flex: 1,
+                          fontSize: 15,
+                          textAlignVertical: "center"
+                        }}
+                        numberOfLines={1}
+                        ellipsizeMode={"tail"}
+                      >
+                        {this.state.provinceName}-{this.state.citys}
+                      </Text>
+                    </View>
+                    <View
+                      style={{
+                        flex: 1.1,
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.getArraowImg(3)}
+                    </View>
+                  </TouchableOpacity>
+                  <TouchableOpacity
                     style={{
-                      flex: 2,
-                      alignItems: "center",
-                      justifyContent: "center"
+                      flex: 1,
+                      width: "100%",
+                      flexDirection: "row",
+                      backgroundColor: "white",
+                      marginVertical: 1
                     }}
+                    activeOpacity={1}
+                    onPress={() => this.arrowpress(4)}
                   >
-                    {this.choseheadericon(4)}
-                  </View>
+                    <View
+                      style={{
+                        flex: 2,
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.choseheadericon(4)}
+                    </View>
 
-                  <Text style={styles.item_text}>我的学校</Text>
-                  <View
-                    style={{
-                      flex: 5,
-                      alignItems: "flex-end"
-                    }}
-                  >
-                    <Text
+                    <Text style={styles.item_text}>我的学校</Text>
+                    <View
                       style={{
-                        flex: 1,
-                        fontSize: 15,
-                        textAlignVertical: "center"
+                        flex: 5,
+                        alignItems: "flex-end"
                       }}
-                      numberOfLines={1}
-                      ellipsizeMode={"tail"}
                     >
-                      {this.state.schoolName}
-                    </Text>
-                  </View>
-                  <View
-                    style={{
-                      flex: 1.1,
-                      alignItems: "center",
-                      justifyContent: "center"
-                    }}
-                  >
-                    {this.getArraowImg(4)}
-                  </View>
-                </TouchableOpacity>
-                <TouchableOpacity
-                  style={{
-                    flex: 1,
-                    marginTop: 1,
-                    width: "100%",
-                    flexDirection: "row",
-                    backgroundColor: "white",
-                    marginVertical: 1
-                  }}
-                  activeOpacity={1}
-                  onPress={() => this.arrowpress(5)}
-                >
-                  <View
+                      <Text
+                        style={{
+                          flex: 1,
+                          fontSize: 15,
+                          textAlignVertical: "center"
+                        }}
+                        numberOfLines={1}
+                        ellipsizeMode={"tail"}
+                      >
+                        {this.state.schoolName}
+                      </Text>
+                    </View>
+                    <View
+                      style={{
+                        flex: 1.1,
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.getArraowImg(4)}
+                    </View>
+                  </TouchableOpacity>
+                  <TouchableOpacity
                     style={{
-                      flex: 2,
-                      alignItems: "center",
-                      justifyContent: "center"
+                      flex: 1,
+                      marginTop: 1,
+                      width: "100%",
+                      flexDirection: "row",
+                      backgroundColor: "white",
+                      marginVertical: 1
                     }}
+                    activeOpacity={1}
+                    onPress={() => this.arrowpress(5)}
                   >
-                    {this.choseheadericon(5)}
-                  </View>
+                    <View
+                      style={{
+                        flex: 2,
+                        alignItems: "center",
+                        justifyContent: "center"
+                      }}
+                    >
+                      {this.choseheadericon(5)}
+                    </View>
 
-                  <Text style={styles.item_text}>我的年级</Text>
-                  <View
-                    style={{
-                      flex: 5,
-                      alignItems: "flex-end"
-                    }}
-                  >
-                    <Text
+                    <Text style={styles.item_text}>我的年级</Text>
+                    <View
+                      style={{
+                        flex: 5,
+                        alignItems: "flex-end"
+                      }}
+                    >
+                      <Text
+                        style={{
+                          flex: 1.1,
+                          fontSize: 15,
+                          textAlignVertical: "center"
+                        }}
+                        numberOfLines={1}
+                        ellipsizeMode={"tail"}
+                      >
+                        {this.state.grade_text}
+                      </Text>
+                    </View>
+                    <View
                       style={{
                         flex: 1.1,
-                        fontSize: 15,
-                        textAlignVertical: "center"
+                        alignItems: "center",
+                        justifyContent: "center"
                       }}
-                      numberOfLines={1}
-                      ellipsizeMode={"tail"}
                     >
-                      {this.state.grade_text}
-                    </Text>
-                  </View>
-                  <View
-                    style={{
-                      flex: 1.1,
-                      alignItems: "center",
-                      justifyContent: "center"
-                    }}
-                  >
-                    {this.getArraowImg(5)}
-                  </View>
-                </TouchableOpacity>
+                      {this.getArraowImg(5)}
+                    </View>
+                  </TouchableOpacity>
+                </View>
               </View>
             </View>
-          </View>
 
-          <View
-            style={{
-              width: "100%",
-              flex: 4,
-              backgroundColor: "#F0F1F5",
-              flexDirection: "column"
-            }}
-          >
-            <View style={{ flex: 2.5 }} />
-            <View style={{ flex: 2, flexDirection: "row" }}>
-              <View style={{ flex: 1 }} />
-              <View
-                style={{
-                  flex: 7,
-                  width: "100%",
-                  height: "100%"
-                }}
-              >
-                <TouchableOpacity
-                  activeOpacity={1}
+            <View
+              style={{
+                width: "100%",
+                flex: 4,
+                backgroundColor: "#F0F1F5",
+                flexDirection: "column"
+              }}
+            >
+              <View style={{ flex: 2.5 }} />
+              <View style={{ flex: 2, flexDirection: "row" }}>
+                <View style={{ flex: 1 }} />
+                <View
                   style={{
-                    flex: 2,
+                    flex: 7,
                     width: "100%",
-                    alignItems: "center",
-                    justifyContent: "center",
                     height: "100%"
                   }}
-                  onPress={() => this.logout()}
                 >
-                  <ImageBackground
-                    source={require("../images/userInfo/logoutbg1.png")}
+                  <TouchableOpacity
+                    activeOpacity={1}
                     style={{
-                      flex: 1,
+                      flex: 2,
                       width: "100%",
                       alignItems: "center",
                       justifyContent: "center",
                       height: "100%"
                     }}
-                    imageStyle={{ resizeMode: "contain" }}
+                    onPress={() => this.logout()}
                   >
-                    <Text
+                    <ImageBackground
+                      source={require("../images/userInfo/logoutbg1.png")}
                       style={{
-                        fontSize: 30,
-                        color: "white",
+                        flex: 1,
                         width: "100%",
-                        textAlign: "center"
+                        alignItems: "center",
+                        justifyContent: "center",
+                        height: "100%"
                       }}
+                      imageStyle={{ resizeMode: "contain" }}
                     >
-                      退出登录
-                    </Text>
-                  </ImageBackground>
-                </TouchableOpacity>
+                      <Text
+                        style={{
+                          fontSize: 30,
+                          color: "white",
+                          width: "100%",
+                          textAlign: "center"
+                        }}
+                      >
+                        退出登录
+                      </Text>
+                    </ImageBackground>
+                  </TouchableOpacity>
+                  <View style={{ flex: 1 }} />
+                </View>
                 <View style={{ flex: 1 }} />
               </View>
-              <View style={{ flex: 1 }} />
+              <View style={{ flex: 0.8 }} />
             </View>
-            <View style={{ flex: 0.8 }} />
           </View>
         </View>
       </View>
-      </View>
     );
   }
 
@@ -633,7 +637,8 @@ export default class PersonalInfo extends BasePage {
 
   cityscommit(provinces_name, citys_name) {
     this.setState({
-      cisys: provinces_name + "-" + citys_name
+      provinceName: provinces_name,
+      citys: citys_name
     });
   }
   commitGrade(text, index) {
@@ -647,6 +652,16 @@ export default class PersonalInfo extends BasePage {
       birthday_time: year + "年" + month + "月" + day + "日"
     });
   }
+
+  photoback(photo_uri) {
+    this.chosephoto.setModalVisible(false);
+    if (photo_uri == undefined || photo_uri === "" || photo_uri == null) {
+      return;
+    }
+    this.setState({
+      photo_uri: { uri: photo_uri }
+    });
+  }
 }
 
 const styles = StyleSheet.create({

+ 15 - 8
pages/components/PersonalInfoDialog.js

@@ -161,7 +161,7 @@ export default class PersonalInfoDialog extends Component<Props> {
                   style={{
                     flex: 1,
                     textAlignVertical: "center",
-                    fontSize: 25,
+                    fontSize: 16,
                     color: "black"
                   }}
                 >
@@ -178,13 +178,14 @@ export default class PersonalInfoDialog extends Component<Props> {
                 <TextInput
                   placeholder={this.state.placeholder}
                   editable={true} //是否可编辑
+                  autoFocus={true}
                   style={{
                     width: "90%",
                     height: "90%",
                     borderColor: "black",
                     borderWidth: 0,
                     marginLeft: 5,
-                    fontSize: 20
+                    fontSize: 16
                   }}
                   onChangeText={text =>
                     this.setState({
@@ -202,15 +203,16 @@ export default class PersonalInfoDialog extends Component<Props> {
               >
                 <View
                   style={{
-                    flex: 4
+                    flex: 5
                   }}
                 />
                 <View
                   style={{
                     flex: 2,
-                    backgroundColor: this.state.touchcolor,
                     height: "100%",
-                    borderRadius: 30
+                    borderRadius: 30,
+                    backgroundColor: this.state.touchcolor,
+                    alignItems: "center"
                   }}
                 >
                   <TouchableOpacity
@@ -223,9 +225,11 @@ export default class PersonalInfoDialog extends Component<Props> {
                   >
                     <Text
                       style={{
+                        height: "100%",
+                        width: "100%",
                         textAlignVertical: "center",
                         textAlign: "center",
-                        fontSize: 23,
+                        fontSize: 18,
                         borderRadius: 30,
                         color: this.state.touchtextcolor
                       }}
@@ -238,8 +242,9 @@ export default class PersonalInfoDialog extends Component<Props> {
                 <View
                   style={{
                     flex: 2,
-                    backgroundColor: this.state.touch_cancel_color,
                     height: "100%",
+                    backgroundColor: this.state.touch_cancel_color,
+                    alignItems: "center",
                     borderRadius: 30
                   }}
                 >
@@ -253,7 +258,9 @@ export default class PersonalInfoDialog extends Component<Props> {
                       style={{
                         textAlignVertical: "center",
                         textAlign: "center",
-                        fontSize: 23,
+                        height: "100%",
+                        width: "100%",
+                        fontSize: 18,
                         color: this.state.touch_cancel_textcolor
                       }}
                     >

+ 18 - 3
pages/components/RegionModal.js

@@ -195,7 +195,21 @@ export default class RegionModal extends Component<Props> {
       </Modal>
     );
   }
-
+  componentWillMount() {
+    for (var i = 0; i < this.state.cityjson.length; i++) {
+      if (this.props.provinceName === CitysData.provinces[i].provinceName) {
+        this.state.provinces_views_index = i;
+        this.state.click_provinces_name = this.props.provinceName;
+        this.state.city_data = CitysData.provinces[i].citys;
+        for (var j = 0; j < this.state.city_data.length; j++) {
+          if (this.props.citys === this.state.city_data[j].citysName) {
+            this.state.city_views_index = j;
+            this.state.click_city_name = this.props.citys;
+          }
+        }
+      }
+    }
+  }
   provinces_onlayout() {
     if (this.state.provinces_views_index != -1) {
       this.provinces_scroll.scrollTo({
@@ -294,6 +308,7 @@ export default class RegionModal extends Component<Props> {
     this.state.city_views = [];
     for (var i = 0; i < citys.length; i++) {
       let index = i;
+      console.log("this.state.city_views_index:" + this.state.city_views_index);
       if (this.state.city_views_index == i) {
         textstyle = styles.item_text_click;
       } else {
@@ -318,7 +333,7 @@ export default class RegionModal extends Component<Props> {
 const styles = StyleSheet.create({
   item_text: {
     color: "rgba(77, 77, 77, 1)",
-    fontSize: 20,
+    fontSize: 18,
     justifyContent: "center",
     alignItems: "center",
     marginTop: 20,
@@ -328,7 +343,7 @@ const styles = StyleSheet.create({
   },
   item_text_click: {
     color: "rgba(59, 149, 243, 1)",
-    fontSize: 20,
+    fontSize: 18,
     justifyContent: "center",
     alignItems: "center",
     marginTop: 20,

BIN
pages/images/userInfo/default_photo.png