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
f1ea0484
Commit
f1ea0484
authored
May 06, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
左滑
parent
65b65be3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
26 deletions
+39
-26
components.module.ts
src/components/components.module.ts
+8
-6
slide-list.html
src/components/slide-list/slide-list.html
+2
-0
slide-list.ts
src/components/slide-list/slide-list.ts
+20
-16
slide.html
src/components/slide/slide.html
+3
-1
home.ts
src/pages/tabs/home/home.ts
+6
-3
No files found.
src/components/components.module.ts
View file @
f1ea0484
import
{
NgModule
}
from
'@angular/core'
;
import
{
SlideComponent
}
from
'./slide/slide'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
SlideComponent
}
from
'./slide/slide'
;
import
{
IonicPageModule
}
from
"ionic-angular"
;
import
{
SlideListComponent
}
from
'./slide-list/slide-list'
;
import
{
SlideListComponent
}
from
'./slide-list/slide-list'
;
@
NgModule
({
declarations
:
[
SlideComponent
,
SlideListComponent
,
...
...
@@ -12,10 +13,11 @@ import { SlideListComponent } from './slide-list/slide-list';
],
exports
:
[
SlideComponent
,
SlideListComponent
,
],
providers
:
[
providers
:
[
SlideComponent
,
SlideListComponent
,
]
})
export
class
ComponentsModule
{}
export
class
ComponentsModule
{
}
src/components/slide-list/slide-list.html
View file @
f1ea0484
<!--true 隐藏 false 显示-->
<div
[
hidden
]="
isScroll
"
class=
"news-content"
>
<div
class=
"tabs-parent"
>
<div
*
ngFor=
"let item of tabsList;let i = index"
(
click
)="
change
(
item
)"
class=
"tabs-children"
>
...
...
@@ -7,6 +8,7 @@
</div>
</div>
<!--固定 false -->
<div
[
hidden
]="!
isScroll
"
ion-fixed
class=
"news-content ion-fixed"
>
<div
class=
"tabs-parent"
>
<div
*
ngFor=
"let item of tabsList;let i = index"
(
click
)="
change
(
item
)"
class=
"tabs-children"
>
...
...
src/components/slide-list/slide-list.ts
View file @
f1ea0484
import
{
AfterViewInit
,
Component
,
ElementRef
,
ViewChild
}
from
'@angular/core'
;
import
{
Slides
}
from
"ionic-angular"
;
import
{
AfterViewInit
,
Component
,
ElementRef
,
NgZone
,
ViewChild
}
from
'@angular/core'
;
import
{
Content
,
Slides
}
from
"ionic-angular"
;
import
{
TabsService
}
from
"../../pages/tabs/tabs.service"
;
import
{
AppGlobal
}
from
"../../service/http.service"
;
...
...
@@ -7,11 +7,11 @@ import {AppGlobal} from "../../service/http.service";
selector
:
'slide-list'
,
templateUrl
:
'slide-list.html'
})
export
class
SlideListComponent
implements
AfterViewInit
{
@
ViewChild
(
Slides
)
slides
:
Slides
;
@
ViewChild
(
'tabSpan'
)
tabSpan
:
ElementRef
;
@
ViewChild
(
'tips'
)
tips
:
ElementRef
;
@
ViewChild
(
'tips1'
)
tips1
:
ElementRef
;
export
class
SlideListComponent
implements
AfterViewInit
{
@
ViewChild
(
Slides
)
slides1
:
Slides
;
@
ViewChild
(
'tabSpan'
)
tabSpan
:
ElementRef
;
@
ViewChild
(
'tips'
)
tips
:
ElementRef
;
@
ViewChild
(
'tips1'
)
tips1
:
ElementRef
;
isScroll
=
false
;
//所属板块类型:
...
...
@@ -28,10 +28,8 @@ export class SlideListComponent implements AfterViewInit{
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
constructor
(
private
tabsSer
:
TabsService
)
{
constructor
(
private
tabsSer
:
TabsService
,
public
zone
:
NgZone
)
{
this
.
slideList
.
length
=
4
;
console
.
log
(
'Hello SlideListComponent Component'
);
}
ngAfterViewInit
():
void
{
...
...
@@ -64,19 +62,25 @@ export class SlideListComponent implements AfterViewInit{
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
}
})
this
.
slides
.
slideTo
(
index
,
500
);
this
.
slides1
.
slideTo
(
index
,
500
);
this
.
slideList
[
index
]
=
arr
;
}
)
}
slideChange
(
e
){
const
index
=
this
.
slides
.
getActiveIndex
();
// console.log(this.tabsList[index]);
// this.changeParent(this.tabsList[index])
slideChange
(
e
)
{
const
index
=
this
.
slides1
.
getActiveIndex
();
this
.
change
(
this
.
tabsList
[
index
])
}
//判断是否scroll true 滑动 false 不滑动
scroll
(
bool
)
{
this
.
isScroll
=
bool
!==
'false'
;
console
.
log
(
this
.
isScroll
)
}
//
goToDetail
(
item
){}
goToDetail
(
item
)
{
}
}
src/components/slide/slide.html
View file @
f1ea0484
...
...
@@ -7,5 +7,6 @@
</ion-slide>
</ion-slides>
</div>
<p
class=
"slides-title"
>
{{slideTitle}}
<span
class=
"main-color"
float-end
>
1
<span
<p
class=
"slides-title"
>
{{slideTitle}}
<span
class=
"main-color"
float-end
>
1
<span
style=
"font-size: 1.5rem;font-weight: 400;"
>
/{{slidersItems.length}}
</span></span></p>
\ No newline at end of file
src/pages/tabs/home/home.ts
View file @
f1ea0484
...
...
@@ -12,6 +12,7 @@ import {SearchNewPage} from "../../home-pages/search-new/search-new";
import
{
StuffDetailPage
}
from
"../../home-pages/stuff-detail/stuff-detail"
;
import
{
EmitService
}
from
"../../../provide/emit.service"
;
import
{
DatePipe
}
from
"@angular/common"
;
import
{
SlideListComponent
}
from
"../../../components/slide-list/slide-list"
;
@
IonicPage
()
@
Component
({
...
...
@@ -61,7 +62,7 @@ export class HomePage {
constructor
(
public
navCtrl
:
NavController
,
public
tts
:
TextToSpeech
,
public
datePipe
:
DatePipe
,
public
commonSer
:
CommonService
,
public
emitSer
:
EmitService
,
public
zone
:
NgZone
,
public
renderer
:
Renderer2
,
public
zone
:
NgZone
,
public
slideList
:
SlideListComponent
,
public
appService
:
AppService
,
public
http
:
Http
,
public
storage
:
Storage
,
public
badge
:
Badge
,
public
tabsSer
:
TabsService
)
{
// 接收发射过来的数据
...
...
@@ -85,15 +86,17 @@ export class HomePage {
this
.
getInfo
();
this
.
scrollHeight
();
}
scrollHeight
(){
const
height
=
this
.
topHeight
.
nativeElement
.
offsetHeight
+
80
;
this
.
content
.
ionScroll
.
subscribe
((
$event
)
=>
{
this
.
zone
.
run
(()
=>
{
// this.headerTag.nativeElement.
if
(
this
.
content
.
scrollTop
>
height
){
this
.
isScroll
=
true
;
this
.
slideList
.
scroll
(
'true'
)
;
}
else
{
this
.
isScroll
=
false
;
this
.
slideList
.
scroll
(
'false'
)
;
}
this
.
content
.
resize
();
})
...
...
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