Commit 4e8496c2 authored by wangqinghua's avatar wangqinghua

用车申请

发现页面的分页
parent 19b6b116
/**
* Automatically generated file. DO NOT MODIFY
*/
package io.ionic.smart19.starter.test;
public final class BuildConfig {
public static final boolean DEBUG = false;
public static final String APPLICATION_ID = "io.ionic.smart19.starter.test";
public static final String BUILD_TYPE = "release";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 40502;
public static final String VERSION_NAME = "4.5.2";
}
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package io.ionic.smart19.starter.test;
import android.os.Bundle;
import org.apache.cordova.*;
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// enable Cordova apps to be started in the background
Bundle extras = getIntent().getExtras();
if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
moveTaskToBack(true);
}
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
import {Injectable} from "@angular/core";import {HttpClient} from "@angular/common/http";import {Http} from "@angular/http";import {Observable} from "rxjs/Observable";import {AppGlobal} from "../../service/http.service";import {CommonService} from "../../provide/common.service"; @Injectable()export class ServeService { constructor( private http: HttpClient, //该请求 将结果转为json private commonSer: CommonService, private https: Http, //该请求不转json ) { } getAllOrganization(data): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/sysmanagement/org/getAllOrganization?' + this.commonSer.toQuery(data)); } /** 物品领用 **/ //办公用品列表 searchSupplies(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/officesupplies/searchSupplies', this.commonSer.toFormData(data)); } //物品详情 supplyDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/detail/' + params); } //保存订单 saveOrder(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/saveOrder', data); } //查询订单 myOrder(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/myOrder', this.commonSer.toFormData(data)); } //类型列表 getTypeList(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/officesupplies/getTypeList', null); } //购物车 shoppingCar(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/shoppingCar', this.commonSer.toFormData(data)); } //更新购物车 saveOrderSuppy(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/saveOrderSuppy', data); } //删除购物车物品 deleteOrderSuppy(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/deleteOrderSuppy/' + params); } /** 会议室预定 **/ queryMeetingRoomByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/queryMeetingRoomByDate', this.commonSer.toFormData(data)); } //预定详情 meetDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/detail/' + params); } //会议室列表 getRoomList(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/getRoomList', null); } //部领导列表 getLeaders(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/getLeaders', null); } //保存会议申请 saveApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/saveApply', data); } }
\ No newline at end of file
import {Injectable} from "@angular/core";import {HttpClient} from "@angular/common/http";import {Http} from "@angular/http";import {Observable} from "rxjs/Observable";import {AppGlobal} from "../../service/http.service";import {CommonService} from "../../provide/common.service"; @Injectable()export class ServeService { constructor( private http: HttpClient, //该请求 将结果转为json private commonSer: CommonService, private https: Http, //该请求不转json ) { } getAllOrganization(data): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/sysmanagement/org/getAllOrganization?' + this.commonSer.toQuery(data)); } /** 物品领用 **/ //办公用品列表 searchSupplies(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/officesupplies/searchSupplies', this.commonSer.toFormData(data)); } //物品详情 supplyDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/detail/' + params); } //保存订单 saveOrder(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/saveOrder', data); } //查询订单 myOrder(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/myOrder', this.commonSer.toFormData(data)); } //类型列表 getTypeList(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/officesupplies/getTypeList', null); } //购物车 shoppingCar(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/shoppingCar', this.commonSer.toFormData(data)); } //更新购物车 saveOrderSuppy(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/saveOrderSuppy', data); } //删除购物车物品 deleteOrderSuppy(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/ordermanage/deleteOrderSuppy/' + params); } /** 会议室预定 **/ queryMeetingRoomByDate(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/queryMeetingRoomByDate', this.commonSer.toFormData(data)); } //预定详情 meetDetail(params): Observable<any> { return this.http.get(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/detail/' + params); } //会议室列表 getRoomList(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/getRoomList', null); } //部领导列表 getLeaders(): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/getLeaders', null); } //保存会议申请 saveApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/meetingapply/saveApply', data); } /** 用车申请 **/ saveCarApply(data): Observable<any> { return this.http.post(AppGlobal.domain + '/wisdomgroup/modules/carapply/saveApply', data); } }
\ No newline at end of file
......
<ion-header>
<ion-navbar>
<ion-title>用车申请</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
</ion-content>
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
@Component({
selector: 'page-car-apply',
templateUrl: 'car-apply.html',
})
export class CarApplyPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad CarApplyPage');
}
}
<!--
Generated template for the UseCarPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>useCar</ion-title>
</ion-navbar>
<ion-title>用车申请</ion-title>
<ion-buttons end>
<button ion-button (click)="addMeet()">
<span ion-text style="font-size: 1.4rem" class="color-fff margin-right-10">申请用车</span>
</button>
</ion-buttons>
</ion-navbar>
<div class="duty">
<div class="dutyItem" (click)="change(1)">
<span class="{{changeType == 1?'duty-title':''}}">用车安排</span>
</div>
<div class="dutyItem" (click)="change(2)">
<span class="{{changeType == 2?'duty-title':''}}">我的申请</span>
</div>
</div>
</ion-header>
<ion-content padding>
<ion-content>
<ion-content direction="y" scrollbar-y="true">
<ng-container *ngIf="changeType == 1">
<ion-calendar [(ngModel)]="date"
(onChange)="getApply($event)"
[options]="options"
type="string"
format="YYYY-MM-DD">
</ion-calendar>
<div class="room">
<div class="already">
<p>已预定会议室</p>
<div class="morning">
<div class="morning-text">
上午
</div>
<div class="morning-room">
<span (click)="goApplyEdit(item1)" *ngFor="let item1 of room?.morningUse">
{{item1.name}}(已预定)
</span>
</div>
</div>
<div class="afternoon">
<div class="afternoon-text">
下午
</div>
<div class="morning-room">
<span (click)="goApplyEdit(item2)" *ngFor="let item2 of room?.afternoonUse">
{{item2.name}}(已预定)
</span>
</div>
</div>
</div>
<div class="notYet">
<p>可预定会议室</p>
<div class="morning">
<div class="morning-text">
上午
</div>
<div class="morning-room">
<span (click)="goApply()" *ngFor="let item3 of room?.morningNotUse">
{{item3.name}}(可预定)
</span>
</div>
</div>
<div class="afternoon">
<div class="afternoon-text">
上午
</div>
<div class="morning-room">
<span (click)="goApply()" *ngFor="let item4 of room?.afternoonNotUse">
{{item4.name}}(可预定)
</span>
</div>
</div>
</div>
</div>
</ng-container>
<ng-container *ngIf="changeType == 2">
<div class="duty-content">
</div>
</ng-container>
</ion-content>
</ion-content>
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { UseCarPage } from './use-car';
import {NgModule} from '@angular/core';
import {IonicPageModule} from 'ionic-angular';
import {UseCarPage} from './use-car';
import {CarApplyPage} from "./car-apply/car-apply";
import {CalendarModule} from "ion2-calendar";
@NgModule({
declarations: [
UseCarPage,
CarApplyPage
],
imports: [
CalendarModule,
IonicPageModule.forChild(UseCarPage),
],
entryComponents: [
CarApplyPage
]
})
export class UseCarPageModule {}
export class UseCarPageModule {
}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
/**
* Generated class for the UseCarPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
import {CalendarComponentOptions} from "ion2-calendar";
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";
@IonicPage()
@Component({
......@@ -15,11 +13,51 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
})
export class UseCarPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
changeType = 1;
date = new Date();
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat: monthCh,
pickMode: 'single',
color: 'danger'
};
room;
constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public datePipe: DatePipe) {
}
ionViewDidEnter() {
const date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
this.getApply(date);
}
getApply(date) {
const data = {'dateStr': date}
this.serveSer.queryMeetingRoomByDate(data).subscribe(
(res) => {
this.room = res.data;
}
)
}
addMeet() {
this.navCtrl.push(RoomApplyPage);
}
change(type) {
this.changeType = type;
}
goApplyEdit(item) {
this.navCtrl.push(RoomApplyPage, {id: item.applyId});
}
ionViewDidLoad() {
console.log('ionViewDidLoad UseCarPage');
goApply() {
this.navCtrl.push(RoomApplyPage);
}
}
......@@ -88,14 +88,12 @@
</div>
</div>
<div id="swiper-discover" class="swiper-container">
<div class="swiper-wrapper">
<ng-container *ngFor="let new of slideList;let i = index;">
<div class="swiper-slide">
<ion-slides #contentSlides>
<ng-container *ngFor="let new of slideArr;let i = index;">
<ion-slide>
<ion-content>
<div class="search-content">
<ng-container *ngFor="let item of new;">
<ng-container *ngFor="let item of slideList[i];">
<div *ngIf="obj.childrenName != '你问我答'" class="search-item" (click)="goToDetail(item)">
<p class="item-info">
<span class="item-source">{{item.source}}</span>
......@@ -109,7 +107,7 @@
<ng-container *ngIf="item.resourceType == 1">
<ion-col col-8 class="news-left">
<p class="news-title">{{item.title}}
<ion-icon *ngIf="new.topTime"
<ion-icon *ngIf="item.topTime"
class="icon-fire iconfont"></ion-icon>
</p>
</ion-col>
......@@ -120,7 +118,7 @@
<ng-container *ngIf="item.resourceType == 2">
<ion-col col-12 class="news-left">
<p class="news-title">{{item.title}}
<ion-icon *ngIf="new.topTime"
<ion-icon *ngIf="item.topTime"
class="icon-fire iconfont"></ion-icon>
</p>
</ion-col>
......@@ -129,7 +127,7 @@
<ng-container *ngIf="item.resourceType == 3">
<ion-col col-12 class="news-left">
<p class="news-title">{{item.title}}
<ion-icon *ngIf="new.topTime"
<ion-icon *ngIf="item.topTime"
class="icon-fire iconfont"></ion-icon>
</p>
<div style="width: 100%;max-height: 180px;">
......@@ -149,7 +147,7 @@
<ng-container *ngIf="!item.path">
<ion-col col-12 class="news-left">
<p class="news-title">{{item.title}}
<ion-icon *ngIf="new.topTime"
<ion-icon *ngIf="item.topTime"
class="icon-fire iconfont"></ion-icon>
</p>
</ion-col>
......@@ -180,11 +178,15 @@
</div>
</ng-container>
</div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content
loadingSpinner="bubbles"
loadingText="加载中"></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
</div>
</ion-slide>
</ng-container>
</div>
</div>
</ion-slides>
<ion-fab *ngIf="indexChildren == '55'" right bottom>
<button ion-fab color="light" (click)="issue()">
......
......@@ -32,6 +32,7 @@ export class DiscoverPage {
@ViewChild('scrollTab') scrollTab: ElementRef;
@ViewChild(Content) content: Content;
@ViewChild('slideContent') slideContent: Content;
@ViewChild(Slides) slides: Slides;
//所属板块类型:
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
......@@ -194,13 +195,14 @@ export class DiscoverPage {
noReadNum;
slideList = [];
slideList = new Array(7); //数组的改变 会导致上拉加载更多失效。。
slideArr = new Array(7);
toIndex;
//分页
pageCount = AppGlobal.pageCount;
pageNum = 1;
totalNum; //总条数
isPublish = false;
swiper;
......@@ -237,7 +239,6 @@ export class DiscoverPage {
});
this.initSwiper();
this.getBanner();
this.slideList.length = 7;
this.scrollHeight();
timer(20).subscribe(() => {
this.itemWidth = window.screen.width / 4;
......@@ -279,33 +280,6 @@ export class DiscoverPage {
//初始化swiper
initSwiper() {
let that = this;
that.swiper = new Swiper('#swiper-discover', {
speed: 1000,
autoplay: false,
observer: true,
observeParents: true,
observeSlideChildren: true,
loop: false,
on: {
slideChangeTransitionEnd: function () {
that.swiper.update();
that.changeParent(that.tabsList[this.activeIndex]);
const distancs = this.activeIndex * that.itemWidth / 2; //滑动的长度
that.newContentParent.nativeElement.scrollLeft = distancs;
// let scrollInter = window.setInterval(() => {
// if (distancs == that.newContentParent.nativeElement.scrollLeft) {
// window.clearInterval(scrollInter);
// } else if (distancs > that.newContentParent.nativeElement.scrollLeft) {
// that.newContentParent.nativeElement.scrollLeft++;
// } else if (distancs < that.newContentParent.nativeElement.scrollLeft) {
// that.newContentParent.nativeElement.scrollLeft--;
// } else {
// window.clearInterval(scrollInter);
// }
// }, 1)
}
}
});
that.swiperImg = new Swiper('#swiper-slide', {
speed: 1000,
autoplay: {
......@@ -410,21 +384,21 @@ export class DiscoverPage {
this.tabsSer.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) {
if(e.attachments[0].resourceType != 2){
if (e.attachments[0].resourceType != 2) {
e.path = e.attachments[0].path;
e.resourceType = e.attachments[0].resourceType;
}else if(e.attachments.length > 1){
} else if (e.attachments.length > 1) {
e.path = e.attachments[1].path;
e.resourceType = e.attachments[1].resourceType;
}
}
});
this.swiper.slideTo(this.indexParent, 500);
this.slides.slideTo(this.indexParent, 500);
this.slideList[this.indexParent] = this.newList;
console.log(this.newList);
this.getMore(res);
}
)
}
......@@ -547,6 +521,38 @@ export class DiscoverPage {
)
}
//上拉加载更多
doInfinite(e) {
if (this.totalNum == this.slideList[this.indexParent]) {
e.complete();
return false;
}
this.pageNum++;
const data = {
pageNum: this.pageNum,
pageCount: this.pageCount,
isRecent: this.isRecent,
obj: {
'plateType': this.obj.plateType,
'resourceType': this.resourceType,
"relatePlateType": this.relatePlateType
}
};
this.tabsSer.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.slideList[this.indexParent].push(e);
});
e.complete();
}
)
}
//前往搜索页面
goToSearch() {
this.navCtrl.push(SearchNewPage);
......@@ -620,5 +626,9 @@ export class DiscoverPage {
}
}
slideChanged() {
}
}
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