Commit 0bfe7a4d authored by wangqinghua's avatar wangqinghua

color

parent 1ae06d93
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<div class="mine-header" (click)="personInfo()"> <div class="mine-header" (click)="personInfo()">
<div class="mine-header-box"> <div class="mine-header-box">
<div class="mine-header-left"> <div class="mine-header-left">
<img src="./assets/imgs/head.png" class="head-photo"> <img *ngIf="user.userDetail?.user?.picUrl == ''" src="./assets/imgs/head.png" class="head-photo">
<img *ngIf="user.userDetail?.user?.picUrl != ''" src="{{picture+user.userDetail?.user?.picUrl}}" class="head-photo">
</div> </div>
<div class="mine-header-right"> <div class="mine-header-right">
<h2 class="name">{{user?.userName}}</h2> <h2 class="name">{{user?.userName}}</h2>
...@@ -22,7 +23,6 @@ ...@@ -22,7 +23,6 @@
<ion-item (click)="myActivityList()"> <ion-item (click)="myActivityList()">
<div class="group"> <div class="group">
<div class="group-box"> <div class="group-box">
<!-- <ion-icon name="aperture" class="icon-left icon1"></ion-icon> -->
<img src="./assets/imgs/mine/wdhd.png" class="group-img"> <img src="./assets/imgs/mine/wdhd.png" class="group-img">
<span>我的活动</span> <span>我的活动</span>
</div> </div>
......
import { Component } from '@angular/core'; import {Component} from '@angular/core';
import { App, NavController, AlertController, NavParams } from 'ionic-angular'; import {App, NavController, AlertController, NavParams} from 'ionic-angular';
import { LoginPage } from '../../login/login'; import {LoginPage} from '../../login/login';
import { AppService } from '../../../service/appHttpService'; import {AppGlobal, AppService} from '../../../service/appHttpService';
import { PersonInfoPage } from '../../person/personInfo/personInfo'; import {PersonInfoPage} from '../../person/personInfo/personInfo';
import { MyActivityListPage } from '../../mine/myActivityList/myActivityList'; import {MyActivityListPage} from '../../mine/myActivityList/myActivityList';
import { MyReportPage } from '../../mine/myReport/myReport'; import {MyReportPage} from '../../mine/myReport/myReport';
import { OperationListPage } from '../../operation-list/operation-list'; import {OperationListPage} from '../../operation-list/operation-list';
import { VersionPage } from '../../version/version'; import {VersionPage} from '../../version/version';
import { Response } from '@angular/http'; import {Response} from '@angular/http';
import { Storage } from '@ionic/storage'; import {Storage} from '@ionic/storage';
import { AppVersion } from '@ionic-native/app-version'; import {AppVersion} from '@ionic-native/app-version';
import { AppUpdateService } from '../../../service/appUpdateService'; import {AppUpdateService} from '../../../service/appUpdateService';
import { MySurveyPage } from "../../mine/mySurvey/my-survey/my-survey"; import {MySurveyPage} from "../../mine/mySurvey/my-survey/my-survey";
import {MyDutyPage} from "../../mine/my-duty/my-duty"; import {MyDutyPage} from "../../mine/my-duty/my-duty";
@Component({ @Component({
selector: 'page-mine', selector: 'page-mine',
templateUrl: 'mine.html', templateUrl: 'mine.html',
}) })
export class MinePage { export class MinePage {
user: any; user: any;
orgName: ''; orgName: '';
gender: object; gender: object;
version: string = ''; version: string = '';
isLatest:boolean = true; isLatest: boolean = true;
constructor(public navCtrl: NavController, picture: string = AppGlobal.picture;
private appCtrl: App,
private alertCtrl: AlertController, constructor(public navCtrl: NavController,
public navParams: NavParams, private appCtrl: App,
public appService: AppService, private alertCtrl: AlertController,
public storage: Storage, public navParams: NavParams,
private appUpdateService: AppUpdateService, public appService: AppService,
private appVersion: AppVersion) { public storage: Storage,
this.orgNameInfo(); private appUpdateService: AppUpdateService,
} private appVersion: AppVersion) {
this.orgNameInfo();
ionViewWillEnter() {
this.getversion();
}
orgNameInfo(): void {
this.user = this.storage.get("user").then((value) => {
this.user = value;
console.log(this.user);
console.log("id1:" + this.user.id);
this.gender = this.user.userDetail.user.gender;
console.log("gender:" + this.gender);
this.getOrgName(this.user.id, result => {
let data = result;
this.orgName = data["orgName"];
});
});
}
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 => {
});
}
personInfo() {
this.navCtrl.push("PersonInfoPage");
}
//我的活动
myActivityList() {
this.navCtrl.push("MyActivityListPage");
}
//我的报备
myReport() {
this.navCtrl.push("MyReportPage");
}
//操作记录
myOperationList() {
this.navCtrl.push("OperationListPage");
}
//我的问卷
mySurvey(){
this.navCtrl.push('MySurveyPage');
} }
logout() { ionViewWillEnter() {
this.alertCtrl.create({ this.getversion();
message: "确认退出登录?", }
buttons: [
{ orgNameInfo(): void {
text: '取消', this.user = this.storage.get("user").then((value) => {
role: 'cancel' this.user = value;
}, console.log(this.user);
{ console.log("id1:" + this.user.id);
text: '确定', this.gender = this.user.userDetail.user.gender;
handler: () => { console.log("gender:" + this.gender);
// this.appService.ObserverHttpGet("/wisdomgroup/app/logout",null) this.getOrgName(this.user.id, result => {
// .subscribe((res: Response) => { let data = result;
// this.appCtrl.getRootNav().setRoot(LoginPage) this.orgName = data["orgName"];
// }, error => { });
// this.appService.alert('系统错误!'); });
// }) }
//退出登陆,将缓存中的用户注销,跳转到登陆页面。
this.storage.get("user").then((value) => { getOrgName(id, callback?): any {
console.log(value); this.appService.ObserverHttpPost("/wisdomgroup/app/getOrgName", {"userid": id})
.toPromise()
.then(res => {
var data = res.json();
callback(data == null ? "[]" : data);
})
.catch(error => {
});
}
personInfo() {
this.navCtrl.push("PersonInfoPage");
}
//我的活动
myActivityList() {
this.navCtrl.push("MyActivityListPage");
}
//我的报备
myReport() {
this.navCtrl.push("MyReportPage");
}
//操作记录
myOperationList() {
this.navCtrl.push("OperationListPage");
}
//我的问卷
mySurvey() {
this.navCtrl.push('MySurveyPage');
}
logout() {
this.alertCtrl.create({
message: "确认退出登录?",
buttons: [
{
text: '取消',
role: 'cancel'
},
{
text: '确定',
handler: () => {
// this.appService.ObserverHttpGet("/wisdomgroup/app/logout",null)
// .subscribe((res: Response) => {
// this.appCtrl.getRootNav().setRoot(LoginPage)
// }, error => {
// this.appService.alert('系统错误!');
// })
//退出登陆,将缓存中的用户注销,跳转到登陆页面。
this.storage.get("user").then((value) => {
console.log(value);
});
this.storage.remove("user");
this.storage.remove("userLoginInfo");
this.logoutApp();
this.appCtrl.getRootNav().setRoot(LoginPage)
}
}]
}).present();
}
//后台退出
logoutApp() {
this.appService.ObserverHttpGet("/wisdomgroup/app/logout", null)
.subscribe((res: Response) => {
let data = res.json();
}, error => {
this.appService.alert('网络异常!');
}
);
}
//版本信息
currentVersion() {
this.navCtrl.push("VersionPage");
}
//获取最新版本信息
getversion() {
//检测是否需要更新
this.appVersion.getVersionNumber().then((version: string) => {
this.version = version;
this.appUpdateService.compariVersion().subscribe(data => {
if (data.code == 200) {
if (data.latestVersion != null && data.latestVersion != version) {
this.isLatest = false;
}
}
}); });
this.storage.remove("user"); }).catch(err => {
this.storage.remove("userLoginInfo"); console.log('getVersionNumber:' + err);
this.logoutApp(); });
this.appCtrl.getRootNav().setRoot(LoginPage) }
}
goSet() {
}] this.navCtrl.push('VersionPage');
}).present();
}
//后台退出
logoutApp() {
this.appService.ObserverHttpGet("/wisdomgroup/app/logout", null)
.subscribe((res: Response) => {
let data = res.json();
}, error => {
this.appService.alert('网络异常!');
}
);
}
//版本信息
currentVersion() {
this.navCtrl.push("VersionPage");
}
//获取最新版本信息
getversion() {
//检测是否需要更新
this.appVersion.getVersionNumber().then((version: string) => {
this.version = version;
this.appUpdateService.compariVersion().subscribe(data => {
if (data.code == 200) {
if (data.latestVersion != null && data.latestVersion != version) {
this.isLatest = false;
}
}
});
}).catch(err => {
console.log('getVersionNumber:' + err);
});
}
goSet(){
this.navCtrl.push('VersionPage');
} }
goDuty(){ goDuty() {
this.navCtrl.push("MyDutyPage"); this.navCtrl.push("MyDutyPage");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment