Commit 0bfe7a4d authored by wangqinghua's avatar wangqinghua

color

parent 1ae06d93
......@@ -7,7 +7,8 @@
<div class="mine-header" (click)="personInfo()">
<div class="mine-header-box">
<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 class="mine-header-right">
<h2 class="name">{{user?.userName}}</h2>
......@@ -22,7 +23,6 @@
<ion-item (click)="myActivityList()">
<div class="group">
<div class="group-box">
<!-- <ion-icon name="aperture" class="icon-left icon1"></ion-icon> -->
<img src="./assets/imgs/mine/wdhd.png" class="group-img">
<span>我的活动</span>
</div>
......
import { Component } from '@angular/core';
import { App, NavController, AlertController, NavParams } from 'ionic-angular';
import { LoginPage } from '../../login/login';
import { AppService } from '../../../service/appHttpService';
import { PersonInfoPage } from '../../person/personInfo/personInfo';
import { MyActivityListPage } from '../../mine/myActivityList/myActivityList';
import { MyReportPage } from '../../mine/myReport/myReport';
import { OperationListPage } from '../../operation-list/operation-list';
import { VersionPage } from '../../version/version';
import { Response } from '@angular/http';
import { Storage } from '@ionic/storage';
import { AppVersion } from '@ionic-native/app-version';
import { AppUpdateService } from '../../../service/appUpdateService';
import { MySurveyPage } from "../../mine/mySurvey/my-survey/my-survey";
import {Component} from '@angular/core';
import {App, NavController, AlertController, NavParams} from 'ionic-angular';
import {LoginPage} from '../../login/login';
import {AppGlobal, AppService} from '../../../service/appHttpService';
import {PersonInfoPage} from '../../person/personInfo/personInfo';
import {MyActivityListPage} from '../../mine/myActivityList/myActivityList';
import {MyReportPage} from '../../mine/myReport/myReport';
import {OperationListPage} from '../../operation-list/operation-list';
import {VersionPage} from '../../version/version';
import {Response} from '@angular/http';
import {Storage} from '@ionic/storage';
import {AppVersion} from '@ionic-native/app-version';
import {AppUpdateService} from '../../../service/appUpdateService';
import {MySurveyPage} from "../../mine/mySurvey/my-survey/my-survey";
import {MyDutyPage} from "../../mine/my-duty/my-duty";
@Component({
selector: 'page-mine',
templateUrl: 'mine.html',
selector: 'page-mine',
templateUrl: 'mine.html',
})
export class MinePage {
user: any;
orgName: '';
gender: object;
version: string = '';
isLatest:boolean = true;
constructor(public navCtrl: NavController,
private appCtrl: App,
private alertCtrl: AlertController,
public navParams: NavParams,
public appService: AppService,
public storage: Storage,
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');
user: any;
orgName: '';
gender: object;
version: string = '';
isLatest: boolean = true;
picture: string = AppGlobal.picture;
constructor(public navCtrl: NavController,
private appCtrl: App,
private alertCtrl: AlertController,
public navParams: NavParams,
public appService: AppService,
public storage: Storage,
private appUpdateService: AppUpdateService,
private appVersion: AppVersion) {
this.orgNameInfo();
}
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);
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() {
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");
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;
}
}
});
}).catch(err => {
console.log('getVersionNumber:' + err);
});
}
goSet(){
this.navCtrl.push('VersionPage');
}).catch(err => {
console.log('getVersionNumber:' + err);
});
}
goSet() {
this.navCtrl.push('VersionPage');
}
goDuty(){
goDuty() {
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