Commit cd26404a authored by wangqinghua's avatar wangqinghua

update

parent fbc7fe38
......@@ -7,7 +7,7 @@
"proxies": [
{
"path": "/wisdomgroup",
"proxyUrl": "http://47.103.35.216:8080/wisdomgroup"
"proxyUrl": "http://47.103.33.196:8080/wisdomgroup"
}
]
}
......@@ -3,7 +3,7 @@
<ion-navbar>
<div class="search-header">
<ion-input type="text" placeholder="按姓名搜索" [(ngModel)]="searchObj.title"></ion-input>
<span class="clear" (click)="search()">搜索</span>
<span class="clear" (click)="searchValue()">搜索</span>
</div>
</ion-navbar>
</ion-navbar>
......
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {Component, ViewChild} from '@angular/core';
import {InfiniteScrollContent, IonicPage, NavController, NavParams} from 'ionic-angular';
import {TabsService} from "../../tabs/tabs.service";
import {StuffDetailPage} from "../stuff-detail/stuff-detail";
import {AppGlobal} from "../../../service/http.service";
......@@ -11,15 +11,18 @@ import {AppGlobal} from "../../../service/http.service";
templateUrl: 'search-new.html',
})
export class SearchNewPage {
@ViewChild(InfiniteScrollContent) infiniteScrollContent:InfiniteScrollContent;
picture: string = AppGlobal.domain + '/wisdomgroup';
newList = [];
pageSize: number = 1;
pageNum: number = 1;
searchObj = {
title: '',
stuffType: null, //类型:(1图文,2视频)
order: 'desc', //asc升序 desc 降序
}
};
totalNum:number;
constructor(public navCtrl: NavController, public navParams: NavParams,
public tabs: TabsService) {
......@@ -42,10 +45,15 @@ export class SearchNewPage {
}
}
searchValue(){
this.pageNum = 1;
this.search();
}
//查询列表
search() {
const data = {
pageNum: this.pageSize,
pageNum: this.pageNum,
pageCount: 10,
isRecent: 0,
obj: this.searchObj,
......@@ -53,6 +61,7 @@ export class SearchNewPage {
this.tabs.stuffPage(data).subscribe(
(res) => {
this.newList = res.data.list;
this.totalNum = res.data.total;
this.newList.forEach(e => {
if (e.attachments && e.attachments.length > 0) {
e.path = e.attachments[0].path;
......@@ -65,7 +74,8 @@ export class SearchNewPage {
//下拉刷新
doRefresh(e) {
this.pageSize = 1;
this.infiniteScrollContent.inf.enable(true);
this.pageNum = 1;
this.search();
setTimeout(() => {
e.complete();
......@@ -74,22 +84,31 @@ export class SearchNewPage {
//上拉加载
doInfinite(e) {
this.pageSize++;
console.log(this.totalNum)
console.log(this.newList.length)
if(this.totalNum == this.newList.length ){
console.log('done')
e.enable(false);
return false;
}
this.pageNum++;
const data = {
pageSize: this.pageSize,
pageNum: this.pageNum,
pageCount: 10,
isRecent: 0,
obj: this.searchObj,
};
this.tabs.stuffPage(data).subscribe(
(res) => {
this.totalNum = res.data.total;
res.data.list.forEach(e => {
if (e.attachments && e.attachments.length > 0) {
e.path = e.attachments[0].path;
e.resourceType = e.attachments[0].resourceType;
}
this.newList.push(e);
})
});
e.complete();
}
)
}
......
......@@ -621,7 +621,6 @@ export class DiscoverPage {
img.src = canvas.toDataURL("image/png");
img.setAttribute("crossOrigin", 'Anonymous')
img.onload = () => {
// console.log(img);
e.target.setAttribute("poster", canvas.toDataURL("image/png"));
}
}
......
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