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
72847151
Commit
72847151
authored
Apr 10, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加已读和角标
parent
660470a3
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
135 additions
and
79 deletions
+135
-79
config.xml
config.xml
+1
-1
app.scss
src/app/app.scss
+3
-0
activityList.ts
src/pages/home/activity/activityList/activityList.ts
+9
-8
learn.service.ts
src/pages/home/learning/learn.service.ts
+3
-0
learning-list.ts
src/pages/home/learning/learning-list/learning-list.ts
+14
-2
home.html
src/pages/tabs/home/home.html
+5
-5
home.ts
src/pages/tabs/home/home.ts
+37
-55
tabs.service.ts
src/pages/tabs/tabs.service.ts
+41
-1
appHttpService.ts
src/service/appHttpService.ts
+6
-6
common.service.ts
src/service/common.service.ts
+15
-1
emit.service.ts
src/service/emit.service.ts
+1
-0
No files found.
config.xml
View file @
72847151
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<widget
id=
"io.ionic.smart19.starter"
version=
"4.0.
0
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<widget
id=
"io.ionic.smart19.starter"
version=
"4.0.
1
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<name>
智汇19号
</name>
<name>
智汇19号
</name>
<description>
An awesome Ionic/Cordova app.
</description>
<description>
An awesome Ionic/Cordova app.
</description>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
...
...
src/app/app.scss
View file @
72847151
...
@@ -6,6 +6,9 @@ p {
...
@@ -6,6 +6,9 @@ p {
.back-button.show-back-button
{
.back-button.show-back-button
{
margin-left
:
5px
;
margin-left
:
5px
;
}
}
.scroll-content
{
padding-bottom
:
0
!
important
;
}
//列表
//列表
.item-ios
{
.item-ios
{
...
...
src/pages/home/activity/activityList/activityList.ts
View file @
72847151
...
@@ -6,6 +6,8 @@ import { ActivityApplyPage } from '../activityApply/activityApply'
...
@@ -6,6 +6,8 @@ import { ActivityApplyPage } from '../activityApply/activityApply'
import
{
ActivityConfirmPage
}
from
'../activityConfirm/activityConfirm'
;
import
{
ActivityConfirmPage
}
from
'../activityConfirm/activityConfirm'
;
import
{
ActivityDetailPage
}
from
"../activityDetail/activityDetail"
;
import
{
ActivityDetailPage
}
from
"../activityDetail/activityDetail"
;
import
{
AppService
}
from
"../../../../service/appHttpService"
;
import
{
AppService
}
from
"../../../../service/appHttpService"
;
import
{
TabsService
}
from
"../../../tabs/tabs.service"
;
import
{
CommonService
}
from
"../../../../service/common.service"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
...
@@ -21,8 +23,8 @@ export class ActivityListPage {
...
@@ -21,8 +23,8 @@ export class ActivityListPage {
activityFbObject
:
Array
<
String
>
=
[
'未知'
,
'全体人员'
,
'用户组'
,
'处事部门'
];
activityFbObject
:
Array
<
String
>
=
[
'未知'
,
'全体人员'
,
'用户组'
,
'处事部门'
];
constructor
(
public
navCtrl
:
NavController
,
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
navParams
:
NavParams
,
public
alertCtrl
:
AlertController
,
public
alertCtrl
:
AlertController
,
public
commonSer
:
CommonService
,
public
http
:
Http
,
public
http
:
Http
,
public
tabSer
:
TabsService
,
public
appService
:
AppService
)
{
public
appService
:
AppService
)
{
}
}
...
@@ -66,12 +68,11 @@ export class ActivityListPage {
...
@@ -66,12 +68,11 @@ export class ActivityListPage {
//增加阅读记录
//增加阅读记录
addRecodings
(){
addRecodings
(){
this
.
appService
.
ObserverHttpGet
(
"/wisdomgroup/modules/activity/addRecodings"
,
null
)
this
.
tabSer
.
activityAddRecodings
().
subscribe
(
.
subscribe
((
res
:
Response
)
=>
{
(
res
)
=>
{
this
.
commonSer
.
log
(
"活动:增加阅读记录成功"
)
},
error
=>
{
}
}
)
);
}
}
}
}
src/pages/home/learning/learn.service.ts
View file @
72847151
...
@@ -33,4 +33,6 @@ export class LearnService{
...
@@ -33,4 +33,6 @@ export class LearnService{
viewAnswerDetail
(
data
):
Observable
<
any
>
{
viewAnswerDetail
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/learnTest/viewAnswerDetail'
,
this
.
commonSer
.
toFormData
(
data
));
return
this
.
http
.
post
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/learnTest/viewAnswerDetail'
,
this
.
commonSer
.
toFormData
(
data
));
}
}
//
}
}
\ No newline at end of file
src/pages/home/learning/learning-list/learning-list.ts
View file @
72847151
...
@@ -4,6 +4,8 @@ import {LearningExplainPage} from "../learning-explain/learning-explain";
...
@@ -4,6 +4,8 @@ import {LearningExplainPage} from "../learning-explain/learning-explain";
import
{
LearnService
}
from
"../learn.service"
;
import
{
LearnService
}
from
"../learn.service"
;
import
{
DatePipe
}
from
"@angular/common"
;
import
{
DatePipe
}
from
"@angular/common"
;
import
{
LearningResultPage
}
from
"../learning-result/learning-result"
;
import
{
LearningResultPage
}
from
"../learning-result/learning-result"
;
import
{
TabsService
}
from
"../../../tabs/tabs.service"
;
import
{
CommonService
}
from
"../../../../service/common.service"
;
@
IonicPage
()
@
IonicPage
()
...
@@ -24,20 +26,30 @@ export class LearningListPage {
...
@@ -24,20 +26,30 @@ export class LearningListPage {
pageNumber
=
1
;
//页码
pageNumber
=
1
;
//页码
pageSize
=
25
;
//每页显示条数
pageSize
=
25
;
//每页显示条数
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
tabSer
:
TabsService
,
public
learnSer
:
LearnService
,
public
datePipe
:
DatePipe
)
{
public
learnSer
:
LearnService
,
public
datePipe
:
DatePipe
,
public
commonSer
:
CommonService
)
{
}
}
ionViewDidLoad
(){
ionViewDidLoad
(){
let
itemWidth
=
window
.
screen
.
width
/
3
;
let
itemWidth
=
window
.
screen
.
width
/
3
;
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
/
2
-
this
.
tips
.
nativeElement
.
offsetWidth
/
2
+
'px'
;
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
/
2
-
this
.
tips
.
nativeElement
.
offsetWidth
/
2
+
'px'
;
this
.
readRecoding
();
}
}
ionViewDidEnter
()
{
ionViewDidEnter
()
{
this
.
getList
();
this
.
getList
();
}
}
//测试问卷的阅读激励
readRecoding
(){
this
.
tabSer
.
testAddRecodings
().
subscribe
(
(
res
)
=>
{
this
.
commonSer
.
log
(
"测试列表:增加阅读记录成功!"
)
}
)
}
getList
()
{
getList
()
{
const
nowDate
=
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy/MM/dd HH:mm:ss'
)
const
nowDate
=
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy/MM/dd HH:mm:ss'
)
const
data
=
{
const
data
=
{
...
...
src/pages/tabs/home/home.html
View file @
72847151
...
@@ -18,17 +18,17 @@
...
@@ -18,17 +18,17 @@
<div
class=
"card"
(
click
)="
goTo
('
ActivityListPage
')"
>
<div
class=
"card"
(
click
)="
goTo
('
ActivityListPage
')"
>
<img
src=
"./assets/imgs/home/icon-bm.png"
alt=
""
>
<img
src=
"./assets/imgs/home/icon-bm.png"
alt=
""
>
<label
class=
"label2-2"
>
活动报名
</label>
<label
class=
"label2-2"
>
活动报名
</label>
<img
class=
"new-logo"
*
ngIf=
"hasNew
A
ctivity==1"
src=
"./assets/imgs/new.png"
>
<img
class=
"new-logo"
*
ngIf=
"hasNew
.a
ctivity==1"
src=
"./assets/imgs/new.png"
>
</div>
</div>
<div
class=
"card"
(
click
)="
goTo
('
AnnouncementPage
')"
>
<div
class=
"card"
(
click
)="
goTo
('
AnnouncementPage
')"
>
<img
src=
"./assets/imgs/home/icon-tz.png"
alt=
""
>
<img
src=
"./assets/imgs/home/icon-tz.png"
alt=
""
>
<label
class=
"label2-2"
>
通知公告
</label>
<label
class=
"label2-2"
>
通知公告
</label>
<img
class=
"new-logo"
*
ngIf=
"hasNew
N
otice==1"
src=
"./assets/imgs/new.png"
>
<img
class=
"new-logo"
*
ngIf=
"hasNew
.n
otice==1"
src=
"./assets/imgs/new.png"
>
</div>
</div>
<div
class=
"card"
(
click
)="
goOutGoingReportAboutAll
()"
>
<div
class=
"card"
(
click
)="
goOutGoingReportAboutAll
()"
>
<img
src=
"./assets/imgs/home/icon-lhbb.png"
alt=
""
>
<img
src=
"./assets/imgs/home/icon-lhbb.png"
alt=
""
>
<label
class=
"label2-2"
>
离沪报备
</label>
<label
class=
"label2-2"
>
离沪报备
</label>
<img
class=
"new-logo"
*
ngIf=
"hasNew
P
remanager==1"
src=
"./assets/imgs/new.png"
>
<img
class=
"new-logo"
*
ngIf=
"hasNew
.p
remanager==1"
src=
"./assets/imgs/new.png"
>
</div>
</div>
<div
class=
"card"
(
click
)="
goTo
('
DutyPage
')"
>
<div
class=
"card"
(
click
)="
goTo
('
DutyPage
')"
>
<img
src=
"./assets/imgs/home/icon-zb.png"
alt=
""
>
<img
src=
"./assets/imgs/home/icon-zb.png"
alt=
""
>
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<div
class=
"card"
(
click
)="
goTo
('
LearningListPage
')"
>
<div
class=
"card"
(
click
)="
goTo
('
LearningListPage
')"
>
<img
src=
"./assets/imgs/home/icon-xxcs.png"
alt=
""
>
<img
src=
"./assets/imgs/home/icon-xxcs.png"
alt=
""
>
<label
class=
"label2-2 more2-2"
>
学习测试
</label>
<label
class=
"label2-2 more2-2"
>
学习测试
</label>
<img
class=
"new-logo"
*
ngIf=
"hasNew
T
est==1"
src=
"./assets/imgs/new.png"
>
<img
class=
"new-logo"
*
ngIf=
"hasNew
.t
est==1"
src=
"./assets/imgs/new.png"
>
</div>
</div>
<!--<div class="card" (click)="goTo('LearnManagePage')">-->
<!--<div class="card" (click)="goTo('LearnManagePage')">-->
<!--<img src="./assets/imgs/home/icon-ccgl.png" alt="">-->
<!--<img src="./assets/imgs/home/icon-ccgl.png" alt="">-->
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
<div
class=
"item3"
style=
"padding-top: 0px;"
>
<div
class=
"item3"
style=
"padding-top: 0px;"
>
<div
class=
"item3-2"
style=
"background-color:#f8f8f8;"
(
click
)="
gotoNotice
()"
>
<div
class=
"item3-2"
style=
"background-color:#f8f8f8;"
(
click
)="
gotoNotice
()"
>
<div
class=
"card3"
style=
"width: 15%;"
>
<div
class=
"card3"
style=
"width: 15%;"
>
<span
*
ngIf=
"hasNew
M
essage == 1"
class=
"img-tips"
></span>
<span
*
ngIf=
"hasNew
.m
essage == 1"
class=
"img-tips"
></span>
<img
src=
"./assets/imgs/home/icon-mail.png"
>
<img
src=
"./assets/imgs/home/icon-mail.png"
>
</div>
</div>
<div
class=
"card3"
style=
"width: 75%;"
>
<div
class=
"card3"
style=
"width: 75%;"
>
...
...
src/pages/tabs/home/home.ts
View file @
72847151
...
@@ -37,12 +37,8 @@ export class HomePage {
...
@@ -37,12 +37,8 @@ export class HomePage {
notice
:
0
,
notice
:
0
,
premanager
:
0
,
premanager
:
0
,
message
:
0
,
message
:
0
,
test
:
0
,
};
};
hasNewActivity
:
number
=
0
;
hasNewNotice
:
number
=
0
;
hasNewPremanager
:
number
=
0
;
hasNewMessage
:
number
=
0
;
hasNewTest
:
number
=
0
;
//日历
//日历
date
:
string
;
date
:
string
;
...
@@ -104,11 +100,8 @@ export class HomePage {
...
@@ -104,11 +100,8 @@ export class HomePage {
ionViewWillEnter
()
{
ionViewWillEnter
()
{
this
.
slidersItems
=
[];
this
.
slidersItems
=
[];
this
.
getHasNew
();
//初始化日期
//初始化日期
this
.
getHasNewActivity
();
this
.
getHasNewNotice
();
this
.
getHasNewMessage
();
this
.
getHasNewPremanager
();
//统计待进行和待确认活动数目
//统计待进行和待确认活动数目
this
.
activityStatisticService
.
myActivityOrderCount
((
data
)
=>
{
this
.
activityStatisticService
.
myActivityOrderCount
((
data
)
=>
{
this
.
waitgoCount
=
data
.
waitgoOrder
;
this
.
waitgoCount
=
data
.
waitgoOrder
;
...
@@ -128,8 +121,6 @@ export class HomePage {
...
@@ -128,8 +121,6 @@ export class HomePage {
this
.
activityStatisticService
.
myNotdoPremanagerCount
((
data
)
=>
{
this
.
activityStatisticService
.
myNotdoPremanagerCount
((
data
)
=>
{
this
.
PremanagerNotdoCount
=
data
;
this
.
PremanagerNotdoCount
=
data
;
});
});
//初始化操作记录
}
}
ionViewDidLeave
()
{
ionViewDidLeave
()
{
...
@@ -218,56 +209,47 @@ export class HomePage {
...
@@ -218,56 +209,47 @@ export class HomePage {
this
.
navCtrl
.
push
(
page
);
this
.
navCtrl
.
push
(
page
);
}
}
/**
* 获取是否有新的信息
*/
getHasNew
(){
//获取是否有新活动
this
.
tabsSer
.
hasNewActivity
().
subscribe
(
(
res
)
=>
{
this
.
hasNew
.
activity
=
res
;
}
)
//获取是否有新的活动
//获取是否有新通知
getHasNewActivity
()
{
this
.
tabsSer
.
hasNewNotice
().
subscribe
(
this
.
appService
.
ObserverHttpGet
(
"/wisdomgroup/modules/activity/hasNewActivity"
,
null
)
(
res
)
=>
{
.
subscribe
((
res
:
Response
)
=>
{
this
.
hasNew
.
notice
=
res
;
let
data
=
res
.
json
();
}
this
.
hasNewActivity
=
data
;
)
},
error
=>
{
}
);
}
//获取是否有新的公告
getHasNewNotice
()
{
this
.
appService
.
ObserverHttpGet
(
"/wisdomgroup/modules/notice/hasNewNotice"
,
null
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
this
.
hasNewNotice
=
data
;
},
error
=>
{
}
);
}
//获取是否有新消息
getHasNewMessage
()
{
this
.
appService
.
ObserverHttpGet
(
"/wisdomgroup/modules/message/hasNewMessage"
,
null
)
.
subscribe
((
res
:
Response
)
=>
{
let
data
=
res
.
json
();
this
.
hasNewMessage
=
data
;
},
error
=>
{
}
);
}
//获取是否有新的报备
//获取是否有新通知
getHasNewPremanager
()
{
this
.
tabsSer
.
hasNewMessage
().
subscribe
(
this
.
appService
.
ObserverHttpGet
(
"/wisdomgroup/modules/premanager/hasNewPremanager"
,
null
)
(
res
)
=>
{
.
subscribe
((
res
:
Response
)
=>
{
this
.
hasNew
.
message
=
res
;
let
data
=
res
.
json
();
}
this
.
hasNewPremanager
=
data
;
)
},
error
=>
{
}
);
}
//获取是否有新学习测试
//获取是否有新报备
getHasNewTest
(){
this
.
tabsSer
.
hasNewPremanager
().
subscribe
(
(
res
)
=>
{
this
.
hasNew
.
premanager
=
res
;
}
)
//获取是否有新问卷
this
.
tabsSer
.
hasNewTest
().
subscribe
(
(
res
)
=>
{
this
.
hasNew
.
test
=
res
;
}
)
}
}
//获取所有未读消息的数量--->设置角标
getNewCount
()
{
getNewCount
()
{
this
.
appService
.
ObserverHttpGetData
(
'/wisdomgroup/modules/activity/hasNewCount'
,
null
)
this
.
appService
.
ObserverHttpGetData
(
'/wisdomgroup/modules/activity/hasNewCount'
,
null
)
.
subscribe
((
res
)
=>
{
.
subscribe
((
res
)
=>
{
...
...
src/pages/tabs/tabs.service.ts
View file @
72847151
import
{
Injectable
}
from
"@angular/core"
;
import
{
Injectable
}
from
"@angular/core"
;
import
{
HttpClient
}
from
"@angular/common/http"
;
import
{
HttpClient
}
from
"@angular/common/http"
;
import
{
Http
}
from
"@angular/http"
;
import
{
Observable
}
from
"rxjs/Observable"
;
import
{
Observable
}
from
"rxjs/Observable"
;
import
{
AppGlobal
}
from
"../../service/appHttpService"
;
import
{
AppGlobal
}
from
"../../service/appHttpService"
;
import
{
CommonService
}
from
"../../service/common.service"
;
import
{
CommonService
}
from
"../../service/common.service"
;
@
Injectable
()
@
Injectable
()
export
class
TabsService
{
export
class
TabsService
{
constructor
(
private
http
:
HttpClient
,
private
commonSer
:
CommonService
){}
constructor
(
private
http
:
HttpClient
,
//该请求 将结果转为json
private
commonSer
:
CommonService
,
private
https
:
Http
,
//该请求不转json
){}
//获取权限
//获取权限
getRoles
():
Observable
<
any
>
{
getRoles
():
Observable
<
any
>
{
...
@@ -33,6 +38,41 @@ export class TabsService{
...
@@ -33,6 +38,41 @@ export class TabsService{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/workCalendar/getFestivalAboutMonth?'
+
this
.
commonSer
.
toQuery
(
data
));
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/workCalendar/getFestivalAboutMonth?'
+
this
.
commonSer
.
toQuery
(
data
));
}
}
//获取是否有新的活动
hasNewActivity
():
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/activity/hasNewActivity'
);
}
//获取是否有新的通知
hasNewNotice
():
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/notice/hasNewNotice'
);
}
//获取是否有新信息
hasNewMessage
():
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/message/hasNewMessage'
);
}
//获取是否有新信息
hasNewPremanager
():
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/premanager/hasNewPremanager'
);
}
//获取是否有新的问卷
hasNewTest
():
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/learnTest/hasNewTest'
);
}
//问卷已读
testAddRecodings
():
Observable
<
any
>
{
return
this
.
https
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/learnTest/addRecodings'
);
}
//活动已读
activityAddRecodings
():
Observable
<
any
>
{
return
this
.
https
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/activity/addRecodings'
);
}
//下载文件
//下载文件
downFile
(
data
):
Observable
<
any
>
{
downFile
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/common/file/download/'
+
data
,{
responseType
:
'blob'
});
return
this
.
http
.
get
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/common/file/download/'
+
data
,{
responseType
:
'blob'
});
...
...
src/service/appHttpService.ts
View file @
72847151
...
@@ -13,18 +13,18 @@ export class AppGlobal {
...
@@ -13,18 +13,18 @@ export class AppGlobal {
};
};
//接口基地址
//接口基地址
// static domain = "http://101.89.112.92:80"; //正式环境
//
static domain = "http://101.89.112.92:80"; //正式环境
// static domain = "http://180.168.156.212:2931"; //测试环境
// static domain = "http://180.168.156.212:2931"; //测试环境
static
domain
=
""
;
//本地环境
static
domain
=
""
;
//本地环境
//图片地址
//图片地址
static
picture
=
"http://101.89.112.92:80/wisdomgroup/manager/getIcon/"
;
//正式地址
//
static picture = "http://101.89.112.92:80/wisdomgroup/manager/getIcon/"; //正式地址
//
static picture = "http://180.168.156.212:2931/wisdomgroup/manager/getIcon/"; //测试
static
picture
=
"http://180.168.156.212:2931/wisdomgroup/manager/getIcon/"
;
//测试
//通知公告图片参数
//通知公告图片参数
static
pictureNotice
=
"http://101.89.112.92:80"
;
//正式地址
//
static pictureNotice = "http://101.89.112.92:80"; //正式地址
//
static pictureNotice = "http://180.168.156.212:2931"; //测试
static
pictureNotice
=
"http://180.168.156.212:2931"
;
//测试
//接口地址
//接口地址
static
API
:
any
=
{
static
API
:
any
=
{
...
...
src/service/common.service.ts
View file @
72847151
...
@@ -7,7 +7,10 @@ import {FileOpener} from "@ionic-native/file-opener";
...
@@ -7,7 +7,10 @@ import {FileOpener} from "@ionic-native/file-opener";
@
Injectable
()
@
Injectable
()
export
class
CommonService
{
export
class
CommonService
{
constructor
(
public
toastCtrl
:
ToastController
,
public
alertCtrl
:
AlertController
,
private
file
:
File
,
private
fileOpener
:
FileOpener
,){}
constructor
(
public
toastCtrl
:
ToastController
,
public
alertCtrl
:
AlertController
,
private
file
:
File
,
private
fileOpener
:
FileOpener
){}
/**
/**
* JSON格式数据转化为字符串 接口调用
* JSON格式数据转化为字符串 接口调用
...
@@ -180,4 +183,14 @@ export class CommonService{
...
@@ -180,4 +183,14 @@ export class CommonService{
return
mimeType
;
return
mimeType
;
}
}
/**
* 定义全局的log日志 开发模式 打印log 生产环境 关闭
* @param message 日志信息
*/
log
(
message
){
if
(
AppGlobal
.
domain
===
""
){
//开发环境时
console
.
log
(
message
);
}
}
}
}
\ No newline at end of file
src/service/emit.service.ts
View file @
72847151
...
@@ -3,6 +3,7 @@ import {Injectable, EventEmitter, OnInit} from "@angular/core";
...
@@ -3,6 +3,7 @@ import {Injectable, EventEmitter, OnInit} from "@angular/core";
export
class
EmitService
implements
OnInit
{
export
class
EmitService
implements
OnInit
{
public
eventEmit
:
any
;
public
eventEmit
:
any
;
//全局的监听事件
constructor
()
{
constructor
()
{
// 定义发射事件
// 定义发射事件
this
.
eventEmit
=
new
EventEmitter
();
this
.
eventEmit
=
new
EventEmitter
();
...
...
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