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
e53d309c
Commit
e53d309c
authored
Oct 15, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
570b3483
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
395 additions
and
349 deletions
+395
-349
ionic.config.json
ionic.config.json
+5
-0
contract-personinfo.html
...ages/contact/contract-personinfo/contract-personinfo.html
+32
-15
contract-personinfo.ts
src/pages/contact/contract-personinfo/contract-personinfo.ts
+12
-0
myActivityList.html
src/pages/mine/myActivityList/myActivityList.html
+1
-1
my-survey.html
src/pages/mine/mySurvey/my-survey/my-survey.html
+1
-1
desicr.html
src/pages/surveyManage/item/desicr/desicr.html
+1
-1
desicr.ts
src/pages/surveyManage/item/desicr/desicr.ts
+10
-3
set.scss
src/pages/surveyManage/item/set/set.scss
+5
-1
person.html
src/pages/surveyManage/modal/person/person.html
+1
-1
home.ts
src/pages/tabs/home/home.ts
+5
-4
appHttpService.ts
src/service/appHttpService.ts
+322
-322
No files found.
ionic.config.json
View file @
e53d309c
...
@@ -5,5 +5,9 @@
...
@@ -5,5 +5,9 @@
},
},
"type"
:
"ionic-angular"
,
"type"
:
"ionic-angular"
,
"proxies"
:
[
"proxies"
:
[
{
"path"
:
"/wisdomgroup"
,
"proxyUrl"
:
"http://180.168.156.212:2931/wisdomgroup"
}
]
]
}
}
\ No newline at end of file
src/pages/contact/contract-personinfo/contract-personinfo.html
View file @
e53d309c
...
@@ -60,22 +60,33 @@
...
@@ -60,22 +60,33 @@
<ion-item>
<ion-item>
<div
class=
"info-item"
>
<div
class=
"info-item"
>
<span
class=
"info-span"
>
房间号
</span>
<span
class=
"info-span"
>
房间号
</span>
<div
class=
"info-item-content"
(
click
)="
editFun
()"
>
<div
class=
"info-item-content"
>
<label>
<input
type=
"text"
[(
ngModel
)]="
abbreviation
"
>
<ng-container
*
ngIf=
"role == 1 || role == 2 || role == 3"
>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
<label
(
click
)="
editFun
()"
>
</label>
<input
type=
"text"
[(
ngModel
)]="
abbreviation
"
>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</label>
</ng-container>
<ng-container
*
ngIf=
"role == 0 || role == 4"
>
{{abbreviation}}
</ng-container>
</div>
</div>
</div>
</div>
</ion-item>
</ion-item>
<ion-item>
<ion-item>
<div
class=
"info-item"
>
<div
class=
"info-item"
>
<span
class=
"info-span"
>
座机
</span>
<span
class=
"info-span"
>
座机
</span>
<div
class=
"info-item-content"
(
click
)="
editFun
()"
>
<div
class=
"info-item-content"
>
<label>
<ng-container
*
ngIf=
"role == 1 || role == 2 || role == 3"
>
<input
type=
"text"
[(
ngModel
)]="
telephone
"
>
<label
(
click
)="
editFun
()"
>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
<input
type=
"text"
[(
ngModel
)]="
telephone
"
>
</label>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</label>
</ng-container>
<ng-container
*
ngIf=
"role == 0 || role == 4"
>
{{telephone}}
</ng-container>
</div>
</div>
</div>
</div>
</ion-item>
</ion-item>
...
@@ -84,11 +95,17 @@
...
@@ -84,11 +95,17 @@
<ion-item>
<ion-item>
<div
class=
"info-item"
>
<div
class=
"info-item"
>
<span
class=
"info-span"
>
邮箱
</span>
<span
class=
"info-span"
>
邮箱
</span>
<div
class=
"info-item-content"
(
click
)="
editFun
()"
>
<div
class=
"info-item-content"
>
<label>
<input
type=
"text"
[(
ngModel
)]="
email
"
>
<ng-container
*
ngIf=
"role == 1 || role == 2 || role == 3"
>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
<label
(
click
)="
editFun
()"
>
</label>
<input
type=
"text"
[(
ngModel
)]="
email
"
>
<ion-icon
ios=
"ios-create-outline"
md=
"md-create-outline"
></ion-icon>
</label>
</ng-container>
<ng-container
*
ngIf=
"role == 0 || role == 4"
>
{{email}}
</ng-container>
</div>
</div>
</div>
</div>
</ion-item>
</ion-item>
...
...
src/pages/contact/contract-personinfo/contract-personinfo.ts
View file @
e53d309c
...
@@ -28,6 +28,8 @@ export class ContractPersoninfoPage {
...
@@ -28,6 +28,8 @@ export class ContractPersoninfoPage {
telephone
;
telephone
;
isContact
;
isContact
;
role
;
//权限
constructor
(
public
navCtrl
:
NavController
,
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
public
appService
:
AppService
)
{
...
@@ -36,6 +38,16 @@ export class ContractPersoninfoPage {
...
@@ -36,6 +38,16 @@ export class ContractPersoninfoPage {
ionViewDidLoad
()
{
ionViewDidLoad
()
{
this
.
id
=
this
.
navParams
.
get
(
"id"
);
this
.
id
=
this
.
navParams
.
get
(
"id"
);
this
.
getPersonInfo
();
this
.
getPersonInfo
();
this
.
getRole
();
}
//获取权限
getRole
(){
this
.
appService
.
ObserverHttpGet
(
"/wisdomgroup/app/getRoles"
,
null
).
subscribe
((
res
:
Response
)
=>
{
this
.
role
=
res
.
json
();
},
error
=>
{
this
.
appService
.
alert
(
'系统错误!'
);
});
}
}
getPersonInfo
()
{
getPersonInfo
()
{
...
...
src/pages/mine/myActivityList/myActivityList.html
View file @
e53d309c
<ion-header>
<ion-header>
<ion-navbar>
<ion-navbar>
<ion-title>
活动订单
</ion-title>
<ion-title>
我的活动
</ion-title>
</ion-navbar>
</ion-navbar>
</ion-header>
</ion-header>
<ion-content
class=
"bgc-e7e8ed"
>
<ion-content
class=
"bgc-e7e8ed"
>
...
...
src/pages/mine/mySurvey/my-survey/my-survey.html
View file @
e53d309c
<ion-header>
<ion-header>
<ion-navbar>
<ion-navbar>
<ion-title>
问卷调查
</ion-title>
<ion-title>
我的问卷
</ion-title>
</ion-navbar>
</ion-navbar>
</ion-header>
</ion-header>
...
...
src/pages/surveyManage/item/desicr/desicr.html
View file @
e53d309c
<ion-header>
<ion-header>
<ion-navbar>
<ion-navbar>
<ion-title>
编辑
问卷
</ion-title>
<ion-title>
创建
问卷
</ion-title>
</ion-navbar>
</ion-navbar>
</ion-header>
</ion-header>
...
...
src/pages/surveyManage/item/desicr/desicr.ts
View file @
e53d309c
...
@@ -34,15 +34,22 @@ export class DesicrPage {
...
@@ -34,15 +34,22 @@ export class DesicrPage {
submitOrder
(){
submitOrder
(){
const
toast
=
this
.
toastCtrl
.
create
(
message
);
const
toast
=
this
.
toastCtrl
.
create
(
message
);
if
(
!
this
.
desrc
.
title
){
toast
.
setMessage
(
'请填写标题'
);
toast
.
present
();
return
false
}
if
(
this
.
desrc
.
usergroup
==
null
){
if
(
this
.
desrc
.
usergroup
==
null
){
this
.
desrc
.
usergroup
=
'all'
;
this
.
desrc
.
usergroup
=
'all'
;
}
}
this
.
appService
.
ObserverHttpPost
(
'/wisdomgroup/modules/question/create'
,
this
.
desrc
)
this
.
appService
.
ObserverHttpPost
(
'/wisdomgroup/modules/question/create'
,
this
.
desrc
)
.
subscribe
(
.
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
toast
.
setMessage
(
'创建成功'
);
if
(
res
){
toast
.
present
();
toast
.
setMessage
(
'创建成功'
);
this
.
navCtrl
.
pop
();
toast
.
present
();
this
.
navCtrl
.
push
(
'EditPage'
,{
temp
:
res
.
json
()});
}
}
}
)
)
}
}
...
...
src/pages/surveyManage/item/set/set.scss
View file @
e53d309c
page-set
{
page-set
{
.submit
{
margin-top
:
20px
;
border
:
1px
solid
#34b4fc
;
background-color
:
#34b4fc
;
}
}
}
src/pages/surveyManage/modal/person/person.html
View file @
e53d309c
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<ion-title>
选择用户组
</ion-title>
<ion-title>
选择用户组
</ion-title>
<ion-buttons
start
>
<ion-buttons
start
>
<button
ion-button
(
click
)="
dismiss
()"
>
<button
ion-button
(
click
)="
dismiss
()"
>
<span
ion-textclass=
"color-fff"
>
取消
</span>
<span
ion-text
class=
"color-fff"
>
取消
</span>
</button>
</button>
</ion-buttons>
</ion-buttons>
<ion-buttons
end
>
<ion-buttons
end
>
...
...
src/pages/tabs/home/home.ts
View file @
e53d309c
...
@@ -98,14 +98,15 @@ export class HomePage {
...
@@ -98,14 +98,15 @@ export class HomePage {
},
error
=>
{
},
error
=>
{
this
.
appService
.
alert
(
'系统错误!'
);
this
.
appService
.
alert
(
'系统错误!'
);
});
});
this
.
getRole
();
}
}
ionViewDidEnter
()
{
ionViewDidEnter
()
{
//获取权限
this
.
getRole
();
//获取消息数量
//获取消息数量
this
.
getNewCount
();
this
.
getNewCount
();
//获取日历
this
.
getCalendar
();
}
}
ionViewWillEnter
()
{
ionViewWillEnter
()
{
...
@@ -364,7 +365,7 @@ export class HomePage {
...
@@ -364,7 +365,7 @@ export class HomePage {
//日历
//日历
ionViewDidLoad
()
{
getCalendar
()
{
let
date
=
new
Date
();
let
date
=
new
Date
();
let
year
=
date
.
getFullYear
();
let
year
=
date
.
getFullYear
();
let
month
=
date
.
getMonth
()
+
1
;
let
month
=
date
.
getMonth
()
+
1
;
...
...
src/service/appHttpService.ts
View file @
e53d309c
// //本地请求方式
//本地请求方式
// import {LoadingController, AlertController, ToastController} from 'ionic-angular';
// import {Injectable} from '@angular/core';
// import {Http, Headers} from '@angular/http';
// import {Observable} from "rxjs";
//
// @Injectable()
// export class AppGlobal {
// //缓存key的配置
// static cache: any = {
// slides: "_dress_slides",
// categories: "_dress_categories",
// products: "_dress_products"
// }
// //接口基地址 //测试环境
// // static domain = "http://220.248.107.115:2239";
// //正式环境
// // static domain = "http://180.153.158.250:3306";
// static domain = "http://180.168.156.212:2931";
// //static domain = "http://localhost:8080"
//
//
// //测试
// // static picture = "http://220.248.107.115:2239/wisdomgroup/manager/getIcon/";
// //正式
// // static picture = "http://180.153.158.250:3306/wisdomgroup/manager/getIcon/";
// static picture = "http://180.168.156.212:2931/wisdomgroup/manager/getIcon/";
//
// //通知公告图片参数
// static pictureNotice = "http://180.168.156.212:2931";
//
// //接口地址
// static API: any = {
// getCategories: '/api/ionic3/getCategories',
// getLogin: '/app/loginpost',
// getDetails: '/api/ionic3/details'
// };
// }
//
// @Injectable()
// export class AppService {
// constructor(public http: Http,
// public loadingCtrl: LoadingController,
// private alertCtrl: AlertController,
// private toastCtrl: ToastController,) {
// }
//
// // 对参数进行编码
// encode(params, flag) {
// var str = '';
// if (params) {
// if (flag == 'get') { //get /a/b
// for (var key in params) {
// if (params.hasOwnProperty(key)) {
// var value = params[key];
// str += value + '/';
// }
// }
// str = '/' + str.substring(0, str.length - 1);
// }
// if (flag == 'post') { //post a=b&c=d
// for (var key in params) {
// if (params.hasOwnProperty(key)) {
// var value = params[key];
// str += key + '=' + value + '&';
// }
// }
// str = str.substring(0, str.length - 1);
// }
// }
// return str;
// }
//
// //get请求
// ObserverHttpGet(url, params): Observable<any> {
// return this.http.get(url + this.encode(params, "get")) //本地
// }
//
// //get请求
// ObserverHttpGetData(url, params): Observable<any> {
// return this.http.get(url, params) //本地
// }
//
// //get请求
// ObserverHttpGetAdd(url, params): Observable<any> {
// return this.http.get(url+ params) //本地
// }
//
// //get请求带?的
// ObserverHttpGetOption(url, params): Observable<any> {
// return this.http.get(url, {params: params}); //本地
// }
//
// //delete
// ObserverHttpDetelete(url, params): Observable<any> {
// return this.http.delete(url + this.encode(params, "get")) //本地
// }
//
// //delete
// ObserverHttpDeteleteOption(url, params): Observable<any> {
// return this.http.delete(url + params); //本地
// }
//
// //delete
// ObserverHttpDeteleteData(url, params,data): Observable<any> {
// return this.http.delete(url + params,{
// params:this.encode(data,'post'),
// headers: new Headers({
// // "Accept": "application/json",
// "Content-Type": "application/json"
// // 'Content-Type':'application/x-www-form-urlencoded,charset=UTF-8'
// })
// }) //本地
// }
//
// ObserverHttpPostData(url, params) {
// return this.http.post(url, params, { //本地
// headers: new Headers({
// // "Accept": "application/json",
// "Content-Type": "application/json"
// // 'Content-Type':'application/x-www-form-urlencoded,charset=UTF-8'
// })
// })
// }
//
//
// ObserverHttpPostAdd(url, params) {
// return this.http.post(url+ params, { //本地
// headers: new Headers({
// // "Accept": "application/json",
// "Content-Type": "application/json"
// // 'Content-Type':'application/x-www-form-urlencoded,charset=UTF-8'
// })
// })
// }
//
// ObserverHttpPostOption(url,data) {
// return this.http.post(url, null,{
// params:data,
// headers: new Headers({
// // "Accept": "application/json",
// // "Content-Type": "application/json"
// 'Content-Type': 'application/x-www-form-urlencoded,charset=UTF-8'
// })
// });
//
// }
//
// ObserverHttpPostForm(url, params) {
// return this.http.post(url, null, { //本地
// params: params,
// headers: new Headers({
// // "Accept": "application/json",
// // "Content-Type": "application/json"
// 'Content-Type': 'application/x-www-form-urlencoded,charset=UTF-8'
// })
// })
// }
//
// //post请求
// ObserverHttpPost(url, params) {
// return this.http.post(url, null, { //本地
// params: this.encode(params, 'post'),
// headers: new Headers({
// // "Accept": "application/json",
// //"Content-Type": "application/json,charset=UTF-8"
// 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
// })
// })
// }
//
// //post请求
// ObserverHttpNoForm(url, params) {
// return this.http.post(url,null,{
// params:params,
// headers: new Headers({
// // "Accept": "application/json",
// // "Content-Type": "application/json"
// 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'
// })
// })
//
// }
//
// //post请求
// ObserverHttpForm(url, params,body) {
// return this.http.post(url + params,null,{
// params:body,
// headers: new Headers({
// // "Accept": "application/json",
// // "Content-Type": "application/json"
// 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'
// })
// })
//
// }
// // post请求 params+body
// ObserverHttpPostParamsBody(url, params, data) {
// return this.http.post( url + params, data, { //app
// headers: new Headers({
// "Content-Type": "application/json"
// })
// })
// }
//
// //put请求
// ObserverHttpPut(url, params, data) {
// return this.http.put(url + params, data, { //本地
// headers: new Headers({
// // "Accept": "application/json",
// "Content-Type": "application/json"
// // 'Content-Type':'application/x-www-form-urlencoded,charset=UTF-8'
// })
// })
// }
//
// private handleError(error: Response | any) {
// let msg = '';
// if (error.status == 400) {
// msg = '请求无效(code:404)';
// console.log('请检查参数类型是否匹配');
// }
// if (error.status == 404) {
// msg = '请求资源不存在(code:404)';
// console.error(msg + ',请检查路径是否正确');
// }
// if (error.status == 500) {
// msg = '服务器发生错误(code:500)';
// console.error(msg + ',请检查路径是否正确');
// }
// console.log(error);
// if (msg != '') {
// this.toast(msg);
// }
// }
//
// toast(message, callback?) {
// let toast = this.toastCtrl.create({
// message: message,
// duration: 2000,
// dismissOnPageChange: true,
// });
// toast.present();
// if (callback) {
// callback();
// }
// }
//
// //position:top, bottom and middle
// popToastView(message: string, position: string, duration: number) {
// this.toastCtrl.create({
// message: message,
// position: position,
// duration: duration,
// //showCloseButton:true,
// //closeButtonText:"关闭"
// }).present();
// }
//
// alert(message, callback?) {
// if (callback) {
// let alert = this.alertCtrl.create({
// title: '提示',
// message: message,
// buttons: ['取消', {
// text: "确定",
// handler: data => {
// callback();
// }
// }]
// });
// alert.present();
// } else {
// let alert = this.alertCtrl.create({
// title: '提示',
// message: message,
// buttons: ["确定"]
// });
// alert.present();
// }
// }
//
// }
//app请求方式
import
{
LoadingController
,
AlertController
,
ToastController
}
from
'ionic-angular'
;
import
{
LoadingController
,
AlertController
,
ToastController
}
from
'ionic-angular'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Http
,
Headers
}
from
'@angular/http'
;
import
{
Http
,
Headers
}
from
'@angular/http'
;
...
@@ -359,87 +73,85 @@ export class AppService {
...
@@ -359,87 +73,85 @@ export class AppService {
//get请求
//get请求
ObserverHttpGet
(
url
,
params
):
Observable
<
any
>
{
ObserverHttpGet
(
url
,
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
url
+
this
.
encode
(
params
,
"get"
))
//app
return
this
.
http
.
get
(
url
+
this
.
encode
(
params
,
"get"
))
//本地
}
}
//get请求
//get请求
ObserverHttpGetData
(
url
,
params
):
Observable
<
any
>
{
ObserverHttpGetData
(
url
,
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
url
,
params
)
//app
return
this
.
http
.
get
(
url
,
params
)
//本地
}
}
//get请求
//get请求
ObserverHttpGetAdd
(
url
,
params
):
Observable
<
any
>
{
ObserverHttpGetAdd
(
url
,
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
url
+
params
)
//app
return
this
.
http
.
get
(
url
+
params
)
//本地
}
}
//get请求带?的
//get请求带?的
ObserverHttpGetOption
(
url
,
params
):
Observable
<
any
>
{
ObserverHttpGetOption
(
url
,
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
url
,
{
params
:
params
});
//app
return
this
.
http
.
get
(
url
,
{
params
:
params
});
//本地
}
}
//delete
//delete
ObserverHttpDetelete
(
url
,
params
):
Observable
<
any
>
{
ObserverHttpDetelete
(
url
,
params
):
Observable
<
any
>
{
return
this
.
http
.
delete
(
AppGlobal
.
domain
+
url
+
this
.
encode
(
params
,
"get"
))
//app
return
this
.
http
.
delete
(
url
+
this
.
encode
(
params
,
"get"
))
//本地
}
}
//delete
//delete
ObserverHttpDeteleteOption
(
url
,
params
):
Observable
<
any
>
{
ObserverHttpDeteleteOption
(
url
,
params
):
Observable
<
any
>
{
return
this
.
http
.
delete
(
AppGlobal
.
domain
+
url
+
params
)
//app
return
this
.
http
.
delete
(
url
+
params
);
//本地
}
}
//delete
//delete
ObserverHttpDeteleteData
(
url
,
params
,
data
):
Observable
<
any
>
{
ObserverHttpDeteleteData
(
url
,
params
,
data
):
Observable
<
any
>
{
return
this
.
http
.
delete
(
AppGlobal
.
domain
+
url
+
params
,
{
//app
return
this
.
http
.
delete
(
url
+
params
,{
params
:
this
.
encode
(
data
,
'post'
),
params
:
this
.
encode
(
data
,
'post'
),
headers
:
new
Headers
({
headers
:
new
Headers
({
// "Accept": "application/json",
"Content-Type"
:
"application/json"
"Content-Type"
:
"application/json"
// 'Content-Type':'application/x-www-form-urlencoded,charset=UTF-8'
})
})
})
//本地
})
//本地
}
}
ObserverHttpPostData
(
url
,
params
)
{
ObserverHttpPostData
(
url
,
params
)
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
url
,
params
,
{
//app
return
this
.
http
.
post
(
url
,
params
,
{
//本地
headers
:
new
Headers
({
headers
:
new
Headers
({
// "Accept": "application/json",
"Content-Type"
:
"application/json"
"Content-Type"
:
"application/json"
// 'Content-Type':'application/x-www-form-urlencoded,charset=UTF-8'
})
})
})
})
}
}
ObserverHttpPostAdd
(
url
,
params
)
{
ObserverHttpPostAdd
(
url
,
params
)
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
url
+
params
,
{
//app
return
this
.
http
.
post
(
url
+
params
,
{
//本地
headers
:
new
Headers
({
headers
:
new
Headers
({
// "Accept": "application/json",
"Content-Type"
:
"application/json"
"Content-Type"
:
"application/json"
// 'Content-Type':'application/x-www-form-urlencoded,charset=UTF-8'
})
})
})
})
}
}
ObserverHttpPostOption
(
url
,
data
)
{
ObserverHttpPostOption
(
url
,
data
)
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
url
,
null
,
{
//app
return
this
.
http
.
post
(
url
,
null
,{
params
:
data
,
params
:
data
,
headers
:
new
Headers
({
'Content-Type'
:
'application/x-www-form-urlencoded,charset=UTF-8'
})
});
}
//post请求
ObserverHttpForm
(
url
,
params
,
body
)
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
url
+
params
,
null
,{
params
:
body
,
headers
:
new
Headers
({
headers
:
new
Headers
({
// "Accept": "application/json",
// "Accept": "application/json",
// "Content-Type": "application/json"
// "Content-Type": "application/json"
'Content-Type'
:
'application/x-www-form-urlencoded;
charset=UTF-8'
'Content-Type'
:
'application/x-www-form-urlencoded,
charset=UTF-8'
})
})
})
})
;
}
}
ObserverHttpPostForm
(
url
,
params
)
{
ObserverHttpPostForm
(
url
,
params
)
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
url
,
null
,
{
//app
return
this
.
http
.
post
(
url
,
null
,
{
//本地
params
:
params
,
params
:
params
,
headers
:
new
Headers
({
headers
:
new
Headers
({
// "Accept": "application/json",
// "Content-Type": "application/json"
'Content-Type'
:
'application/x-www-form-urlencoded,charset=UTF-8'
'Content-Type'
:
'application/x-www-form-urlencoded,charset=UTF-8'
})
})
})
})
...
@@ -447,9 +159,11 @@ export class AppService {
...
@@ -447,9 +159,11 @@ export class AppService {
//post请求
//post请求
ObserverHttpPost
(
url
,
params
)
{
ObserverHttpPost
(
url
,
params
)
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
url
,
null
,
{
//app
return
this
.
http
.
post
(
url
,
null
,
{
//本地
params
:
this
.
encode
(
params
,
'post'
),
params
:
this
.
encode
(
params
,
'post'
),
headers
:
new
Headers
({
headers
:
new
Headers
({
// "Accept": "application/json",
//"Content-Type": "application/json,charset=UTF-8"
'Content-Type'
:
'application/x-www-form-urlencoded;charset=UTF-8'
'Content-Type'
:
'application/x-www-form-urlencoded;charset=UTF-8'
})
})
})
})
...
@@ -457,18 +171,32 @@ export class AppService {
...
@@ -457,18 +171,32 @@ export class AppService {
//post请求
//post请求
ObserverHttpNoForm
(
url
,
params
)
{
ObserverHttpNoForm
(
url
,
params
)
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
url
,
null
,
{
//app
return
this
.
http
.
post
(
url
,
null
,{
params
:
params
,
params
:
params
,
headers
:
new
Headers
({
headers
:
new
Headers
({
'Content-Type'
:
'application/x-www-form-urlencoded;charset=UTF-8'
// "Accept": "application/json",
// "Content-Type": "application/json"
'Content-Type'
:
'application/x-www-form-urlencoded;charset=UTF-8'
})
})
})
})
}
}
//post请求 params+body
//post请求
ObserverHttpForm
(
url
,
params
,
body
)
{
return
this
.
http
.
post
(
url
+
params
,
null
,{
params
:
body
,
headers
:
new
Headers
({
// "Accept": "application/json",
// "Content-Type": "application/json"
'Content-Type'
:
'application/x-www-form-urlencoded;charset=UTF-8'
})
})
}
// post请求 params+body
ObserverHttpPostParamsBody
(
url
,
params
,
data
)
{
ObserverHttpPostParamsBody
(
url
,
params
,
data
)
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
url
+
params
,
data
,
{
//app
return
this
.
http
.
post
(
url
+
params
,
data
,
{
//app
headers
:
new
Headers
({
headers
:
new
Headers
({
"Content-Type"
:
"application/json"
"Content-Type"
:
"application/json"
})
})
...
@@ -477,9 +205,11 @@ export class AppService {
...
@@ -477,9 +205,11 @@ export class AppService {
//put请求
//put请求
ObserverHttpPut
(
url
,
params
,
data
)
{
ObserverHttpPut
(
url
,
params
,
data
)
{
return
this
.
http
.
put
(
AppGlobal
.
domain
+
url
+
params
,
data
,
{
//app
return
this
.
http
.
put
(
url
+
params
,
data
,
{
//本地
headers
:
new
Headers
({
headers
:
new
Headers
({
// "Accept": "application/json",
"Content-Type"
:
"application/json"
"Content-Type"
:
"application/json"
// 'Content-Type':'application/x-www-form-urlencoded,charset=UTF-8'
})
})
})
})
}
}
...
@@ -522,6 +252,8 @@ export class AppService {
...
@@ -522,6 +252,8 @@ export class AppService {
message
:
message
,
message
:
message
,
position
:
position
,
position
:
position
,
duration
:
duration
,
duration
:
duration
,
//showCloseButton:true,
//closeButtonText:"关闭"
}).
present
();
}).
present
();
}
}
...
@@ -551,6 +283,274 @@ export class AppService {
...
@@ -551,6 +283,274 @@ export class AppService {
}
}
// //app请求方式
//
// import {LoadingController, AlertController, ToastController} from 'ionic-angular';
// import {Injectable} from '@angular/core';
// import {Http, Headers} from '@angular/http';
// import {Observable} from "rxjs";
//
// @Injectable()
// export class AppGlobal {
// //缓存key的配置
// static cache: any = {
// slides: "_dress_slides",
// categories: "_dress_categories",
// products: "_dress_products"
// }
// //接口基地址 //测试环境
// // static domain = "http://220.248.107.115:2239";
// //正式环境
// // static domain = "http://180.153.158.250:3306";
// static domain = "http://180.168.156.212:2931";
// //static domain = "http://localhost:8080"
//
//
// //测试
// // static picture = "http://220.248.107.115:2239/wisdomgroup/manager/getIcon/";
// //正式
// // static picture = "http://180.153.158.250:3306/wisdomgroup/manager/getIcon/";
// static picture = "http://180.168.156.212:2931/wisdomgroup/manager/getIcon/";
//
// //通知公告图片参数
// static pictureNotice = "http://180.168.156.212:2931";
//
// //接口地址
// static API: any = {
// getCategories: '/api/ionic3/getCategories',
// getLogin: '/app/loginpost',
// getDetails: '/api/ionic3/details'
// };
// }
//
// @Injectable()
// export class AppService {
// constructor(public http: Http,
// public loadingCtrl: LoadingController,
// private alertCtrl: AlertController,
// private toastCtrl: ToastController,) {
// }
//
// // 对参数进行编码
// encode(params, flag) {
// var str = '';
// if (params) {
// if (flag == 'get') { //get /a/b
// for (var key in params) {
// if (params.hasOwnProperty(key)) {
// var value = params[key];
// str += value + '/';
// }
// }
// str = '/' + str.substring(0, str.length - 1);
// }
// if (flag == 'post') { //post a=b&c=d
// for (var key in params) {
// if (params.hasOwnProperty(key)) {
// var value = params[key];
// str += key + '=' + value + '&';
// }
// }
// str = str.substring(0, str.length - 1);
// }
// }
// return str;
// }
//
// //get请求
// ObserverHttpGet(url, params): Observable<any> {
// return this.http.get(AppGlobal.domain + url + this.encode(params, "get")) //app
// }
//
// //get请求
// ObserverHttpGetData(url, params): Observable<any> {
// return this.http.get(AppGlobal.domain + url, params) //app
// }
//
// //get请求
// ObserverHttpGetAdd(url, params): Observable<any> {
// return this.http.get(AppGlobal.domain + url + params) //app
// }
//
// //get请求带?的
// ObserverHttpGetOption(url, params): Observable<any> {
// return this.http.get(AppGlobal.domain + url, {params: params}); //app
// }
//
// //delete
// ObserverHttpDetelete(url, params): Observable<any> {
// return this.http.delete(AppGlobal.domain + url + this.encode(params, "get")) //app
// }
//
// //delete
// ObserverHttpDeteleteOption(url, params): Observable<any> {
// return this.http.delete(AppGlobal.domain + url + params) //app
// }
//
// //delete
// ObserverHttpDeteleteData(url, params, data): Observable<any> {
// return this.http.delete(AppGlobal.domain + url + params, { //app
// params: this.encode(data, 'post'),
// headers: new Headers({
// "Content-Type": "application/json"
// })
// }) //本地
// }
//
// ObserverHttpPostData(url, params) {
// return this.http.post(AppGlobal.domain + url, params, { //app
// headers: new Headers({
// "Content-Type": "application/json"
// })
// })
// }
//
// ObserverHttpPostAdd(url, params) {
// return this.http.post(AppGlobal.domain + url + params, { //app
// headers: new Headers({
// "Content-Type": "application/json"
// })
// })
// }
//
// ObserverHttpPostOption(url, data) {
// return this.http.post(AppGlobal.domain + url, null, { //app
// params: data,
// headers: new Headers({
// 'Content-Type': 'application/x-www-form-urlencoded,charset=UTF-8'
// })
// });
//
// }
//
// //post请求
// ObserverHttpForm(url, params,body) {
// return this.http.post(AppGlobal.domain+url + params,null,{
// params:body,
// headers: new Headers({
// // "Accept": "application/json",
// // "Content-Type": "application/json"
// 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'
// })
// })
//
// }
//
// ObserverHttpPostForm(url, params) {
// return this.http.post(AppGlobal.domain + url, null, { //app
// params: params,
// headers: new Headers({
// 'Content-Type': 'application/x-www-form-urlencoded,charset=UTF-8'
// })
// })
// }
//
// //post请求
// ObserverHttpPost(url, params) {
// return this.http.post(AppGlobal.domain + url, null, { //app
// params: this.encode(params, 'post'),
// headers: new Headers({
// 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
// })
// })
// }
//
// //post请求
// ObserverHttpNoForm(url, params) {
// return this.http.post(AppGlobal.domain + url, null, { //app
// params: params,
// headers: new Headers({
// 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
// })
// })
//
// }
//
// //post请求 params+body
// ObserverHttpPostParamsBody(url, params, data) {
// return this.http.post(AppGlobal.domain + url + params, data, { //app
// headers: new Headers({
// "Content-Type": "application/json"
// })
// })
// }
//
// //put请求
// ObserverHttpPut(url, params, data) {
// return this.http.put(AppGlobal.domain + url + params, data, { //app
// headers: new Headers({
// "Content-Type": "application/json"
// })
// })
// }
//
// private handleError(error: Response | any) {
// let msg = '';
// if (error.status == 400) {
// msg = '请求无效(code:404)';
// console.log('请检查参数类型是否匹配');
// }
// if (error.status == 404) {
// msg = '请求资源不存在(code:404)';
// console.error(msg + ',请检查路径是否正确');
// }
// if (error.status == 500) {
// msg = '服务器发生错误(code:500)';
// console.error(msg + ',请检查路径是否正确');
// }
// console.log(error);
// if (msg != '') {
// this.toast(msg);
// }
// }
//
// toast(message, callback?) {
// let toast = this.toastCtrl.create({
// message: message,
// duration: 2000,
// dismissOnPageChange: true,
// });
// toast.present();
// if (callback) {
// callback();
// }
// }
//
// //position:top, bottom and middle
// popToastView(message: string, position: string, duration: number) {
// this.toastCtrl.create({
// message: message,
// position: position,
// duration: duration,
// }).present();
// }
//
// alert(message, callback?) {
// if (callback) {
// let alert = this.alertCtrl.create({
// title: '提示',
// message: message,
// buttons: ['取消', {
// text: "确定",
// handler: data => {
// callback();
// }
// }]
// });
// alert.present();
// } else {
// let alert = this.alertCtrl.create({
// title: '提示',
// message: message,
// buttons: ["确定"]
// });
// alert.present();
// }
// }
//
// }
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