Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
party-build-cloud
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
party-build-cloud
Commits
1465d881
Commit
1465d881
authored
Jun 01, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主题教育
parent
c917de7f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
33 deletions
+85
-33
education.html
src/components/education/education.html
+1
-1
education.ts
src/components/education/education.ts
+4
-1
discover.html
src/pages/tabs/discover/discover.html
+55
-24
discover.ts
src/pages/tabs/discover/discover.ts
+25
-7
No files found.
src/components/education/education.html
View file @
1465d881
<!--主题教育-->
<div
*
ngIf=
"isEdu"
class=
"signMask"
(
click
)="
closeEdu
()"
>
<div
class=
"mask-content-edu"
>
<div
class=
"mask-content-edu"
(
click
)="
stop
($
event
)"
>
<ion-icon
class=
"close"
name=
"close"
></ion-icon>
</div>
</div>
src/components/education/education.ts
View file @
1465d881
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Output
}
from
'@angular/core'
;
@
Component
({
selector
:
'education'
,
templateUrl
:
'education.html'
})
export
class
EducationComponent
{
@
Output
()
done
=
new
EventEmitter
();
isEdu
:
Boolean
=
true
;
...
...
@@ -18,6 +19,8 @@ export class EducationComponent {
stop
(
e
)
{
e
.
stopPropagation
();
this
.
isEdu
=
false
;
this
.
done
.
emit
();
}
}
src/pages/tabs/discover/discover.html
View file @
1465d881
...
...
@@ -36,7 +36,8 @@
<ng-container
*
ngIf=
"slidersItems.length > 0"
>
<div
class=
"swiper-slide"
*
ngFor=
"let item of slidersItems;"
>
<img
*
ngIf=
"item.static"
[
src
]="
item
.
imgUrl
"
class=
"slide-image"
>
<img
*
ngIf=
"!item.static"
[
src
]="
picture
+
item
.
imgUrl
"
class=
"slide-image"
[
alt
]="
item
.
title
"
>
<img
*
ngIf=
"!item.static"
[
src
]="
picture
+
item
.
imgUrl
"
class=
"slide-image"
[
alt
]="
item
.
title
"
>
</div>
</ng-container>
</div>
...
...
@@ -100,29 +101,59 @@
</p>
<div
class=
"item-news"
>
<ion-row
class=
"news-item"
>
<ng-container
*
ngIf=
"item.imgUrl"
>
<ion-col
col-8
class=
"news-left"
>
<p
class=
"news-title"
>
{{item.title}}
<ion-icon
*
ngIf=
"new.topTime"
class=
"icon-fire iconfont"
></ion-icon>
</p>
<p
class=
"news-end"
>
<ion-icon
style=
"font-size: 2.5rem;vertical-align: sub"
name=
"eye"
></ion-icon>
<span>
{{item.browseCount}}
</span>
<ion-icon
name=
"chatboxes"
></ion-icon>
<span>
{{item.commentCount}}
</span>
<ion-icon
name=
"thumbs-up"
></ion-icon>
<span>
{{item.likeCount}}
</span>
<ion-icon
name=
"heart"
></ion-icon>
<span>
{{item.collectionCount}}
</span>
</p>
</ion-col>
<ion-col
col-4
class=
"news-right"
>
<img
src=
"{{picture+item.imgUrl}}"
>
</ion-col>
<!-- 标题图片 -->
<ng-container
*
ngIf=
"item.path"
>
<ng-container
*
ngIf=
"item.resourceType == 1"
>
<ion-col
col-8
class=
"news-left"
>
<p
class=
"news-title"
>
{{item.title}}
<ion-icon
*
ngIf=
"new.topTime"
class=
"icon-fire iconfont"
></ion-icon>
</p>
<p
class=
"news-end"
>
<ion-icon
style=
"font-size: 2.5rem;vertical-align: sub"
name=
"eye"
></ion-icon>
<span>
{{item.browseCount}}
</span>
<ion-icon
name=
"chatboxes"
></ion-icon>
<span>
{{item.commentCount}}
</span>
<ion-icon
name=
"thumbs-up"
></ion-icon>
<span>
{{item.likeCount}}
</span>
<ion-icon
name=
"heart"
></ion-icon>
<span>
{{item.collectionCount}}
</span>
</p>
</ion-col>
<ion-col
col-4
class=
"news-right"
>
<img
src=
"{{picture+item.path}}"
>
</ion-col>
</ng-container>
<!-- 视频 -->
<ng-container
*
ngIf=
"item.resourceType == 3"
>
<ion-col
col-12
class=
"news-left"
>
<p
class=
"news-title"
>
{{item.title}}
<ion-icon
*
ngIf=
"new.topTime"
class=
"icon-fire iconfont"
></ion-icon>
</p>
<div
(
click
)="
clickVideo
($
event
)"
>
<video
width=
"100%"
height=
"100%"
controls=
"controls"
preload=
"metadata"
muted=
"muted"
>
<source
[
src
]="
picture
+
item
.
path
+
'#
t=
0.1'
"
>
您的浏览器不支持 html5。
</video>
</div>
<p
class=
"news-end"
>
<ion-icon
style=
"font-size: 2.5rem;vertical-align: sub"
name=
"eye"
></ion-icon>
<span>
{{item.browseCount}}
</span>
<ion-icon
name=
"chatboxes"
></ion-icon>
<span>
{{item.commentCount}}
</span>
<ion-icon
name=
"thumbs-up"
></ion-icon>
<span>
{{item.likeCount}}
</span>
<ion-icon
name=
"heart"
></ion-icon>
<span>
{{item.collectionCount}}
</span>
</p>
</ion-col>
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"!item.
imgUrl
"
>
<ng-container
*
ngIf=
"!item.
path
"
>
<ion-col
col-12
class=
"news-left"
>
<p
class=
"news-title"
>
{{item.title}}
<ion-icon
*
ngIf=
"new.topTime"
...
...
@@ -191,4 +222,4 @@
</div>
</div>
<education></education>
<education
(
done
)="
goEdu
()"
></education>
src/pages/tabs/discover/discover.ts
View file @
1465d881
...
...
@@ -186,6 +186,7 @@ export class DiscoverPage {
plateType
;
//分类
relateTopicedu
;
//是否主题教育 1 是 0否
isManyPlate
=
null
;
resourceType
=
1
;
//1 标题图片 2 轮播图 3 视频
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
slidersItems
=
[];
...
...
@@ -286,7 +287,7 @@ export class DiscoverPage {
click
:
function
()
{
const
item
=
that
.
slidersItems
[
this
.
activeIndex
];
if
(
item
.
static
==
"true"
)
{
that
.
swiper
.
slideTo
(
0
,
500
);
that
.
swiper
.
slideTo
(
1
,
500
);
//前往主题教育
return
false
;
}
if
(
item
.
plateType
==
20
)
return
false
;
...
...
@@ -298,6 +299,11 @@ export class DiscoverPage {
});
}
//前往主题教育
goEdu
()
{
this
.
swiper
.
slideTo
(
1
,
500
);
//前往主题教育
}
//获取轮播图
getBanner
()
{
const
data
=
{
...
...
@@ -318,7 +324,7 @@ export class DiscoverPage {
}
this
.
slidersItems
=
res
.
data
.
list
;
this
.
slidersItems
.
push
(
this
.
eduObj
);
this
.
slideTitle
=
this
.
slidersItems
[
this
.
slidersItems
.
length
-
2
].
title
;
this
.
slideTitle
=
this
.
slidersItems
[
this
.
slidersItems
.
length
-
2
].
title
;
}
)
}
...
...
@@ -333,6 +339,7 @@ export class DiscoverPage {
this
.
childrenList
=
item
.
children
;
this
.
relateTopicedu
=
item
.
indexParent
==
'2'
?
1
:
0
;
this
.
resourceType
=
item
.
type
==
"16"
?
3
:
1
;
if
(
this
.
childrenList
.
length
>
0
)
this
.
indexChildren
=
this
.
childrenList
[
0
].
indexChildren
;
let
itemWidth
=
window
.
screen
.
width
/
4
;
let
spanWidth
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
;
//文字宽度
...
...
@@ -345,7 +352,7 @@ export class DiscoverPage {
isRecent
:
0
,
obj
:
{
'plateType'
:
this
.
plateType
,
'resourceType'
:
1
,
'resourceType'
:
this
.
resourceType
,
'relateTopicedu'
:
this
.
relateTopicedu
,
}
};
...
...
@@ -354,10 +361,11 @@ export class DiscoverPage {
this
.
newList
=
res
.
data
.
list
;
this
.
newList
.
forEach
(
e
=>
{
if
(
e
.
attachments
.
length
>
0
)
{
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
e
.
path
=
e
.
attachments
[
0
].
path
;
e
.
resourceType
=
e
.
attachments
[
0
].
resourceType
;
}
});
console
.
log
(
this
.
indexParen
t
);
console
.
log
(
this
.
newLis
t
);
this
.
swiper
.
slideTo
(
this
.
indexParent
,
500
);
this
.
slideList
[
this
.
indexParent
]
=
this
.
newList
;
}
...
...
@@ -368,6 +376,7 @@ export class DiscoverPage {
changeChildren
(
item
)
{
this
.
indexChildren
=
item
.
indexChildren
;
this
.
isManyPlate
=
this
.
indexChildren
==
25
?
1
:
null
;
this
.
resourceType
=
item
.
type
==
"16"
?
3
:
1
;
if
(
this
.
indexChildren
==
45
)
{
this
.
getQuestion
();
return
false
;
...
...
@@ -379,7 +388,7 @@ export class DiscoverPage {
isRecent
:
0
,
obj
:
{
'plateType'
:
item
.
type
,
'resourceType'
:
1
,
'resourceType'
:
this
.
resourceType
,
'relateTopicedu'
:
this
.
relateTopicedu
,
'isManyPlate'
:
this
.
isManyPlate
}
...
...
@@ -389,7 +398,8 @@ export class DiscoverPage {
this
.
newList
=
res
.
data
.
list
;
this
.
newList
.
forEach
(
e
=>
{
if
(
e
.
attachments
.
length
>
0
)
{
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
e
.
path
=
e
.
attachments
[
0
].
path
;
e
.
resourceType
=
e
.
attachments
[
0
].
resourceType
;
}
});
this
.
slideList
[
this
.
indexParent
]
=
this
.
newList
;
...
...
@@ -517,4 +527,12 @@ export class DiscoverPage {
issue
()
{
this
.
navCtrl
.
push
(
'SelectTypePage'
,
{
type
:
'issue'
});
}
clickVideo
(
e
){
const
video
=
document
.
querySelectorAll
(
"video"
);
video
.
forEach
(
e
=>
{
console
.
log
(
video
);
})
console
.
log
(
e
);
}
}
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