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
cacbcdab
Commit
cacbcdab
authored
Apr 09, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4.0.6
parent
65d5e096
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
14 deletions
+84
-14
config.xml
config.xml
+1
-1
app.scss
src/app/app.scss
+5
-0
activityDetail.html
src/pages/home/activity/activityDetail/activityDetail.html
+4
-1
activityDetail.ts
src/pages/home/activity/activityDetail/activityDetail.ts
+1
-1
home.html
src/pages/tabs/home/home.html
+1
-0
home.ts
src/pages/tabs/home/home.ts
+12
-0
appHttpService.ts
src/service/appHttpService.ts
+2
-2
common.service.ts
src/service/common.service.ts
+58
-9
No files found.
config.xml
View file @
cacbcdab
<?xml version='1.0' encoding='utf-8'?>
<widget
id=
"io.ionic.smart19.starter.test"
version=
"4.0.
6
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<widget
id=
"io.ionic.smart19.starter.test"
version=
"4.0.
7
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<name>
党建云平台(测试)
</name>
<description>
An awesome Ionic/Cordova app.
</description>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
...
...
src/app/app.scss
View file @
cacbcdab
...
...
@@ -251,4 +251,8 @@ ion-icon {
border
:
1px
solid
#f76063
;
padding
:
1px
8px
;
border-radius
:
2px
;
}
.toast-message
{
word-break
:
break-all
;
}
\ No newline at end of file
src/pages/home/activity/activityDetail/activityDetail.html
View file @
cacbcdab
...
...
@@ -18,9 +18,12 @@
<div
class=
"item1-introduction"
>
{{introduce}}
</div>
<p
style=
"margin: 0 15px;font-weight: bold;color:#699fff"
><span>
附件:
</span></p>
<div
class=
"item1-introduction"
>
<ng-container
*
ngFor=
"let file of activity?.fileUploadEntities"
>
<p
(
click
)="
downLoad
(
file
)"
class=
"margin-bottom-15"
>
附件:{{file.showName}}
</p>
<p
style=
"text-decoration: underline;font-weight: bold"
(
click
)="
downLoad
(
file
)"
class=
"margin-bottom-15"
>
{{file.showName}}
</p>
</ng-container>
</div>
</div>
...
...
src/pages/home/activity/activityDetail/activityDetail.ts
View file @
cacbcdab
...
...
@@ -39,7 +39,7 @@ export class ActivityDetailPage {
public
navParams
:
NavParams
,
private
fileTransfer
:
FileTransfer
,
private
fileTransferObject
:
FileTransferObject
,
private
file
:
File
,
private
file
:
File
,
public
toastCtrl
:
ToastController
,
public
alertCtrl
:
AlertController
,
public
commonSer
:
CommonService
,
public
http
:
Http
,
public
tabSer
:
TabsService
,
public
appService
:
AppService
,
public
toast
:
ToastController
)
{
...
...
src/pages/tabs/home/home.html
View file @
cacbcdab
...
...
@@ -51,6 +51,7 @@
<div
class=
"card"
(
click
)="
goTo
('
LearningListPage
')"
>
<img
src=
"./assets/imgs/home/icon-xxcs.png"
alt=
""
>
<label
class=
"label2-2 more2-2"
>
学习测试
</label>
<img
class=
"new-logo"
*
ngIf=
"hasNewTest==1"
src=
"./assets/imgs/new.png"
>
</div>
<!--<div class="card" (click)="goTo('LearnManagePage')">-->
<!--<img src="./assets/imgs/home/icon-ccgl.png" alt="">-->
...
...
src/pages/tabs/home/home.ts
View file @
cacbcdab
...
...
@@ -32,10 +32,17 @@ declare var Swiper;
export
class
HomePage
{
@
ViewChild
(
Slides
)
slides
:
Slides
;
hasNew
=
{
activity
:
0
,
notice
:
0
,
premanager
:
0
,
message
:
0
,
};
hasNewActivity
:
number
=
0
;
hasNewNotice
:
number
=
0
;
hasNewPremanager
:
number
=
0
;
hasNewMessage
:
number
=
0
;
hasNewTest
:
number
=
0
;
//日历
date
:
string
;
...
...
@@ -256,6 +263,11 @@ export class HomePage {
);
}
//获取是否有新学习测试
getHasNewTest
(){
}
getNewCount
()
{
this
.
appService
.
ObserverHttpGetData
(
'/wisdomgroup/modules/activity/hasNewCount'
,
null
)
.
subscribe
((
res
)
=>
{
...
...
src/service/appHttpService.ts
View file @
cacbcdab
...
...
@@ -14,8 +14,8 @@ export class AppGlobal {
//接口基地址
// static domain = "http://101.89.112.92:80"; //正式环境
static
domain
=
"http://180.168.156.212:2931"
;
//测试环境
//
static domain = ""; //本地环境
//
static domain = "http://180.168.156.212:2931"; //测试环境
static
domain
=
""
;
//本地环境
//图片地址
...
...
src/service/common.service.ts
View file @
cacbcdab
...
...
@@ -2,11 +2,12 @@ import {Injectable} from "@angular/core";
import
{
AlertController
,
ToastController
}
from
"ionic-angular"
;
import
{
AppGlobal
}
from
"./appHttpService"
;
import
{
File
}
from
"@ionic-native/file"
;
import
{
FileOpener
}
from
"@ionic-native/file-opener"
;
@
Injectable
()
export
class
CommonService
{
constructor
(
public
toastCtrl
:
ToastController
,
public
alertCtrl
:
AlertController
,
private
file
:
File
,){}
constructor
(
public
toastCtrl
:
ToastController
,
public
alertCtrl
:
AlertController
,
private
file
:
File
,
private
fileOpener
:
FileOpener
,
){}
/**
* JSON格式数据转化为字符串 接口调用
...
...
@@ -91,6 +92,7 @@ export class CommonService{
*/
downloadFile
(
fileID
,
fileName
)
{
const
xhr
=
new
XMLHttpRequest
();
const
fileType
=
this
.
getFileMimeType
(
fileName
);
const
url
=
encodeURI
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/common/file/download/'
+
fileID
);
xhr
.
open
(
'GET'
,
url
);
xhr
.
setRequestHeader
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
...
...
@@ -109,13 +111,9 @@ export class CommonService{
replace
:
true
}).
then
(
()
=>
{
let
toast
=
this
.
toastCtrl
.
create
({
message
:
"下载完成!保存路径:"
+
this
.
file
.
externalDataDirectory
,
duration
:
2000
,
position
:
'bottom'
,
dismissOnPageChange
:
true
,
});
toast
.
present
();
this
.
fileOpener
.
open
(
path
+
fileName
,
fileType
).
catch
((
err
)
=>
{
this
.
alert
(
'打开文件失败!'
+
err
);
})
}).
catch
((
err
)
=>
{
this
.
toast
(
"下载文件失败!"
)
})
...
...
@@ -126,10 +124,60 @@ export class CommonService{
// 结束下载事件
});
xhr
.
addEventListener
(
"error"
,
(
ev
)
=>
{
this
.
alert
(
'下载
附
件失败!'
);
this
.
alert
(
'下载
文
件失败!'
);
});
xhr
.
addEventListener
(
"abort"
,
(
ev
)
=>
{
});
xhr
.
send
();
}
//获取文件类型
getFileMimeType
(
fileName
:
string
):
string
{
let
fileType
=
fileName
.
substring
(
fileName
.
lastIndexOf
(
'.'
)
+
1
,
fileName
.
length
).
toLowerCase
();
let
mimeType
:
string
=
''
;
switch
(
fileType
)
{
case
'txt'
:
mimeType
=
'text/plain'
;
break
;
case
'docx'
:
mimeType
=
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
;
break
;
case
'doc'
:
mimeType
=
'application/msword'
;
break
;
case
'pptx'
:
mimeType
=
'application/vnd.openxmlformats-officedocument.presentationml.presentation'
;
break
;
case
'ppt'
:
mimeType
=
'application/vnd.ms-powerpoint'
;
break
;
case
'xlsx'
:
mimeType
=
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
;
break
;
case
'xls'
:
mimeType
=
'application/vnd.ms-excel'
;
break
;
case
'zip'
:
mimeType
=
'application/x-zip-compressed'
;
break
;
case
'rar'
:
mimeType
=
'application/octet-stream'
;
break
;
case
'pdf'
:
mimeType
=
'application/pdf'
;
break
;
case
'jpg'
:
mimeType
=
'image/jpeg'
;
break
;
case
'png'
:
mimeType
=
'image/png'
;
break
;
default
:
mimeType
=
'application/'
+
fileType
;
break
;
}
return
mimeType
;
}
}
\ No newline at end of file
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