Commit 9bcf5a2d authored by wangqinghua's avatar wangqinghua

搜索框高度修正

parent 384a94c0
...@@ -11,10 +11,13 @@ page-search-new { ...@@ -11,10 +11,13 @@ page-search-new {
border-bottom: 1px solid #ffffff; border-bottom: 1px solid #ffffff;
background-color: #fff; background-color: #fff;
border-radius: 5px; border-radius: 5px;
height: 35px; height: 30px;
padding-left: 10px; padding-left: 10px;
} }
} }
ion-navbar{
height: 44px;
}
.text-input::-webkit-input-placeholder { .text-input::-webkit-input-placeholder {
color: #ffffff; color: #ffffff;
...@@ -41,6 +44,10 @@ page-search-new { ...@@ -41,6 +44,10 @@ page-search-new {
background-color: #e12724; background-color: #e12724;
} }
.header-ios .toolbar-ios:last-child .toolbar-background-ios{
border: none;
}
//新闻区 //新闻区
.search-content{ .search-content{
padding: 0 1rem; padding: 0 1rem;
......
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
</button> </button>
</ion-buttons> </ion-buttons>
</ion-navbar> </ion-navbar>
<ion-toolbar class="fixed-toolbar"> <ion-toolbar class="fixed-toolbar parent-toolbar">
<div ion-fixed class="tabs-fixed"> <div ion-fixed class="tabs-fixed ">
<div class="scroll-tab"> <div class="scroll-tab">
<div class="news-content"> <div class="news-content">
<div #tabsParent class="tabs-parent"> <div #tabsParent class="tabs-parent parent">
<div #tabsChildren *ngFor="let item of tabsList;" (click)="changeParent(item)" class="tabs-children"> <div #tabsChildren *ngFor="let item of tabsList;" (click)="changeParent(item)" class="tabs-children">
<span #tabSpan [style.color]="indexParent == item.indexParent ? '#e12724':''">{{item.name}}</span> <span #tabSpan [style.color]="indexParent == item.indexParent ? '#e12724':''">{{item.name}}</span>
</div> </div>
......
...@@ -135,6 +135,9 @@ page-discover { ...@@ -135,6 +135,9 @@ page-discover {
} }
} }
.parent-toolbar{
margin-bottom: .5rem;
}
.tabs-fixed{ .tabs-fixed{
position: fixed; position: fixed;
top: 0px; top: 0px;
...@@ -146,6 +149,9 @@ page-discover { ...@@ -146,6 +149,9 @@ page-discover {
.tabs-parent{ .tabs-parent{
background-color: #ffffff; background-color: #ffffff;
} }
.parent.tabs-parent{
background-color: #fff1f0;
}
} }
.fixed-toolbar{ .fixed-toolbar{
...@@ -161,4 +167,8 @@ page-discover { ...@@ -161,4 +167,8 @@ page-discover {
.slide-zoom{ .slide-zoom{
text-align: left; text-align: left;
} }
//下拉刷新
ion-infinite-scroll{
overflow: hidden;
}
} }
...@@ -153,6 +153,8 @@ export class DiscoverPage { ...@@ -153,6 +153,8 @@ export class DiscoverPage {
pageCount = AppGlobal.pageCount; pageCount = AppGlobal.pageCount;
loadMore = true; loadMore = true;
totalNum;
pageNum = 1;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public commonSer: CommonService,public renderer:Renderer2, public commonSer: CommonService,public renderer:Renderer2,
...@@ -173,6 +175,8 @@ export class DiscoverPage { ...@@ -173,6 +175,8 @@ export class DiscoverPage {
//父级选择 //父级选择
changeParent(item) { changeParent(item) {
this.newsContent.nativeElement.scrollLeft = 0; //二级菜单滑动重置 this.newsContent.nativeElement.scrollLeft = 0; //二级菜单滑动重置
this.infiniteScrollContent.inf.enable(true);
this.loadMore = true;
const index = item.indexParent; const index = item.indexParent;
this.indexParent = index; this.indexParent = index;
...@@ -188,7 +192,7 @@ export class DiscoverPage { ...@@ -188,7 +192,7 @@ export class DiscoverPage {
this.tips.nativeElement.style.left = itemWidth * (index) + (itemWidth - spanWidth) / 2 + 'px'; this.tips.nativeElement.style.left = itemWidth * (index) + (itemWidth - spanWidth) / 2 + 'px';
const data = { const data = {
pageSize: 1, pageSize: 1,
pageCount: 100, pageCount: this.pageCount,
obj: { obj: {
'plateType': this.plateType, 'plateType': this.plateType,
'resourceType': 1 'resourceType': 1
...@@ -211,9 +215,12 @@ export class DiscoverPage { ...@@ -211,9 +215,12 @@ export class DiscoverPage {
//子级选择 //子级选择
changeChildren(item) { changeChildren(item) {
this.indexChildren = item.indexChildren; this.indexChildren = item.indexChildren;
this.infiniteScrollContent.inf.enable(true);
this.loadMore = true;
const data = { const data = {
pageSize: 1, pageSize: 1,
pageCount: 100, pageCount: this.pageCount,
obj: { obj: {
'plateType': item.type, 'plateType': item.type,
'resourceType': 1 'resourceType': 1
...@@ -227,6 +234,7 @@ export class DiscoverPage { ...@@ -227,6 +234,7 @@ export class DiscoverPage {
e.imgUrl = e.attachments[0].path; e.imgUrl = e.attachments[0].path;
} }
}) })
this.slideList[this.indexParent] = this.newList;
} }
) )
} }
...@@ -260,11 +268,39 @@ export class DiscoverPage { ...@@ -260,11 +268,39 @@ export class DiscoverPage {
//上拉加载 //上拉加载
doInfinite(e) { doInfinite(e) {
this.renderer.setStyle(this.infiniteScrollContentEle.nativeElement,'height','84px'); if (this.totalNum < this.slideList[this.toIndex].length + 1) {
setTimeout(()=>{ console.log('没有数据了');
this.loadMore = false;
e.enable(false);
return false;
}
this.pageNum++;
const data = {
pageNum: this.pageNum,
pageCount: this.pageCount,
obj: {
'plateType': this.plateType,
'resourceType': 1
}
};
this.renderer.setStyle(this.infiniteScrollContentEle.nativeElement, 'height', '60px');
this.tabsSer.stuffPage(data).subscribe(
(res) => {
let arr = res.data.list;
if (arr.length > 0) {
arr.forEach(e => {
if (e.attachments.length > 0) {
e.imgUrl = e.attachments[0].path;
}
this.slideList[this.toIndex].push(e);
});
}
setTimeout(() => {
e.complete(); e.complete();
this.renderer.setStyle(this.infiniteScrollContentEle.nativeElement,'height','0px'); this.renderer.setStyle(this.infiniteScrollContentEle.nativeElement, 'height', '0px');
},1000) }, 1000)
}
)
} }
......
...@@ -267,8 +267,6 @@ export class HomePage { ...@@ -267,8 +267,6 @@ export class HomePage {
//上拉加载 //上拉加载
doInfinite(e) { doInfinite(e) {
console.log(this.totalNum)
console.log(this.slideList[this.index].length + 1)
if (this.totalNum < this.slideList[this.index].length + 1) { if (this.totalNum < this.slideList[this.index].length + 1) {
console.log('没有数据了'); console.log('没有数据了');
this.loadMore = false; this.loadMore = false;
...@@ -302,7 +300,6 @@ export class HomePage { ...@@ -302,7 +300,6 @@ export class HomePage {
}, 1000) }, 1000)
} }
) )
} }
//下拉刷新 //下拉刷新
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment