Newer
Older
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Response } from '@angular/http';
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
67
68
69
70
71
72
@IonicPage()
@Component({
selector: 'page-contract-personinfo',
templateUrl: 'contract-personinfo.html',
})
export class ContractPersoninfoPage {
contactPersonInfo = {};
userRelEntity = {
relUserId:'',
moduleName:'appcontact',
}
constructor(
public navCtrl: NavController,
public navParams: NavParams,
public appService:AppService
) {
}
ionViewDidLoad() {
this.contactPersonInfo = this.navParams.get("contactPerson");
console.log("contactPersonInfo:"+this.contactPersonInfo);
this.userRelEntity.relUserId = this.contactPersonInfo["id"];
}
//添加常用联系人
addcontactPersons(){
this.appService.ObserverHttpPost("/wisdomgroup/app/contact/addGeneralContactPersons",this.userRelEntity)
.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();
console.log("data:"+data);
this.navCtrl.push("ContactListPage");
}, error => {
this.appService.alert('网络异常!');
}
);
}
call(number){
console.log("拨打:" + number);
window.location.href = "tel:" + number;
}
//跳转设置分组
usualContactSet(){
this.navCtrl.push('MyBlockPage');
}