Commit cd26404a authored by wangqinghua's avatar wangqinghua

update

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