Commit 9d4ae409 authored by wangqinghua's avatar wangqinghua

分页参数修改

parent 89089c66
......@@ -11,18 +11,19 @@ import {AppGlobal} from "../../../service/http.service";
templateUrl: 'search-new.html',
})
export class SearchNewPage {
@ViewChild(InfiniteScrollContent) infiniteScrollContent:InfiniteScrollContent;
@ViewChild(InfiniteScrollContent) infiniteScrollContent: InfiniteScrollContent;
picture: string = AppGlobal.domain + '/wisdomgroup';
newList = [];
pageNum: number = 1;
searchObj = {
title: '',
stuffType: null, //类型:(1图文,2视频)
order: 'desc', //asc升序 desc 降序
};
totalNum:number;
pageNum: number = 1;
pageSize = AppGlobal.pageCount;
totalNum: number;
constructor(public navCtrl: NavController, public navParams: NavParams,
public tabs: TabsService) {
......@@ -49,7 +50,7 @@ export class SearchNewPage {
search() {
const data = {
pageNum: 1,
pageCount: 10,
pageSize: this.pageSize,
isRecent: 0,
obj: this.searchObj,
};
......@@ -78,15 +79,15 @@ export class SearchNewPage {
//上拉加载
doInfinite(e) {
if(this.totalNum == this.newList.length ){
if (this.totalNum == this.newList.length) {
console.log('done')
e.enable(false);
return false;
}
this.pageNum++;
const data = {
pageNum: this.pageNum,
pageCount: 10,
pageNum: 1,
pageSize: this.pageSize,
isRecent: 0,
obj: this.searchObj,
};
......
......@@ -8,5 +8,50 @@
<ion-content>
<div class="padding-6">
<ion-item>
<ion-item>
<ion-label class="item-left">用车时间:</ion-label>
<ion-datetime cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择"
[(ngModel)]="obj.startTime"></ion-datetime>
</ion-item>
<ion-item>
<ion-label class="item-left">还车时间:</ion-label>
<ion-datetime cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择"
[(ngModel)]="obj.endTime"></ion-datetime>
</ion-item>
<ion-item>
<ion-label class="item-left">用车人数:</ion-label>
<ion-input [(ngModel)]="obj.passengerCount" type="text" maxlength="20"
[placeholder]="roomMax"></ion-input>
</ion-item>
<div class="item-box">
<div class="left">使用人:
</div>
<div class="right">
<button color="danger" ion-button small (click)="choose()">选择</button>
<div class="div-tag">
<span *ngFor="let item of personList;let i = index">
{{item.userName}}
<ion-icon (click)="removePerson(i)" name="close"></ion-icon>
</span>
</div>
</div>
</div>
<ion-label class="item-left">用车事由:</ion-label>
<ion-select [(ngModel)]="obj.useReason" cancelText="取消" okText="确定" placeholder="请选择">
<ion-option *ngFor="let type of meetTypeList" [value]="type.id">{{type.name}}</ion-option>
</ion-select>
</ion-item>
<div class="item-box">
<div class="left">起讫地点:</div>
<div class="right">
<ion-textarea [(ngModel)]="obj.fromTo"></ion-textarea>
</div>
</div>
</div>
<button class="submit-btn submit" (click)="submit()">提交</button>
</ion-content>
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {IonicPage, ModalController, NavController, NavParams} from 'ionic-angular';
import {ServeService} from "../../serve.service";
import {CommonService} from "../../../../provide/common.service";
import {DatePipe} from "@angular/common";
import {PersonMulComponent} from "../../../../components/person-mul/person-mul";
@Component({
......@@ -8,11 +12,98 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
})
export class CarApplyPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
obj = {
startTime:'',
endTime:'',
carUser:'',
useReason:'',
passengerCount:'',
driverName:'',
phone:'',
};
meetTypeList = [
{id: '1', name: '工作会议'},
{id: '2', name: '座谈会'},
{id: '3', name: '中心组学习'},
{id: '4', name: '访谈'},
];
roomList = [];
orgList = [];
leaderList = [];
personList = [];
roomMax = '请输入参会人数'; //会议室最大人数
applyId; //是否编辑
constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public modalCtrl: ModalController,
private commonSer: CommonService,private datePipe:DatePipe) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad CarApplyPage');
this.getList();
this.applyId = this.navParams.get('id');
if (this.applyId) {
this.meetDetail();
}
}
//会议详情
meetDetail() {
this.serveSer.meetDetail(this.applyId).subscribe(
(res) => {
if (res) {
console.log(this.obj);
}
}
)
}
//会议室列表,部领导列表,处室列表
getList() {
this.serveSer.getLeaders().subscribe(
(res) => {
this.leaderList = res.data;
}
);
this.serveSer.getRoomList().subscribe(
(res) => {
this.roomList = res.data;
}
);
const data = {order: 0};
this.serveSer.getAllOrganization(data).subscribe(
(res) => {
this.orgList = res;
}
)
}
//选择人员
choose() {
let modal = this.modalCtrl.create(PersonMulComponent, {
enterAnimation: 'modal-scale-enter',
leaveAnimation: 'modal-scale-leave'
});
modal.onDidDismiss(data => {
if (data) {
this.personList = data;
}
});
modal.present();
}
//移除人员
removePerson(index) {
console.log(index);
this.personList.splice(index, 1);
}
submit() {
}
}
......@@ -3,7 +3,7 @@
<ion-navbar>
<ion-title>用车申请</ion-title>
<ion-buttons end>
<button ion-button (click)="addMeet()">
<button ion-button (click)="addApply()">
<span ion-text style="font-size: 1.4rem" class="color-fff margin-right-10">申请用车</span>
</button>
</ion-buttons>
......@@ -21,7 +21,7 @@
<ion-content>
<ion-content direction="y" scrollbar-y="true">
<ion-content direction="y" scrollbar-y="true" class="bgc-e7e8ed">
<ng-container *ngIf="changeType == 1">
<ion-calendar [(ngModel)]="date"
(onChange)="getApply($event)"
......@@ -80,6 +80,46 @@
</ng-container>
<ng-container *ngIf="changeType == 2">
<div class="duty-content">
<ion-list class="myItem">
<ion-item-sliding class="apply" *ngFor="let item of applyList">
<ion-item>
<p>
<span *ngIf="item.applyStatus == 1">已申请</span>
<span *ngIf="item.applyStatus == 2">已通过</span>
<span *ngIf="item.applyStatus == 3">已驳回</span>
<span float-end>申请时间:
<span>{{item.applyTime | date:'yyyy-MM-dd HH:mm'}}</span>
</span>
</p>
<p>
<span class="apply-room">会议室:
<span>{{item.roomName}}</span>
</span>
<span class="meet-type">
<span *ngIf="item.meetingType == 1">工作会议</span>
<span *ngIf="item.meetingType == 2">座谈会</span>
<span *ngIf="item.meetingType == 3">中心组学习</span>
<span *ngIf="item.meetingType == 4">访谈</span>
</span>
</p>
<p>
<span class="order-time">预定时间:
<span>{{item.startTime | date:'yyyy-MM-dd HH:mm'}}</span>
</span>
</p>
</ion-item>
<ion-item-options>
<button ion-button color="danger" (click)="removeItem(item)">删除</button>
</ion-item-options>
</ion-item-sliding>
</ion-list>
<ion-list text-center style="margin-top: 10rem;color: #666666"
*ngIf="!isLoad && applyList.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无预订
</p>
</ion-list>
</div>
</ng-container>
</ion-content>
......
page-use-car {
.list-ios .item-block .item-inner {
border: none;
}
.duty {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: 36px;
background-color: #fff;
}
.duty-state {
border: 1px solid #f8ac56;
font-size: 1.3rem;
border-radius: 4px;
padding: 1px 4px;
color: #f8ac56;
}
.duty div {
width: 50%;
text-align: center;
position: relative;
}
.duty-title {
position: relative;
color: #e42417;
}
.duty-title::after {
content: '';
position: absolute;
width: 100%;
height: 2px;
background-color: #e42417;
bottom: -10px;
left: 0px;
}
.span-btn {
background-color: #e42417;
font-size: 1.4rem;
padding: 4px 6px;
color: #fff;
border-radius: 3px;
}
.dutyItem > div {
margin-bottom: 10px;
}
.daySpan {
padding: 2px 20px;
background-color: #e42417;
color: #fff;
border-bottom-right-radius: 5px;
}
.nightSpan {
padding: 4px 20px;
background-color: #4e5e6f;
color: #fff;
border-bottom-right-radius: 5px;
}
.duty-Obj .item-ios p {
margin-bottom: 15px;
}
.duty-Obj .label-ios {
margin: 0;
}
.duty-Obj {
.item-ios.item-block .item-inner {
background-color: #f5f6f7;
}
}
.room {
padding: 15px;
background-color: #fff;
}
.morning, .afternoon {
display: flex;
.morning-text, .afternoon-text {
width: 20%;
display: flex;
align-items: center;
font-weight: bold;
padding-left: 15px;
}
.morning-room, .morning-room {
width: 80%;
padding: 10px 5px;
min-height: 53px;
span {
display: inline-block;
font-size: 1.2rem;
background-color: #e42417;
border: 1px solid #e42417;
border-radius: 4px;
color: #ffffff;
padding: 3px 6px;
margin-bottom: 8px;
margin-right: 5px;
}
}
}
.morning + .afternoon {
border-top: 1px solid #cccccc;
}
.already, .notYet {
border: 1px solid #dddddd;
border-radius: 3px;
p {
background-color: #fff1f0;
color: #e42417;
padding: 6px 15px;
}
}
.already {
.morning {
border-top-right-radius: 8px;
border-top-left-radius: 8px;
}
.afternoon {
border-bottom-right-radius: 8px;
border-bottom-left-radius: 8px;
}
}
.notYet {
margin-top: 15px;
.morning, .afternoon {
.morning-room {
span {
background-color: #f2f2f2;
border: 1px solid #f2f2f2;
color: #666666;
}
}
}
}
.duty-content {
padding: 15px;
ion-item{
p{
padding: 0 10px 10px 10px;
span{
color: #333333;
font-weight: 500;
span{
color: #666666;
font-weight: 400;
}
}
}
p:first-child{
border-bottom: 1px solid #cccccc;
margin-bottom: 10px;
}
}
}
.apply {
font-size: 1.4rem;
border-radius: 5px;
.apply-room {
font-size: 1.4rem;
}
.meet-type {
font-size: 1.4rem;
margin-left: 20px;
span {
font-size: 1.4rem;
}
}
.order-time {
font-size: 1.4rem;
}
}
.apply + .apply{
margin-top: 8px;
}
.list-ios .item-block .item-inner{
padding: 0;
}
}
......@@ -5,6 +5,9 @@ import {monthCh, weekDay} from "../../../app/main";
import {ServeService} from "../serve.service";
import {DatePipe} from "@angular/common";
import {RoomApplyPage} from "../meet-room/room-apply/room-apply";
import {AppGlobal} from "../../../service/http.service";
import {CommonService} from "../../../provide/common.service";
import {CarApplyPage} from "./car-apply/car-apply";
@IonicPage()
@Component({
......@@ -25,18 +28,27 @@ export class UseCarPage {
};
room;
applyList = [];
pageNumber = 1;
pageSize = AppGlobal.pageCount;
total;
isLoad = true;
constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public datePipe: DatePipe) {
private serveSer: ServeService, public datePipe: DatePipe,
private commonSer: CommonService) {
}
ionViewDidEnter() {
const date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply(date);
this.myApply();
}
//获取预定日程
getApply(date) {
const data = {'dateStr': date}
const data = {'dateStr': date};
this.serveSer.queryMeetingRoomByDate(data).subscribe(
(res) => {
this.room = res.data;
......@@ -44,18 +56,51 @@ export class UseCarPage {
)
}
addMeet() {
this.navCtrl.push(RoomApplyPage);
//我的预定
myApply() {
const data = {
P_pageNumber: this.pageNumber,
P_pageSize: this.pageSize,
}
this.serveSer.queryMyApply(data).subscribe(
(res) => {
this.isLoad = false;
this.applyList = res.list;
this.total = res.total;
}
)
}
//取消预定
removeItem(item) {
this.serveSer.cancelApply(item.id).subscribe(
(res) => {
if (res.errcode == 1000) {
this.commonSer.toast('取消预定成功');
this.myApply();
} else {
this.commonSer.toast(res.errmsg);
}
}
)
}
//新增预定
addApply() {
this.navCtrl.push(CarApplyPage);
}
//改变
change(type) {
this.changeType = type;
}
//编辑申请
goApplyEdit(item) {
this.navCtrl.push(RoomApplyPage, {id: item.applyId});
}
//新增申请
goApply() {
this.navCtrl.push(RoomApplyPage);
}
......
......@@ -88,7 +88,7 @@
</div>
</div>
<ion-slides #contentSlides>
<ion-slides (ionSlideDidChange)="slideChanged()" [loop]="false">
<ng-container *ngFor="let new of slideArr;let i = index;">
<ion-slide>
<ion-content>
......
......@@ -75,7 +75,7 @@ page-discover {
//新闻区
.search-content {
padding: 0 1rem 5rem 1rem;
padding: 0 1rem 0 1rem;
.search-item {
padding: .8rem 0;
......
......@@ -200,7 +200,7 @@ export class DiscoverPage {
toIndex;
//分页
pageCount = AppGlobal.pageCount;
pageSize = AppGlobal.pageCount;
pageNum = 1;
totalNum; //总条数
......@@ -268,6 +268,7 @@ export class DiscoverPage {
const height = this.topHeight.nativeElement.offsetHeight;
this.content.ionScroll.subscribe(($event) => {
this.zone.run(() => {
if (this.content.scrollTop > height) {
this.renderer.addClass(this.fixedTab.nativeElement, 'tabs-fixed-scroll')
} else {
......@@ -346,6 +347,13 @@ export class DiscoverPage {
)
}
slideChanged() {
const index = this.slides.realIndex;
const distance = index * this.itemWidth / 2; //滑动的长度
this.newContentParent.nativeElement.scrollLeft = distance;
this.changeParent(this.tabsList[index]);
}
//父级选择
changeParent(item) {
this.newsContent.nativeElement.scrollLeft = 0; //二级菜单滑动重置
......@@ -372,8 +380,8 @@ export class DiscoverPage {
// 自身div的一半 - 滑块的一半
this.tips.nativeElement.style.left = this.itemWidth * (this.indexParent) + (this.itemWidth - this.spanWidth) / 2 + 'px';
const data = {
pageSize: 1,
pageCount: this.pageCount,
pageNum: 1,
pageSize: this.pageSize,
isRecent: this.isRecent,
obj: {
'plateType': this.obj.plateType,
......@@ -424,8 +432,8 @@ export class DiscoverPage {
}
const data = {
pageSize: 1,
pageCount: this.pageCount,
pageNum: 1,
pageSize: this.pageSize,
isRecent: this.isRecent,
obj: {
'plateType': this.obj.plateType,
......@@ -443,34 +451,6 @@ export class DiscoverPage {
}
});
this.slideList[this.indexParent] = this.newList;
this.getMore(res);
}
)
}
getMore(res) {
const totalNum: number = res.data.total;
if (totalNum < this.pageCount) return false;
const data = {
pageNum: 1,
pageCount: totalNum,
isRecent: this.isRecent,
obj: {
'plateType': this.obj.plateType,
'resourceType': this.resourceType,
"relatePlateType": this.relatePlateType
}
};
this.tabsSer.stuffPage(data).subscribe(
(res) => {
res.data.list.splice(0, 10);
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.slideList[this.indexParent].push(e);
});
}
)
}
......@@ -495,7 +475,7 @@ export class DiscoverPage {
this.getBanner();
const data = {
pageNum: 1,
pageCount: this.pageCount,
pageSize: this.pageSize,
isRecent: this.isRecent,
obj: {
'plateType': this.obj.plateType,
......@@ -523,14 +503,15 @@ export class DiscoverPage {
//上拉加载更多
doInfinite(e) {
if (this.totalNum == this.slideList[this.indexParent]) {
console.log('doInfinite:'+this.slideList[this.indexParent].length);
if (this.totalNum == this.slideList[this.indexParent].length || this.totalNum < this.slideList[this.indexParent].length) {
e.complete();
return false;
}
this.pageNum++;
const data = {
pageNum: this.pageNum,
pageCount: this.pageCount,
pageCount: this.pageSize,
isRecent: this.isRecent,
obj: {
'plateType': this.obj.plateType,
......@@ -626,9 +607,5 @@ export class DiscoverPage {
}
}
slideChanged() {
}
}
......@@ -72,7 +72,7 @@ export class HomePage {
pageNum = 1;
pageCount = AppGlobal.pageCount;
pageSize = AppGlobal.pageCount;
mineInfo;
username;
......@@ -209,7 +209,7 @@ export class HomePage {
this.plateType = item.type;
const data = {
pageNum: this.pageNum,
pageCount: this.pageCount,
pageSize: this.pageSize,
obj: {
'plateType': this.plateType,
'resourceType': 1
......@@ -235,7 +235,7 @@ export class HomePage {
//加载更多
getMore(res) {
const totalNum: number = res.data.total;
if (totalNum < this.pageCount) return false;
if (totalNum < this.pageSize) return false;
const data = {
pageNum: 1,
pageCount: totalNum,
......@@ -390,7 +390,7 @@ export class HomePage {
this.getBanner();
const data = {
pageNum: 1,
pageCount: this.pageCount,
pageSize: this.pageSize,
obj: {
'plateType': this.plateType,
'resourceType': 1
......
......@@ -24,7 +24,7 @@
</div>
</div>
<div (click)="goTo('LearningListPage')">
<div (click)="goTo('UseCarPage')">
<div class="card">
<img src="./assets/imgs/home/icon-ycsq.png">
<label class="label2-2 more2-2">用车申请</label>
......
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