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
570b3483
Commit
570b3483
authored
Oct 12, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
7ea1e6b0
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
412 additions
and
379 deletions
+412
-379
config.xml
config.xml
+1
-1
ionic.config.json
ionic.config.json
+0
-5
app.component.ts
src/app/app.component.ts
+6
-0
order-edit.scss
src/pages/activity/order-edit/order-edit.scss
+0
-0
announcement.scss
src/pages/announcement/announcement.scss
+21
-17
announcement.ts
src/pages/announcement/announcement.ts
+17
-13
announcementView.scss
src/pages/announcementView/announcementView.scss
+3
-0
more-app.html
src/pages/home/more-app/more-app.html
+2
-0
login.html
src/pages/login/login.html
+1
-1
login.ts
src/pages/login/login.ts
+4
-1
myActivityList.html
src/pages/mine/myActivityList/myActivityList.html
+13
-13
myActivityList.scss
src/pages/mine/myActivityList/myActivityList.scss
+3
-1
myReport.html
src/pages/mine/myReport/myReport.html
+2
-2
myReport.scss
src/pages/mine/myReport/myReport.scss
+3
-0
outGoingReportDetail.html
...ges/report/outGoingReportDetail/outGoingReportDetail.html
+2
-1
outGoingReportDetail.scss
...ges/report/outGoingReportDetail/outGoingReportDetail.scss
+5
-0
outGoingReportEdit.html
src/pages/report/outGoingReportEdit/outGoingReportEdit.html
+2
-2
outGoingReportEdit.scss
src/pages/report/outGoingReportEdit/outGoingReportEdit.scss
+5
-0
appHttpService.ts
src/service/appHttpService.ts
+322
-322
No files found.
config.xml
View file @
570b3483
<?xml version='1.0' encoding='utf-8'?>
<widget
id=
"io.ionic.starter"
version=
"1.1.
5
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<widget
id=
"io.ionic.starter"
version=
"1.1.
6
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<name>
智汇19号
</name>
<description>
An awesome Ionic/Cordova app.
</description>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
...
...
ionic.config.json
View file @
570b3483
...
...
@@ -5,9 +5,5 @@
},
"type"
:
"ionic-angular"
,
"proxies"
:
[
{
"path"
:
"/wisdomgroup"
,
"proxyUrl"
:
"http://180.168.156.212:2931/wisdomgroup"
}
]
}
\ No newline at end of file
src/app/app.component.ts
View file @
570b3483
...
...
@@ -66,7 +66,9 @@ export class MyApp {
loadLogin
()
{
this
.
storage
.
get
(
"userLoginInfo"
).
then
((
value
)
=>
{
if
(
value
!=
null
&&
value
!=
''
)
{
console
.
log
(
value
);
this
.
user
=
value
;
if
(
this
.
user
.
remember
){
this
.
appService
.
ObserverHttpPost
(
"/wisdomgroup/app/loginpost"
,
this
.
user
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
...
...
@@ -87,6 +89,10 @@ export class MyApp {
this
.
appService
.
alert
(
'网络异常!'
);
}
);
}
else
{
this
.
rootPage
=
LoginPage
;
}
}
else
{
this
.
rootPage
=
LoginPage
;
...
...
src/pages/activity/order-edit/order-edit.scss
View file @
570b3483
src/pages/announcement/announcement.scss
View file @
570b3483
page-announcement
{
.searchToolBar
{
td
,
th
{
border
:
1px
solid
#dddddd
;
}
.searchToolBar
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
...
...
@@ -8,10 +10,10 @@ page-announcement {
box-sizing
:
border-box
;
}
.list-ios
.item-block
.item-inner
{
.list-ios
.item-block
.item-inner
{
border
:
none
;
}
.item-header
{
.item-header
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
...
...
@@ -19,7 +21,7 @@ page-announcement {
box-sizing
:
border-box
;
}
.item-header-style
{
.item-header-style
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
...
...
@@ -27,17 +29,17 @@ page-announcement {
box-sizing
:
border-box
;
}
.item-title
{
.item-title
{
font-size
:
18px
;
}
.icon
{
.icon
{
width
:
20px
;
height
:
20px
;
margin-right
:
5px
;
}
.btn
{
.btn
{
// float: right;
background-color
:
white
;
...
...
@@ -45,13 +47,13 @@ page-announcement {
font-size
:
6px
;
}
.btn1
{
.btn1
{
border
:
1px
solid
#69c4e2
;
color
:
#69c4e2
;
border-radius
:
5px
;
}
.btn2
{
.btn2
{
border-radius
:
5px
;
border
:
1px
solid
#90da91
;
color
:
#90da91
;
...
...
@@ -73,7 +75,7 @@ page-announcement {
// margin-left: 20px;
// }
.content-box
{
.content-box
{
margin-left
:
25px
;
margin-top
:
15px
;
margin-bottom
:
15px
;
...
...
@@ -81,7 +83,7 @@ page-announcement {
border-bottom
:
1px
solid
#f1f2f3
;
}
.content-item-box
{
.content-item-box
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
flex-start
;
...
...
@@ -89,25 +91,27 @@ page-announcement {
box-sizing
:
border-box
;
}
.left-title
{
.left-title
{
color
:
#8b8c8d
;
font-size
:
14px
;
}
.data
{
.data
{
color
:
#666666
;
font-size
:
14px
;
}
.data-1
{
.data-1
{
display
:
-
webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
2
;
//文本行数
overflow
:
hidden
;
white-space
:
normal
;
text-overflow
:
ellipsis
;
-webkit-box-orient
:
vertical
;
}
.sign-up
{
.sign-up
{
background-color
:
#fff
;
height
:
25px
;
width
:
50px
;
...
...
@@ -117,7 +121,7 @@ page-announcement {
border
:
1px
solid
#ec4553
;
}
.back-btn
{
.back-btn
{
width
:
30px
;
height
:
30px
;
}
...
...
src/pages/announcement/announcement.ts
View file @
570b3483
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
Response
}
from
'@angular/http'
;
import
{
AppService
}
from
'../../service/appHttpService'
;
import
{
AnnouncementViewPage
}
from
'../announcementView/announcementView'
;
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
Response
}
from
'@angular/http'
;
import
{
AppGlobal
,
AppService
}
from
'../../service/appHttpService'
;
import
{
AnnouncementViewPage
}
from
'../announcementView/announcementView'
;
@
IonicPage
()
@
Component
({
selector
:
'page-announcement'
,
...
...
@@ -13,11 +14,9 @@ export class AnnouncementPage {
allNotice
=
[];
constructor
(
public
navCtrl
:
NavController
,
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
public
appService
:
AppService
)
{
}
...
...
@@ -41,8 +40,13 @@ export class AnnouncementPage {
this
.
appService
.
ObserverHttpPost
(
"/wisdomgroup/modules/notice/getAllNotice"
,
null
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
console
.
log
(
data
);
data
.
forEach
(
event
=>
{
let
src
=
event
.
noticeContent
.
split
(
'src="'
);
event
.
noticeContent
=
src
.
join
(
'src="'
+
AppGlobal
.
pictureNotice
);
});
this
.
allNotice
=
data
;
},
error
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
}
...
...
@@ -51,7 +55,7 @@ export class AnnouncementPage {
//如果是未读状态,增加阅读记录
createRecording
(
id
)
{
this
.
appService
.
ObserverHttpPost
(
"/wisdomgroup/modules/notice/createRecording"
,
{
id
:
id
})
this
.
appService
.
ObserverHttpPost
(
"/wisdomgroup/modules/notice/createRecording"
,
{
id
:
id
})
.
subscribe
((
res
:
Response
)
=>
{
},
error
=>
{
...
...
@@ -60,12 +64,12 @@ export class AnnouncementPage {
);
}
goBack
()
{
goBack
()
{
this
.
navCtrl
.
popToRoot
();
}
//增加阅读记录
addRecodings
()
{
addRecodings
()
{
this
.
appService
.
ObserverHttpGet
(
"/wisdomgroup/modules/notice/addRecodings"
,
null
)
.
subscribe
((
res
:
Response
)
=>
{
...
...
src/pages/announcementView/announcementView.scss
View file @
570b3483
page-announcementView
{
td
,
th
{
border
:
1px
solid
#dddddd
;
}
.searchToolBar
{
display
:
flex
;
flex-direction
:
row
;
...
...
src/pages/home/more-app/more-app.html
View file @
570b3483
...
...
@@ -44,6 +44,8 @@
<img
src=
"./assets/imgs/home/icon-wjgl.png"
alt=
""
>
<label
class=
"label2-2 more2-2"
>
问卷管理
</label>
</div>
</ng-container>
<ng-container
*
ngIf=
"role == 3 || role == 4"
>
<div
class=
"card"
(
click
)="
replayManage
()"
>
<img
src=
"./assets/imgs/home/icon-zbhb.png"
alt=
""
>
<label
class=
"label2-2 more2-2"
>
值班换班
</label>
...
...
src/pages/login/login.html
View file @
570b3483
...
...
@@ -27,7 +27,7 @@
<!-- <button class="login-bt" ion-button (click)="login()" [disabled]="!loginForm.valid || submitted" type="submit" block>登 录</button> -->
<div
class=
"mui-input-row mui-checkbox mui-left"
style=
"margin-bottom: 15px;"
>
<input
name=
"checkbox"
class=
"jizhu-password"
value=
"1"
type=
"checkbox"
checked=
"true"
style=
"margin-left:10px;width:17px;height:17px;vertical-align:middle"
>
<input
[(
ngModel
)]="
user
.
remember
"
name=
"checkbox"
class=
"jizhu-password"
value=
"1"
type=
"checkbox"
checked=
"true"
style=
"margin-left:10px;width:17px;height:17px;vertical-align:middle"
>
<label
style=
"padding-left:5px;font-family:'微软雅黑';"
class=
"jizhu-password-label"
>
记住密码
</label>
</div>
...
...
src/pages/login/login.ts
View file @
570b3483
...
...
@@ -21,7 +21,8 @@ export class LoginPage {
user
=
{
userid
:
''
,
//登录数据
mobile
:
''
,
password
:
''
password
:
''
,
remember
:
true
};
tabflag
:
any
;
constructor
(
public
navCtrl
:
NavController
,
...
...
@@ -44,8 +45,10 @@ export class LoginPage {
//默认显示
this
.
storage
.
get
(
"userLoginInfo"
).
then
((
value
)
=>
{
if
(
value
!=
null
&&
value
!=
''
){
if
(
value
.
remember
){
this
.
user
=
value
;
}
}
});
}
...
...
src/pages/mine/myActivityList/myActivityList.html
View file @
570b3483
...
...
@@ -29,10 +29,10 @@
<span
class=
"item-title"
>
{{item.activity.activityName}}
</span>
</div>
<button
style=
"border-radius: 4px"
ion-button
round
class=
"btn color1"
*
ngIf=
"item.orderstate == '1'"
>
待进行
</button>
<button
style=
"border-radius: 4px"
ion-button
round
class=
"btn color2"
*
ngIf=
"item.orderstate == '2'"
>
待确认
</button>
<button
style=
"border-radius: 4px"
ion-button
round
class=
"btn color3"
*
ngIf=
"item.orderstate == '3'"
>
报名未出行
</button>
<button
style=
"border-radius: 4px"
ion-button
round
class=
"btn color3"
*
ngIf=
"item.orderstate == '4'"
>
已完成
</button>
<button
disabled
style=
"border-radius: 4px"
ion-button
round
class=
"btn color1"
*
ngIf=
"item.orderstate == '1'"
>
待进行
</button>
<button
disabled
style=
"border-radius: 4px"
ion-button
round
class=
"btn color2"
*
ngIf=
"item.orderstate == '2'"
>
待确认
</button>
<button
disabled
style=
"border-radius: 4px"
ion-button
round
class=
"btn color3"
*
ngIf=
"item.orderstate == '3'"
>
报名未出行
</button>
<button
disabled
style=
"border-radius: 4px"
ion-button
round
class=
"btn color3"
*
ngIf=
"item.orderstate == '4'"
>
已完成
</button>
</div>
<div
class=
"content-box"
>
...
...
@@ -60,14 +60,14 @@
</div>
</div>
<div
class=
"right"
>
<button
class=
"cancel"
*
ngIf=
"item.orderstate == 1 && !item.showParticipantBtn"
(
click
)="
sureCancelOrder
(
item
.
orderid
);$
event
.
stopPropagation
();"
>
取消订单
</button>
<button
class=
"reselection"
*
ngIf=
"item.orderstate == 1 && !item.showParticipantBtn"
(
click
)="
reelectBatch
(
item
);$
event
.
stopPropagation
();"
>
修改订单
</button>
<button
class=
"cancel"
*
ngIf=
"item.orderstate == 1 && item.showParticipantBtn"
(
click
)="
joinPeople
(
item
);$
event
.
stopPropagation
();"
>
参与人员
</button>
<button
disabled
class=
"cancel"
*
ngIf=
"item.orderstate == 1 && !item.showParticipantBtn"
(
click
)="
sureCancelOrder
(
item
.
orderid
);$
event
.
stopPropagation
();"
>
取消订单
</button>
<button
disabled
class=
"reselection"
*
ngIf=
"item.orderstate == 1 && !item.showParticipantBtn"
(
click
)="
reelectBatch
(
item
);$
event
.
stopPropagation
();"
>
修改订单
</button>
<button
disabled
class=
"cancel"
*
ngIf=
"item.orderstate == 1 && item.showParticipantBtn"
(
click
)="
joinPeople
(
item
);$
event
.
stopPropagation
();"
>
参与人员
</button>
<button
class=
"cancel"
*
ngIf=
"item.orderstate == 2"
(
click
)="
joinPeople
(
item
);$
event
.
stopPropagation
();"
>
参与人员
</button>
<button
class=
"reselection"
*
ngIf=
"item.orderstate == 2"
(
click
)="
evaluation
(
item
);$
event
.
stopPropagation
();"
>
确认评价
</button>
<button
disabled
class=
"cancel"
*
ngIf=
"item.orderstate == 2"
(
click
)="
joinPeople
(
item
);$
event
.
stopPropagation
();"
>
参与人员
</button>
<button
disabled
class=
"reselection"
*
ngIf=
"item.orderstate == 2"
(
click
)="
evaluation
(
item
);$
event
.
stopPropagation
();"
>
确认评价
</button>
<button
class=
"reselection"
*
ngIf=
"item.orderstate == 3||item.orderstate == 4"
>
查看详情
</button>
<button
disabled
class=
"reselection"
*
ngIf=
"item.orderstate == 3||item.orderstate == 4"
>
查看详情
</button>
</div>
</div>
</ion-item>
...
...
@@ -115,9 +115,9 @@
</div>
<div
class=
"right"
>
<button
class=
"cancel"
*
ngIf=
"item.orderstate == 1 && !item.showParticipantBtn"
(
click
)="
sureCancelOrder
(
item
.
orderid
);$
event
.
stopPropagation
();"
>
取消报名
</button>
<button
class=
"reselection"
*
ngIf=
"item.orderstate == 1 && !item.showParticipantBtn"
(
click
)="
reelectBatch
(
item
);$
event
.
stopPropagation
();"
>
重选批次
</button>
<button
class=
"cancel"
*
ngIf=
"item.orderstate == 1 && item.showParticipantBtn"
(
click
)="
joinPeople
(
item
);$
event
.
stopPropagation
();"
>
参与人员
</button>
<button
disabled
class=
"cancel"
*
ngIf=
"item.orderstate == 1 && !item.showParticipantBtn"
(
click
)="
sureCancelOrder
(
item
.
orderid
);$
event
.
stopPropagation
();"
>
取消报名
</button>
<button
disabled
class=
"reselection"
*
ngIf=
"item.orderstate == 1 && !item.showParticipantBtn"
(
click
)="
reelectBatch
(
item
);$
event
.
stopPropagation
();"
>
重选批次
</button>
<button
disabled
class=
"cancel"
*
ngIf=
"item.orderstate == 1 && item.showParticipantBtn"
(
click
)="
joinPeople
(
item
);$
event
.
stopPropagation
();"
>
参与人员
</button>
</div>
</div>
...
...
src/pages/mine/myActivityList/myActivityList.scss
View file @
570b3483
page-myActivityList
{
button
[
disabled
]
{
opacity
:
1
;
}
.searchToolBar
{
display
:
flex
;
...
...
src/pages/mine/myReport/myReport.html
View file @
570b3483
...
...
@@ -16,11 +16,11 @@
<span
class=
"item-title"
>
{{report.title}}
</span>
</div>
<ng-container
*
ngIf=
"!report.isOverTimeFlag"
>
<button
ion-button
round
class=
"btn color1"
>
已报备
<button
disabled
ion-button
round
class=
"btn color1"
>
已报备
</button>
</ng-container>
<ng-container
*
ngIf=
"report.isOverTimeFlag"
>
<button
ion-button
round
class=
"btn color3"
>
已结束
<button
disabled
ion-button
round
class=
"btn color3"
>
已结束
</button>
</ng-container>
</div>
...
...
src/pages/mine/myReport/myReport.scss
View file @
570b3483
page-myReport
{
button
[
disabled
]
{
opacity
:
1
;
}
.searchToolBar
{
display
:
flex
;
flex-direction
:
row
;
...
...
src/pages/report/outGoingReportDetail/outGoingReportDetail.html
View file @
570b3483
...
...
@@ -56,5 +56,5 @@
<ion-textarea
placeholder=
"请输入"
[(
ngModel
)]="
temp_userpre
.
managerDesc
"
></ion-textarea>
</ion-item>
</ion-list>
<button
ion-button
block
class=
"save
"
(
click
)="
saveFieldValue
()"
>
保存
</button>
<button
class=
"submit-btn submit
"
(
click
)="
saveFieldValue
()"
>
保存
</button>
</ion-content>
\ No newline at end of file
src/pages/report/outGoingReportDetail/outGoingReportDetail.scss
View file @
570b3483
page-outGoingReportDetail
{
.submit
{
margin-top
:
20px
;
border
:
1px
solid
#34b4fc
;
background-color
:
#34b4fc
;
}
.searchToolBar
{
display
:
flex
;
flex-direction
:
row
;
...
...
src/pages/report/outGoingReportEdit/outGoingReportEdit.html
View file @
570b3483
...
...
@@ -67,8 +67,8 @@
</ion-item>
</ion-list>
<button
ion-button
block
class=
"report-btn"
(
click
)="
savePremanager
()"
*
ngIf=
"!premanager.reported
"
>
提交报备
</button>
<button
ion-button
block
class=
"report-btn"
(
click
)="
editPremanager
()"
*
ngIf=
"premanager.reported
"
>
修改报备
</button>
<button
class=
"submit-btn submit"
*
ngIf=
"!premanager.reported"
(
click
)="
savePremanager
()
"
>
提交报备
</button>
<button
class=
"submit-btn submit"
*
ngIf=
"premanager.reported"
(
click
)="
editPremanager
()
"
>
修改报备
</button>
</ion-content>
...
...
src/pages/report/outGoingReportEdit/outGoingReportEdit.scss
View file @
570b3483
page-outGoingReportEdit
{
.submit
{
margin-top
:
20px
;
border
:
1px
solid
#34b4fc
;
background-color
:
#34b4fc
;
}
.searchToolBar
{
display
:
flex
;
flex-direction
:
row
;
...
...
src/service/appHttpService.ts
View file @
570b3483
//本地请求方式
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 {Injectable} from '@angular/core';
// import {Http, Headers} from '@angular/http';
...
...
@@ -359,87 +73,85 @@ export class AppService {
//
// //get请求
// 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请求
// ObserverHttpGetData(url, params): Observable<any> {
// return this.http.get(
AppGlobal.domain + url, params) //app
// return this.http.get(
url, params) //本地
// }
//
// //get请求
// ObserverHttpGetAdd(url, params): Observable<any> {
// return this.http.get(
AppGlobal.domain + url + params) //app
// return this.http.get(
url+ params) //本地
// }
//
// //get请求带?的
// ObserverHttpGetOption(url, params): Observable<any> {
// return this.http.get(
AppGlobal.domain + url, {params: params}); //app
// return this.http.get(
url, {params: params}); //本地
// }
//
// //delete
// 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
// ObserverHttpDeteleteOption(url, params): Observable<any> {
// return this.http.delete(
AppGlobal.domain + url + params) //app
// return this.http.delete(
url + params); //本地
// }
//
// //delete
// ObserverHttpDeteleteData(url, params,
data): Observable<any> {
// return this.http.delete(
AppGlobal.domain + url + params, { //app
// params:
this.encode(data,
'post'),
// 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(
AppGlobal.domain + url, params, { //app
// 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(
AppGlobal.domain + url + params, { //app
// 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(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,
// 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'
// })
// 'Content-Type': 'application/x-www-form-urlencoded,charset=UTF-8'
// })
// });
//
// }
//
// ObserverHttpPostForm(url, params) {
// return this.http.post(
AppGlobal.domain + url, null, { //app
// 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'
// })
// })
...
...
@@ -447,9 +159,11 @@ export class AppService {
//
// //post请求
// ObserverHttpPost(url, params) {
// return this.http.post(
AppGlobal.domain + url, null, { //app
// 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'
// })
// })
...
...
@@ -457,18 +171,32 @@ export class AppService {
//
// //post请求
// ObserverHttpNoForm(url, params) {
// return this.http.post(
AppGlobal.domain + url, null, { //app
// params:
params,
// return this.http.post(
url,null,{
// params:params,
// 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) {
// return this.http.post(
AppGlobal.domain +
url + params, data, { //app
// return this.http.post( url + params, data, { //app
// headers: new Headers({
// "Content-Type": "application/json"
// })
...
...
@@ -477,9 +205,11 @@ export class AppService {
//
// //put请求
// ObserverHttpPut(url, params, data) {
// return this.http.put(
AppGlobal.domain + url + params, data, { //app
// 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'
// })
// })
// }
...
...
@@ -522,6 +252,8 @@ export class AppService {
// message: message,
// position: position,
// duration: duration,
// //showCloseButton:true,
// //closeButtonText:"关闭"
// }).present();
// }
//
...
...
@@ -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