|
@@ -645,14 +645,10 @@ export default class PersonalInfo extends BasePage {
|
|
|
updateState(input_text, type) {
|
|
|
if (type == 1) {
|
|
|
this.setState({ nickName: input_text });
|
|
|
- let formData = new FormData();
|
|
|
- formData.append("nickName", input_text);
|
|
|
- this.updateUserInfo(formData);
|
|
|
+ this.updateUserInfo({ nickName: input_text });
|
|
|
} else if (type == 2) {
|
|
|
this.setState({ schoolName: input_text });
|
|
|
- let formData = new FormData();
|
|
|
- formData.append("school", input_text);
|
|
|
- this.updateUserInfo(formData);
|
|
|
+ this.updateUserInfo({ school: input_text });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -661,17 +657,21 @@ export default class PersonalInfo extends BasePage {
|
|
|
provinceName: provinces_name,
|
|
|
citys: citys_name
|
|
|
});
|
|
|
+ this.updateUserInfo({ province: provinces_name, city: citys_name });
|
|
|
}
|
|
|
commitGrade(text, index) {
|
|
|
this.setState({
|
|
|
grade_text: text,
|
|
|
grade_index: index
|
|
|
});
|
|
|
+ this.updateUserInfo({ grade: index + 1 });
|
|
|
}
|
|
|
birthdaycommit(year, month, day) {
|
|
|
this.setState({
|
|
|
birthday_time: year + "年" + month + "月" + day + "日"
|
|
|
});
|
|
|
+ var date = new Date(year + "-" + month + "-" + day);
|
|
|
+ this.updateUserInfo({ birthday: date });
|
|
|
}
|
|
|
|
|
|
photoback(photo_uri) {
|
|
@@ -683,13 +683,10 @@ export default class PersonalInfo extends BasePage {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- updateUserInfo(formData) {
|
|
|
- console.log(formData)
|
|
|
+ updateUserInfo(object) {
|
|
|
let opts = {
|
|
|
method: "PUT", //请求方法
|
|
|
- body: {
|
|
|
- nickName: '测试测试'
|
|
|
- }
|
|
|
+ body: object //请求体
|
|
|
};
|
|
|
user.update_UserInfo(opts).then(res => {
|
|
|
console.log(res);
|