Browse Source

1.增加默认头像

zhangmengjie 5 years ago
parent
commit
18f8d65be6
1 changed files with 4 additions and 6 deletions
  1. 4 6
      pages/components/PersonalInfo.js

+ 4 - 6
pages/components/PersonalInfo.js

@@ -43,7 +43,7 @@ export default class PersonalInfo extends BasePage {
     birthday_month: 0,
     birthday_day: 0,
     birthday_time: 0,
-    photo_uri: null
+    photo_uri: require("../images/userInfo/default_photo.png")
   };
   updateState(data) {
     this.setState(data);
@@ -155,9 +155,7 @@ export default class PersonalInfo extends BasePage {
                           // borderWidth: 3
                           // borderColor: "red"
                         }}
-                        source={{
-                          uri: this.state.photo_uri
-                        }}
+                        source={this.state.photo_uri}
                       />
                     </View>
                     <View
@@ -651,9 +649,9 @@ export default class PersonalInfo extends BasePage {
     });
   }
 
-  photoback(uri) {
+  photoback(photo_uri) {
     this.setState({
-      photo_uri: uri
+      photo_uri: { uri: photo_uri }
     });
     this.chosephoto.setModalVisible(false);
   }