Newer
Older
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {CalendarComponentOptions} from "ion2-calendar";
import {DutyApplyPage} from "../duty-apply/duty-apply";
import {DutyDetailPage} from "../duty-detail/duty-detail";
import {DutySignUpPage} from "../duty-sign-up/duty-sign-up";
};
nowDuty = [];
historyDuty;
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
ionViewDidEnter() {
const date = new Date().toLocaleDateString();
this.getDuty(date);
this.myDuty();
selectPageMenu(index) {
this.swiperIndex = index;
//切换页面
// this.contentSlides.slideTo(index);
}
const date = new Date(e).toLocaleDateString();
this.getDuty(date);
}
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleInfo', data)
.subscribe((res) => {
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/getScheduleInfo', data1)
.subscribe((res) => {
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/app/getMySchedule', data)
.subscribe((res) => {
this.nowDuty = res.json();
this.appService.ObserverHttpGetOption('/wisdomgroup/schedule/app/getMySchedule', data1)
.subscribe((res) => {
if (nowTime > item.dutyDate) {
this.appService.popToastView('该条值班已过期', 'middle', 1500);
this.navCtrl.push('DutyApplyPage', {
"id": item.id,
"date": item.dutyDate,
"type":item.type
})
dutyDetail(item) {
this.navCtrl.push('DutyDetailPage', {
"id": item.applyId,
'time': item.dutyDate,