Commit 9bcf5a2d authored by wangqinghua's avatar wangqinghua

搜索框高度修正

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