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
190c2050
Commit
190c2050
authored
Oct 11, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通讯录
parent
cb6d2c9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
151 deletions
+120
-151
contract-personinfo.html
...ages/contact/contract-personinfo/contract-personinfo.html
+26
-21
contract-personinfo.ts
src/pages/contact/contract-personinfo/contract-personinfo.ts
+94
-130
No files found.
src/pages/contact/contract-personinfo/contract-personinfo.html
View file @
190c2050
<ion-header>
<ion-navbar>
<ion-title>
个人信息
</ion-title>
<span
*
ngIf=
"edit.room || edit.telephone || edit.email"
(
click
)="
editDone
()"
float-right
class=
"margin-right-10 color-999"
>
完成
</span>
<ion-buttons
start
>
<button
ion-button
(
click
)="
editCancel
()"
>
<span
start
*
ngIf=
"edit"
class=
"margin-right-10 color-999"
>
取消
</span>
</button>
</ion-buttons>
<ion-buttons
end
>
<button
ion-button
(
click
)="
editDone
()"
>
<span
end
*
ngIf=
"edit"
class=
"margin-right-10 color-999"
>
完成
</span>
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
...
...
@@ -50,26 +60,22 @@
<ion-item>
<div
class=
"info-item"
>
<span
class=
"info-span"
>
房间号
</span>
<div
*
ngIf=
"!edit.room"
class=
"info-item-content"
(
click
)="
editFun
('
room
')"
>
<ng-container
*
ngIf=
"contactPersonInfo.abbreviation"
>
<span
class=
"info"
>
{{contactPersonInfo.abbreviation}}
</span>
</ng-container>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</div>
<div
*
ngIf=
"edit.room"
class=
"info-item-content"
>
<input
type=
"text"
[(
ngModel
)]="
abbreviation
"
>
<div
class=
"info-item-content"
(
click
)="
editFun
()"
>
<label>
<input
type=
"text"
[(
ngModel
)]="
abbreviation
"
>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</label>
</div>
</div>
</ion-item>
<ion-item>
<div
class=
"info-item"
>
<span
class=
"info-span"
>
座机
</span>
<div
*
ngIf=
"!edit.telephone"
class=
"info-item-content"
(
click
)="
editFun
('
telephone
')"
>
<span
class=
"info"
>
{{contactPersonInfo.telephone}}
</span>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</div>
<div
*
ngIf=
"edit.telephone"
class=
"info-item-content"
>
<input
type=
"text"
[(
ngModel
)]="
telephone
"
>
<div
class=
"info-item-content"
(
click
)="
editFun
()"
>
<label>
<input
type=
"text"
[(
ngModel
)]="
telephone
"
>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</label>
</div>
</div>
</ion-item>
...
...
@@ -78,12 +84,11 @@
<ion-item>
<div
class=
"info-item"
>
<span
class=
"info-span"
>
邮箱
</span>
<div
*
ngIf=
"!edit.email"
class=
"info-item-content"
(
click
)="
editFun
('
email
')"
>
<span
class=
"info"
>
{{contactPersonInfo.email}}
</span>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</div>
<div
*
ngIf=
"edit.email"
class=
"info-item-content"
>
<input
type=
"text"
[(
ngModel
)]="
email
"
>
<div
class=
"info-item-content"
(
click
)="
editFun
()"
>
<label>
<input
type=
"text"
[(
ngModel
)]="
email
"
>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</label>
</div>
</div>
</ion-item>
...
...
src/pages/contact/contract-personinfo/contract-personinfo.ts
View file @
190c2050
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
Response
}
from
'@angular/http'
;
import
{
AppService
}
from
'../../../service/appHttpService'
;
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
Response
}
from
'@angular/http'
;
import
{
AppService
}
from
'../../../service/appHttpService'
;
import
{
ContactListPage
}
from
'../contactList/contactList'
;
import
{
ContactListPage
}
from
'../contactList/contactList'
;
import
{
MyBlockPage
}
from
"../my-block/my-block"
;
@
IonicPage
()
@
Component
({
selector
:
'page-contract-personinfo'
,
templateUrl
:
'contract-personinfo.html'
,
selector
:
'page-contract-personinfo'
,
templateUrl
:
'contract-personinfo.html'
,
})
export
class
ContractPersoninfoPage
{
contactPersonInfo
=
{
gender
:
''
,
telephone
:
''
,
email
:
''
,
abbreviation
:
''
};
id
;
userRelEntity
=
{
relUserId
:
''
,
moduleName
:
'appcontact'
,
};
edit
=
{
email
:
false
,
telephone
:
false
,
room
:
false
contactPersonInfo
=
{
gender
:
''
,
telephone
:
''
,
email
:
''
,
abbreviation
:
''
};
id
;
userRelEntity
=
{
relUserId
:
''
,
moduleName
:
'appcontact'
,
};
edit
=
false
;
email
;
abbreviation
;
telephone
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
}
ionViewDidLoad
()
{
this
.
id
=
this
.
navParams
.
get
(
"id"
);
this
.
getPersonInfo
();
}
getPersonInfo
(){
const
data
=
{
'userId'
:
this
.
id
};
this
.
appService
.
ObserverHttpGet
(
"/wisdomgroup/modules/telpBookPerson"
,
data
)
.
subscribe
((
res
:
Response
)
=>
{
this
.
contactPersonInfo
=
res
.
json
().
data
;
this
.
email
=
this
.
contactPersonInfo
.
email
;
this
.
abbreviation
=
this
.
contactPersonInfo
.
abbreviation
;
this
.
telephone
=
this
.
contactPersonInfo
.
telephone
;
},
error
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
}
);
}
//添加常用联系人
addcontactPersons
(){
const
data
=
{
'relUserId'
:
this
.
id
,
'moduleName'
:
'appcontact'
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
}
this
.
appService
.
ObserverHttpPostOption
(
"/wisdomgroup/app/contact/addGeneralContactPersons"
,
data
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
console
.
log
(
"data:"
+
data
);
if
(
data
[
"result"
]
==
'2'
){
this
.
appService
.
popToastView
(
'该联系人已在常用联系人中!'
,
'top'
,
2000
);
}
else
if
(
data
[
"result"
]
==
'3'
){
this
.
appService
.
popToastView
(
'添加常用联系人失败!'
,
'top'
,
2000
);
}
else
{
//this.appService.popToastView('添加常用联系人成功!','top',2000);
this
.
navCtrl
.
push
(
"ContactListPage"
);
}
//this.navCtrl.pop();
},
error
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
}
);
}
//移除常用联系人
cancelGenaralPersons
(){
this
.
appService
.
ObserverHttpPost
(
"/wisdomgroup/app/contact/deleteGeneralContactPersons"
,
this
.
userRelEntity
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
this
.
navCtrl
.
push
(
"ContactListPage"
);
},
error
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
}
);
}
call
(
number
){
console
.
log
(
"拨打:"
+
number
);
window
.
location
.
href
=
"tel:"
+
number
;
}
editFun
(
type
){
switch
(
type
){
case
'email'
:{
this
.
edit
.
email
=
true
;
break
;
};
case
'telephone'
:{
this
.
edit
.
telephone
=
true
;
break
;
};
case
'room'
:{
this
.
edit
.
room
=
true
;
break
;
}
}
ionViewDidLoad
()
{
this
.
id
=
this
.
navParams
.
get
(
"id"
);
this
.
getPersonInfo
();
}
//跳转设置分组
usualContactSet
(){
this
.
navCtrl
.
push
(
'MyBlockPage'
,{
'item'
:
this
.
contactPersonInfo
});
}
editDone
(){
const
paramsEmail
=
{
email
:
this
.
email
};
const
paramsTelePhone
=
{
telephone
:
this
.
telephone
};
const
paramsAbbreviation
=
{
abbreviation
:
this
.
abbreviation
getPersonInfo
()
{
const
data
=
{
'userId'
:
this
.
id
};
this
.
appService
.
ObserverHttp
Put
(
"/wisdomgroup/modules/telpBookPerson/email/"
,
paramsEmail
,
this
.
id
)
this
.
appService
.
ObserverHttp
Get
(
"/wisdomgroup/modules/telpBookPerson"
,
data
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
this
.
contactPersonInfo
=
res
.
json
().
data
;
this
.
email
=
this
.
contactPersonInfo
.
email
;
this
.
abbreviation
=
this
.
contactPersonInfo
.
abbreviation
;
this
.
telephone
=
this
.
contactPersonInfo
.
telephone
;
},
error
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
}
);
}
this
.
appService
.
ObserverHttpPut
(
"/wisdomgroup//modules/telpBookPerson/telephone/"
,
paramsTelePhone
,
this
.
id
)
//添加常用联系人
addcontactPersons
()
{
const
data
=
{
'relUserId'
:
this
.
id
,
'moduleName'
:
'appcontact'
}
this
.
appService
.
ObserverHttpPostOption
(
"/wisdomgroup/app/contact/addGeneralContactPersons"
,
data
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
console
.
log
(
"data:"
+
data
);
if
(
data
[
"result"
]
==
'2'
)
{
this
.
appService
.
popToastView
(
'该联系人已在常用联系人中!'
,
'top'
,
2000
);
}
else
if
(
data
[
"result"
]
==
'3'
)
{
this
.
appService
.
popToastView
(
'添加常用联系人失败!'
,
'top'
,
2000
);
}
else
{
//this.appService.popToastView('添加常用联系人成功!','top',2000);
this
.
navCtrl
.
push
(
"ContactListPage"
);
}
//this.navCtrl.pop();
},
error
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
}
);
}
this
.
appService
.
ObserverHttpPut
(
"/wisdomgroup//modules/telpBookPerson/abbreviation/"
,
paramsAbbreviation
,
this
.
id
)
//移除常用联系人
cancelGenaralPersons
()
{
this
.
appService
.
ObserverHttpPost
(
"/wisdomgroup/app/contact/deleteGeneralContactPersons"
,
this
.
userRelEntity
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
this
.
navCtrl
.
push
(
"ContactListPage"
);
},
error
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
}
);
}
call
(
number
)
{
console
.
log
(
"拨打:"
+
number
);
window
.
location
.
href
=
"tel:"
+
number
;
}
this
.
edit
=
{
email
:
false
,
telephone
:
false
,
room
:
false
editFun
()
{
this
.
edit
=
true
;
}
//跳转设置分组
usualContactSet
()
{
this
.
navCtrl
.
push
(
'MyBlockPage'
,
{
'item'
:
this
.
contactPersonInfo
});
}
//取消编辑
editCancel
()
{
this
.
getPersonInfo
();
this
.
edit
=
false
;
}
//完成
editDone
()
{
const
data
=
{
email
:
this
.
email
,
telephone
:
this
.
telephone
,
abbreviation
:
this
.
abbreviation
};
this
.
appService
.
ObserverHttpPut
(
"/wisdomgroup/modules/telpBookPerson/"
,
this
.
id
,
data
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
},
error
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
}
);
this
.
edit
=
false
;
this
.
getPersonInfo
();
}
...
...
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