Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import {Component} from '@angular/core';
import {IonicPage, NavController, ToastController} from 'ionic-angular';
import {ModifyPasswordPage} from "../modifyPassword/modifyPassword";
import {Storage} from '@ionic/storage';
import {AppGlobal, AppService} from "../../../../service/http.service";
import {EditPersonInfoPage} from '../editPersonInfo/editPersonInfo';
@IonicPage()
@Component({
selector: 'page-personInfo',
templateUrl: 'personInfo.html'
})
export class PersonInfoPage {
orgName = '';
user: any;
gender: object;
//userInfo: object ;
userid: '';
picture: string = AppGlobal.picture;
constructor(public navCtrl: NavController,
public storage: Storage,
public appService: AppService,
public toast: ToastController) {
}
//ionViewDidLoad():void{
ionViewWillEnter(): void {
this.user = this.storage.get("user").then((value) => {
this.user = value;
this.gender = this.user.userDetail.user.gender;
this.getOrgName(this.user.id, result => {
let data = result;
this.orgName = data["orgName"];
});
});
}
modifyPwd() {
this.navCtrl.push("ModifyPasswordPage")
}
getOrgName(id, callback?): any {
this.appService.ObserverHttpPost("/wisdomgroup/app/getOrgName", {"userid": id})
.toPromise()
.then(res => {
var data = res.json();
callback(data == null ? "[]" : data);
})
.catch(error => {
});
}
//不同的code代表修改不同的数据,1房间,2座机,3邮箱
edit(code) {
this.navCtrl.push("EditPersonInfoPage", {code: code});
}
goBack() {
this.navCtrl.popToRoot();
}
}