Ver código fonte

1.修改个人中心布局

zhangmengjie 5 anos atrás
pai
commit
6b2344369e
1 arquivos alterados com 282 adições e 275 exclusões
  1. 282 275
      pages/components/PersonalInfo.js

+ 282 - 275
pages/components/PersonalInfo.js

@@ -51,12 +51,7 @@ export default class PersonalInfo extends BasePage {
           ref={view => (this.regionmodal = view)}
           cityscommit={this.cityscommit.bind(this)}
         />
-        <StatusBar
-          backgroundColor={"transparent"}
-          barStyle={"dark-content"}
-          backgroundColor={"white"}
-          translucent={true}
-        />
+        <StatusBar backgroundColor={"transparent"} translucent={true} />
 
         <View
           style={{
@@ -67,23 +62,23 @@ export default class PersonalInfo extends BasePage {
           <ImageBackground
             source={require("../images/userInfo/top.png")}
             style={{
-              flex: 5,
+              flex: 2.8,
               width: "100%",
               backgroundColor: "#F0F1F5",
-              height: "73%"
+              height: "75%"
             }}
-            imageStyle={{ resizeMode: "contain" }}
+            imageStyle={{ resizeMode: "cover" }}
           >
             <View
               style={{
-                flex: 0.9,
+                flex: 1,
                 alignItems: "center",
                 justifyContent: "center",
                 flexDirection: "column"
               }}
             >
               <CourseTitle
-                style={{ flex: 1 }}
+                style={{ flex: 4 }}
                 width={this.getWindowWidth()}
                 title="个人信息"
                 backPress={() => this.goBack()}
@@ -92,11 +87,13 @@ export default class PersonalInfo extends BasePage {
                 textcolor={"white"}
                 backPress={() => this.goBack()}
               />
+
               <TouchableOpacity
                 style={{
-                  flex: 0.9,
+                  flex: 1,
                   backgroundColor: "white",
                   width: "90%",
+                  bottom: 0,
                   alignItems: "center",
                   justifyContent: "center",
                   borderRadius: 20,
@@ -165,35 +162,288 @@ export default class PersonalInfo extends BasePage {
               </TouchableOpacity>
             </View>
           </ImageBackground>
-
+          <View style={{ flex: 0.5, backgroundColor: "#F0F1F5" }} />
           <View
             style={{
               width: "100%",
-              flex: 8,
+              flex: 4.3,
               alignItems: "center",
-              justifyContent: "center",
               backgroundColor: "#F0F1F5"
             }}
           >
             <View
               style={{
-                backgroundColor: "rgba(242, 242, 242, 1)",
+                backgroundColor: "rgb(242, 242, 242)",
                 width: "90%",
                 alignItems: "center",
                 justifyContent: "center",
-                height: "90%",
+                height: "100%",
                 overflow: "hidden",
-                borderRadius: 20
+                borderRadius: 10
               }}
             >
-              {this.userInfo123()}
+              <View
+                style={{
+                  width: "100%",
+                  alignItems: "center",
+                  justifyContent: "center",
+                  height: "100%"
+                }}
+              >
+                <TouchableOpacity
+                  style={{
+                    flex: 1,
+                    marginVertical: 1,
+                    width: "100%",
+                    flexDirection: "row",
+                    backgroundColor: "white"
+                  }}
+                  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
+                    style={{
+                      flex: 5,
+                      alignItems: "flex-end"
+                    }}
+                  >
+                    <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,
+                    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
+                      style={{
+                        flex: 1,
+                        fontSize: 15,
+                        textAlignVertical: "center"
+                      }}
+                      numberOfLines={1}
+                      ellipsizeMode={"tail"}
+                    >
+                      生日。。。。
+                    </Text>
+                  </View>
+                  <View
+                    style={{
+                      flex: 1.1,
+                      alignItems: "center",
+                      justifyContent: "center"
+                    }}
+                  >
+                    {this.getArraowImg(2)}
+                  </View>
+                </TouchableOpacity>
+                <TouchableOpacity
+                  style={{
+                    flex: 1,
+                    width: "100%",
+                    flexDirection: "row",
+                    backgroundColor: "white",
+                    marginVertical: 1
+                  }}
+                  activeOpacity={1}
+                  onPress={() => this.arrowpress(3)}
+                >
+                  <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
+                      style={{
+                        flex: 1,
+                        fontSize: 15,
+                        textAlignVertical: "center"
+                      }}
+                      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
+                    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
+                      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: 1,
+                    marginTop: 1,
+                    width: "100%",
+                    flexDirection: "row",
+                    backgroundColor: "white",
+                    marginVertical: 1
+                  }}
+                  activeOpacity={1}
+                  onPress={() => this.arrowpress(5)}
+                >
+                  <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
+                      style={{
+                        flex: 1.1,
+                        fontSize: 15,
+                        textAlignVertical: "center"
+                      }}
+                      numberOfLines={1}
+                      ellipsizeMode={"tail"}
+                    >
+                      年级。。。
+                    </Text>
+                  </View>
+                  <View
+                    style={{
+                      flex: 1.1,
+                      alignItems: "center",
+                      justifyContent: "center"
+                    }}
+                  >
+                    {this.getArraowImg(5)}
+                  </View>
+                </TouchableOpacity>
+              </View>
             </View>
           </View>
 
           <View
-            style={{ flex: 0.5, backgroundColor: "rgba(242, 242, 242, 1)" }}
-          />
-          <View
             style={{
               width: "100%",
               flex: 4,
@@ -201,8 +451,8 @@ export default class PersonalInfo extends BasePage {
               flexDirection: "column"
             }}
           >
-            <View style={{ flex: 1 }} />
-            <View style={{ flex: 1, flexDirection: "row" }}>
+            <View style={{ flex: 2.5 }} />
+            <View style={{ flex: 2, flexDirection: "row" }}>
               <View style={{ flex: 1 }} />
               <View
                 style={{
@@ -214,7 +464,7 @@ export default class PersonalInfo extends BasePage {
                 <TouchableOpacity
                   activeOpacity={1}
                   style={{
-                    flex: 1,
+                    flex: 2,
                     width: "100%",
                     alignItems: "center",
                     justifyContent: "center",
@@ -227,7 +477,6 @@ export default class PersonalInfo extends BasePage {
                     style={{
                       flex: 1,
                       width: "100%",
-                      resizeMode: "repeat",
                       alignItems: "center",
                       justifyContent: "center",
                       height: "100%"
@@ -250,261 +499,18 @@ export default class PersonalInfo extends BasePage {
               </View>
               <View style={{ flex: 1 }} />
             </View>
+            <View style={{ flex: 0.5 }} />
           </View>
         </View>
       </View>
     );
   }
 
-  userInfo123() {
-    return (
-      <View
-        style={{
-          width: "100%",
-          alignItems: "center",
-          justifyContent: "center",
-          height: "100%"
-        }}
-      >
-        <TouchableOpacity
-          style={styles.item}
-          activeOpacity={1}
-          onPress={() => this.arrowpress(1)}
-        >
-          <View style={styles.item}>
-            <View
-              style={{
-                flex: 2,
-                alignItems: "center",
-                justifyContent: "center"
-              }}
-            >
-              {this.choseheadericon(1)}
-            </View>
+  // userInfo123() {
+  //   return (
 
-            <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.nickName}
-              </Text>
-            </View>
-
-            <View
-              style={{
-                flex: 1.1,
-                alignItems: "center",
-                justifyContent: "center"
-              }}
-            >
-              {this.getArraowImg(1)}
-            </View>
-          </View>
-        </TouchableOpacity>
-        <View style={{ flex: 0.05 }} />
-
-        <TouchableOpacity
-          style={styles.item}
-          activeOpacity={1}
-          onPress={() => this.arrowpress(2)}
-        >
-          <View style={styles.item}>
-            <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"}
-              >
-                生日。。。。
-              </Text>
-            </View>
-            <View
-              style={{
-                flex: 1.1,
-                alignItems: "center",
-                justifyContent: "center"
-              }}
-            >
-              {this.getArraowImg(2)}
-            </View>
-          </View>
-        </TouchableOpacity>
-        <View style={{ flex: 0.05 }} />
-        <TouchableOpacity
-          style={styles.item}
-          activeOpacity={1}
-          onPress={() => this.arrowpress(3)}
-        >
-          <View style={styles.item}>
-            <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
-                style={{
-                  flex: 1,
-                  fontSize: 15,
-                  textAlignVertical: "center"
-                }}
-                numberOfLines={1}
-                ellipsizeMode={"tail"}
-              >
-                {this.state.cisys}
-              </Text>
-            </View>
-            <View
-              style={{
-                flex: 1.1,
-                alignItems: "center",
-                justifyContent: "center"
-              }}
-            >
-              {this.getArraowImg(3)}
-            </View>
-          </View>
-        </TouchableOpacity>
-        <View style={{ flex: 0.05 }} />
-        <TouchableOpacity
-          style={styles.item}
-          activeOpacity={1}
-          onPress={() => this.arrowpress(4)}
-        >
-          <View style={styles.item}>
-            <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
-                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>
-          </View>
-        </TouchableOpacity>
-        <View style={{ flex: 0.05 }} />
-        <TouchableOpacity
-          style={styles.item}
-          activeOpacity={1}
-          onPress={() => this.arrowpress(5)}
-        >
-          <View style={styles.item}>
-            <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
-                style={{
-                  flex: 1.1,
-                  fontSize: 15,
-                  textAlignVertical: "center"
-                }}
-                numberOfLines={1}
-                ellipsizeMode={"tail"}
-              >
-                年级。。。
-              </Text>
-            </View>
-            <View
-              style={{
-                flex: 1.1,
-                alignItems: "center",
-                justifyContent: "center"
-              }}
-            >
-              {this.getArraowImg(5)}
-            </View>
-          </View>
-        </TouchableOpacity>
-      </View>
-    );
-  }
+  //   );
+  // }
 
   getArraowImg(type) {
     return (
@@ -607,7 +613,8 @@ const styles = StyleSheet.create({
     flex: 1,
     width: "100%",
     flexDirection: "row",
-    backgroundColor: "white"
+    backgroundColor: "white",
+    marginTop: 1
   },
   item_text: {
     flex: 2,