Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-ces
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
wisdom-ces
Commits
0bfe7a4d
Commit
0bfe7a4d
authored
Oct 15, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
1ae06d93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
154 additions
and
150 deletions
+154
-150
mine.html
src/pages/tabs/mine/mine.html
+2
-2
mine.ts
src/pages/tabs/mine/mine.ts
+152
-148
No files found.
src/pages/tabs/mine/mine.html
View file @
0bfe7a4d
...
...
@@ -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>
...
...
src/pages/tabs/mine/mine.ts
View file @
0bfe7a4d
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"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment