Commit 01942776 authored by wangqinghua's avatar wangqinghua

签到发布

parent 500b0360
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.partyCloud.starter.test" version="0.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="io.ionic.partyCloud.starter.test" version="0.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>部机关党建云(测试)</name> <name>部机关党建云(测试)</name>
<description>An awesome Ionic/Cordova app.</description> <description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author> <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
......
[{"name":"main","index":0,"scopes":["PROJECT","EXTERNAL_LIBRARIES","SUB_PROJECTS"],"types":["DEX"],"format":"DIRECTORY","present":true}] [{"name":"main","index":0,"scopes":["EXTERNAL_LIBRARIES","SUB_PROJECTS","PROJECT"],"types":["DEX"],"format":"DIRECTORY","present":true}]
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,7 @@ import {Response} from "@angular/http"; ...@@ -12,6 +12,7 @@ import {Response} from "@angular/http";
import {TabsPage} from "../pages/tabs/tabs"; import {TabsPage} from "../pages/tabs/tabs";
import {Geolocation} from "@ionic-native/geolocation"; import {Geolocation} from "@ionic-native/geolocation";
import {AppService} from "../service/http.service"; import {AppService} from "../service/http.service";
import {EmitService} from "../provide/emit.service";
@Component({ @Component({
templateUrl: 'app.html' templateUrl: 'app.html'
...@@ -31,8 +32,7 @@ export class MyApp { ...@@ -31,8 +32,7 @@ export class MyApp {
appUpdateService: AppUpdateService, appUpdateService: AppUpdateService,
appVersion: AppVersion, appVersion: AppVersion,
private geolocation: Geolocation, private geolocation: Geolocation,
badge: Badge, public emitSer:EmitService,
// public navCtrl: NavController,
public storage: Storage, public storage: Storage,
public appService: AppService) { public appService: AppService) {
platform.ready().then(() => { platform.ready().then(() => {
...@@ -88,7 +88,7 @@ export class MyApp { ...@@ -88,7 +88,7 @@ export class MyApp {
}else{ }else{
this.rootPage = LoginPage; this.rootPage = LoginPage;
} }
this.getNoRead();
} }
else { else {
this.rootPage = LoginPage; this.rootPage = LoginPage;
...@@ -96,4 +96,18 @@ export class MyApp { ...@@ -96,4 +96,18 @@ export class MyApp {
}); });
} }
getNoRead(){
this.appService.ObserverHttpPost("/wisdomgroup/modules/message/findAllActivityForAppWithXQ", null)
.subscribe((res: Response) => {
let data = res.json();
let num = 0;
data.forEach(e=>{
if(e.isRead == 0) num++;
})
this.emitSer.eventEmit.emit(num);
}, error => {
}
);
}
} }
@import "../theme/icon"; @import "../theme/icon";
@import "../theme/style"; @import "../theme/style";
@import "../assets/iconfont/iconfont"; @import "../assets/iconfont/iconfont";
html{
font-family: "Noto Sans CJK SC", "Source Han Sans CN";
}
//html,ion-app.ios{ //html,ion-app.ios{
// font-family: "webfont",serif !important; // font-family: "webfont",serif !important;
// font-style: normal; // font-style: normal;
...@@ -304,6 +307,13 @@ p { ...@@ -304,6 +307,13 @@ p {
height: 50%; height: 50%;
overflow: scroll; overflow: scroll;
} }
.close{
position: absolute;
top: 5px;
right: 10px;
color: #666666;
font-size: 2.5rem;
}
} }
} }
a[disabled], button[disabled], [ion-button][disabled], a[disabled], button[disabled], [ion-button][disabled],
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons end> <ion-buttons end>
<button ion-button icon-only class="toolbar-icon"> <button ion-button icon-only (click)="goToNotice()" class="toolbar-icon">
<ion-icon class="icon-youjian iconfont"></ion-icon> <ion-icon class="icon-youjian iconfont"></ion-icon>
<span class="num">2</span> <span *ngIf="noReadNum > 0" class="num">{{noReadNum}}</span>
</button> </button>
</ion-buttons> </ion-buttons>
</ion-navbar> </ion-navbar>
......
...@@ -4,6 +4,8 @@ import {SearchNewPage} from "../../home-pages/search-new/search-new"; ...@@ -4,6 +4,8 @@ import {SearchNewPage} from "../../home-pages/search-new/search-new";
import {TabsService} from "../tabs.service"; import {TabsService} from "../tabs.service";
import {StuffDetailPage} from "../../home-pages/stuff-detail/stuff-detail"; import {StuffDetailPage} from "../../home-pages/stuff-detail/stuff-detail";
import {PublishPage} from "../../discover-pages/publish/publish"; import {PublishPage} from "../../discover-pages/publish/publish";
import {EmitService} from "../../../provide/emit.service";
import {NoticePage} from "../notice/notice";
@IonicPage() @IonicPage()
...@@ -27,8 +29,15 @@ export class DiscoverPage { ...@@ -27,8 +29,15 @@ export class DiscoverPage {
index = 0; index = 0;
isSign = false; isSign = false;
newList; //新闻列表 newList; //新闻列表
noReadNum;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public tabsSer:TabsService) { public tabsSer:TabsService,public emitSer:EmitService) {
// 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => {
if(!isNaN(value)){
this.noReadNum = value;
}
});
} }
ionViewDidEnter() { ionViewDidEnter() {
...@@ -76,4 +85,9 @@ export class DiscoverPage { ...@@ -76,4 +85,9 @@ export class DiscoverPage {
this.navCtrl.push(PublishPage); this.navCtrl.push(PublishPage);
} }
//消息提醒页面
goToNotice(){
this.navCtrl.push(NoticePage);
}
} }
...@@ -10,14 +10,17 @@ ...@@ -10,14 +10,17 @@
<ion-icon class="search-icon" name="search"></ion-icon> <ion-icon class="search-icon" name="search"></ion-icon>
</ion-buttons> </ion-buttons>
<ion-buttons end> <ion-buttons end>
<button ion-button icon-only (click)="isSign = true" class="toolbar-signUp"> <button ion-button icon-only *ngIf="signObj.isSign == 'no'" (click)="signNow()" class="toolbar-signUp">
<span class="signUp-span" >签到</span> <span class="signUp-span">签到</span>
</button>
<button ion-button icon-only *ngIf="signObj.isSign == 'yes'" class="toolbar-signUp">
<span class="signUp-span">已签到</span>
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons end> <ion-buttons end>
<button ion-button icon-only class="toolbar-icon"> <button ion-button icon-only (click)="goToNotice()" class="toolbar-icon">
<ion-icon class="icon-youjian iconfont"></ion-icon> <ion-icon class="icon-youjian iconfont"></ion-icon>
<span class="num">2</span> <span *ngIf="noReadNum > 0" class="num">{{noReadNum}}</span>
</button> </button>
</ion-buttons> </ion-buttons>
</ion-navbar> </ion-navbar>
...@@ -26,7 +29,7 @@ ...@@ -26,7 +29,7 @@
<div style="height: 160px"> <div style="height: 160px">
<ion-slides #slides *ngIf="slidersItems.length>0" pager loop="true" autoplay="2000" speed="1500"> <ion-slides #slides *ngIf="slidersItems.length>0" pager loop="true" autoplay="2000" speed="1500">
<ion-slide style="height:160px;width: 100%;position: relative" *ngFor="let item of slidersItems;"> <ion-slide style="height:160px;width: 100%;position: relative" *ngFor="let item of slidersItems;">
<img src="{{picture+item.pictureId}}" class="slide-image" (click)="go(item)"> <img src="{{picture+item.pictureId}}" class="slide-image" (click)="goToDetail(item)">
<p class="slides-title">{{item.title}}</p> <p class="slides-title">{{item.title}}</p>
</ion-slide> </ion-slide>
</ion-slides> </ion-slides>
...@@ -70,12 +73,12 @@ ...@@ -70,12 +73,12 @@
</ion-content> </ion-content>
<div *ngIf="isSign" class="signMask"> <div *ngIf="isSign" class="signMask">
<div class="mask-content"> <div class="mask-content">
<ion-icon class="close" (click)="isSign = false" name="close"></ion-icon>
<div class="record-conten"> <div class="record-conten">
"进入新时代,国际国内形势发生广泛而深刻的变化,改革发展面临着新形势新任务新挑战, {{signObj.text}}
我们要抓住机遇、迎接挑战,关键在于高举新时代改革开放旗帜,继续全面深化改革。"
</div> </div>
<div class="mask-button"> <div class="mask-button">
<button class="submit-btn submit" (click)="signUp()">签到</button> <button *ngIf="signObj.isSign == 'no'" [disabled]="disabledClick" class="submit-btn submit" (click)="signUp()">签到{{signText}}</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -156,6 +156,9 @@ page-home { ...@@ -156,6 +156,9 @@ page-home {
width: 50%; width: 50%;
height: 35px; height: 35px;
} }
a[disabled], button[disabled], [ion-button][disabled]{
opacity: .4;
}
} }
} }
...@@ -20,6 +20,7 @@ import {TextToSpeech} from "@ionic-native/text-to-speech"; ...@@ -20,6 +20,7 @@ import {TextToSpeech} from "@ionic-native/text-to-speech";
import {CommonService} from "../../../provide/common.service"; import {CommonService} from "../../../provide/common.service";
import {SearchNewPage} from "../../home-pages/search-new/search-new"; import {SearchNewPage} from "../../home-pages/search-new/search-new";
import {StuffDetailPage} from "../../home-pages/stuff-detail/stuff-detail"; import {StuffDetailPage} from "../../home-pages/stuff-detail/stuff-detail";
import {EmitService} from "../../../provide/emit.service";
declare var Swiper; declare var Swiper;
...@@ -42,20 +43,33 @@ export class HomePage { ...@@ -42,20 +43,33 @@ export class HomePage {
isSign = false; isSign = false;
newList = []; newList = [];
noReadNum;
signObj = {
'text':'',
'isSign':''
}; //签到参数
disabledClick = true;
signText; 签到倒计时
constructor(public navCtrl: NavController,public tts:TextToSpeech, constructor(public navCtrl: NavController,public tts:TextToSpeech,
public commonSer:CommonService, public commonSer:CommonService,public emitSer:EmitService,
public appService: AppService, public http: Http, private calendar: Calendar, public storage: Storage, public appService: AppService, public http: Http, private calendar: Calendar, public storage: Storage,
public badge: Badge, public tabsSer: TabsService) { public badge: Badge, public tabsSer: TabsService) {
// 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => {
if(!isNaN(value)){
this.noReadNum = value;
}
});
} }
ionViewDidLoad(){ ionViewDidLoad(){
this.tabsSer.getBanner().subscribe( this.tabsSer.signNow().subscribe(
(res)=>{ (res)=>{
this.slidersItems = res; this.signObj = res.data;
} }
) )
this.change(0); this.change(0);
...@@ -114,6 +128,22 @@ export class HomePage { ...@@ -114,6 +128,22 @@ export class HomePage {
) )
} }
//签到
signNow(){
this.isSign = true;
let totalTime = 5;
this.signText = '(倒计时'+ totalTime + 's)';
let clock = window.setInterval(() => {
totalTime--;
this.signText = '(倒计时'+ totalTime + 's)';
if (totalTime < 0) {
this.signText = '';
window.clearInterval(clock);
this.disabledClick = false;
}
}, 1000)
}
//查看文章详情 //查看文章详情
goToDetail(item){ goToDetail(item){
this.navCtrl.push(StuffDetailPage,{ this.navCtrl.push(StuffDetailPage,{
...@@ -126,4 +156,10 @@ export class HomePage { ...@@ -126,4 +156,10 @@ export class HomePage {
this.navCtrl.push(SearchNewPage); this.navCtrl.push(SearchNewPage);
} }
//消息提醒页面
goToNotice(){
this.navCtrl.push(NoticePage);
}
} }
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons end> <ion-buttons end>
<button ion-button icon-only class="toolbar-icon"> <button ion-button icon-only (click)="goToNotice()" class="toolbar-icon">
<ion-icon class="icon-youjian iconfont"></ion-icon> <ion-icon class="icon-youjian iconfont"></ion-icon>
<span class="num">2</span> <span *ngIf="noReadNum > 0" class="num">{{noReadNum}}</span>
</button> </button>
</ion-buttons> </ion-buttons>
</ion-navbar> </ion-navbar>
......
...@@ -15,6 +15,8 @@ import {AppUpdateService} from "../../../service/appUpdate.service"; ...@@ -15,6 +15,8 @@ import {AppUpdateService} from "../../../service/appUpdate.service";
import {MyDutyPage} from "../../mine/my-duty/my-duty"; import {MyDutyPage} from "../../mine/my-duty/my-duty";
import {MySurveyPage} from "../../home/mySurvey/my-survey/my-survey"; import {MySurveyPage} from "../../home/mySurvey/my-survey/my-survey";
import {TabsService} from "../tabs.service"; import {TabsService} from "../tabs.service";
import {EmitService} from "../../../provide/emit.service";
import {NoticePage} from "../notice/notice";
@Component({ @Component({
...@@ -32,16 +34,23 @@ export class MinePage { ...@@ -32,16 +34,23 @@ export class MinePage {
picUrl; picUrl;
mineInfo; mineInfo;
noReadNum;
constructor(public navCtrl: NavController, constructor(public navCtrl: NavController,
private appCtrl: App, private appCtrl: App,
private alertCtrl: AlertController, private alertCtrl: AlertController,
public navParams: NavParams, public navParams: NavParams,
public tabSer:TabsService, public tabSer:TabsService,
public appService: AppService, public appService: AppService,
public emitSer:EmitService,
public storage: Storage,public app:App, public storage: Storage,public app:App,
private appUpdateService: AppUpdateService, private appUpdateService: AppUpdateService,
private appVersion: AppVersion) { private appVersion: AppVersion) {
// 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => {
if(!isNaN(value)){
this.noReadNum = value;
}
});
} }
ionViewWillEnter() { ionViewWillEnter() {
...@@ -128,4 +137,9 @@ export class MinePage { ...@@ -128,4 +137,9 @@ export class MinePage {
goDuty() { goDuty() {
this.navCtrl.push("MyDutyPage"); this.navCtrl.push("MyDutyPage");
} }
//消息提醒页面
goToNotice(){
this.navCtrl.push(NoticePage);
}
} }
import { Component } from '@angular/core'; import {Component} from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {Response} from "@angular/http"; import {Response} from "@angular/http";
import {AppService} from "../../../service/http.service"; import {AppService} from "../../../service/http.service";
import {Badge} from "@ionic-native/badge"; import {Badge} from "@ionic-native/badge";
import {EmitService} from "../../../provide/emit.service";
@IonicPage() @IonicPage()
@Component({ @Component({
selector: 'page-notice', selector: 'page-notice',
templateUrl: 'notice.html', templateUrl: 'notice.html',
}) })
export class NoticePage { export class NoticePage {
noticeList; noticeList;
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService:AppService,public badge:Badge) {
}
ionViewDidEnter() { constructor(public navCtrl: NavController, public navParams: NavParams,
this.appService.ObserverHttpPost("/wisdomgroup/modules/message/findAllActivityForAppWithXQ",null) public emitSer:EmitService,
.subscribe((res: Response) => { public appService: AppService, public badge: Badge) {
let data = res.json(); }
ionViewDidEnter() {
this.appService.ObserverHttpPost("/wisdomgroup/modules/message/findAllActivityForAppWithXQ", null)
.subscribe((res: Response) => {
let data = res.json();
this.noticeList = data; this.noticeList = data;
this.addRecodings(); this.addRecodings();
}, error => { }, error => {
} }
); );
} }
//增加阅读记录 //增加阅读记录
addRecodings(){ addRecodings() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/message/addRecodings", null) this.appService.ObserverHttpGet("/wisdomgroup/modules/message/addRecodings", null)
.subscribe((res: Response) => { .subscribe((res: Response) => {
this.badge.clear(); this.badge.clear();
this.emitSer.eventEmit.emit(0);
}, error => { }, error => {
} }
); );
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons end> <ion-buttons end>
<button ion-button icon-only class="toolbar-icon"> <button ion-button icon-only (click)="goToNotice()" class="toolbar-icon">
<ion-icon class="icon-youjian iconfont"></ion-icon> <ion-icon class="icon-youjian iconfont"></ion-icon>
<span class="num">2</span> <span *ngIf="noReadNum > 0" class="num">{{noReadNum}}</span>
</button> </button>
</ion-buttons> </ion-buttons>
</ion-navbar> </ion-navbar>
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</div> </div>
</div> </div>
<div class="item3" style="padding-top: 0px;"> <div class="item3" style="padding-top: 0px;">
<div class="item3-2" style="background-color:#f8f8f8;" (click)="gotoNotice()"> <div class="item3-2" style="background-color:#f8f8f8;" (click)="goToNotice()">
<div class="card3" style="width: 15%;"> <div class="card3" style="width: 15%;">
<span *ngIf="hasNew.message == 1" class="img-tips"></span> <span *ngIf="hasNew.message == 1" class="img-tips"></span>
<img src="./assets/imgs/home/icon-mail.png" > <img src="./assets/imgs/home/icon-mail.png" >
......
...@@ -18,352 +18,359 @@ import {Badge} from '@ionic-native/badge'; ...@@ -18,352 +18,359 @@ import {Badge} from '@ionic-native/badge';
import {TabsService} from "../tabs.service"; import {TabsService} from "../tabs.service";
import {TextToSpeech} from "@ionic-native/text-to-speech"; import {TextToSpeech} from "@ionic-native/text-to-speech";
import {CommonService} from "../../../provide/common.service"; import {CommonService} from "../../../provide/common.service";
import {EmitService} from "../../../provide/emit.service";
@IonicPage() @IonicPage()
@Component({ @Component({
selector: 'page-serve', selector: 'page-serve',
templateUrl: 'serve.html' templateUrl: 'serve.html'
}) })
export class ServePage { export class ServePage {
@ViewChild(Slides) slides: Slides; @ViewChild(Slides) slides: Slides;
hasNew = { hasNew = {
activity:0, activity: 0,
notice:0, notice: 0,
premanager:0, premanager: 0,
message:0, message: 0,
test:0, test: 0,
}; };
//日历 //日历
date: string; date: string;
type: 'string'; type: 'string';
optionsMulti: CalendarComponentOptions; optionsMulti: CalendarComponentOptions;
newArr: DayConfig[] = []; newArr: DayConfig[] = [];
//未读通知 //未读通知
NoticeNotreadCount = '0'; NoticeNotreadCount = '0';
//尚未报备 //尚未报备
PremanagerNotdoCount = '0'; PremanagerNotdoCount = '0';
//是否显示正在开发中 //是否显示正在开发中
isWait: boolean = false; isWait: boolean = false;
slidersItems = []; slidersItems = [];
noticeList = []; noticeList = [];
picture: string = AppGlobal.picture; picture: string = AppGlobal.picture;
operations: Array<string>; operations: Array<string>;
//当前年份 //当前年份
year; year;
//当前月份 //当前月份
month; month;
//当前第几周 //当前第几周
weekNo; weekNo;
noticeTips; noticeTips;
role; role;
noReadNum;
constructor(public navCtrl: NavController,public tts:TextToSpeech,
public commonSer:CommonService, constructor(public navCtrl: NavController, public tts: TextToSpeech,
public appService: AppService, public http: Http, private calendar: Calendar, public storage: Storage, public commonSer: CommonService, public emitSer: EmitService,
public badge: Badge, public tabsSer: TabsService) { public appService: AppService, public http: Http, private calendar: Calendar, public storage: Storage,
public badge: Badge, public tabsSer: TabsService) {
} // 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => {
ngOnInit(): void { if (!isNaN(value)) {
this.appService.ObserverHttpGet("/wisdomgroup/modules/message/findAllActivityForAppWithXQ", null).subscribe((res: Response) => { this.noReadNum = value;
this.noticeList = res.json().slice(0, 2); }
}, error => { });
this.appService.alert('系统错误!');
});
}
ionViewDidEnter() {
//获取权限
this.getRole();
//获取消息数量
this.getNewCount();
//获取日历
this.getCalendar();
}
ionViewWillEnter() {
this.slidersItems = [];
this.getHasNew();
//初始化日期
this.appService.ObserverHttpGet("/wisdomgroup/modules/common/file/getBanner", {}).subscribe((res: Response) => {
this.slidersItems = res.json();
}, error => {
})
}
ionViewDidLeave() {
this.newArr = [];
if (this.slides) {
this.slides.stopAutoplay();
} }
}
ngOnInit(): void {
this.appService.ObserverHttpGet("/wisdomgroup/modules/message/findAllActivityForAppWithXQ", null).subscribe((res: Response) => {
this.noticeList = res.json().slice(0, 2);
}, error => {
this.appService.alert('系统错误!');
});
}
//获取权限 ionViewDidEnter() {
getRole() { //获取权限
this.tabsSer.getRoles().subscribe( this.getRole();
(res) => { //获取消息数量
this.role = res this.getNewCount();
}, //获取日历
error => { this.getCalendar();
this.appService.alert('系统错误!');
}
)
}
wait() {
this.isWait = true;
}
cancleWait() {
this.isWait = false;
}
go(item) {
if (item.type == 1) {
this.getActivity(item.id);
} else if (item.type == 2) {
this.getPremanager(item.id);
} else if (item.type == 3) {
this.navCtrl.push("AnnouncementViewPage", {
id: item.id
});
} }
}
ionViewWillEnter() {
//获取活动ById this.slidersItems = [];
getActivity(id) { this.getHasNew();
this.appService.ObserverHttpPost("/wisdomgroup/modules/activity/appFindById", {id: id}) //初始化日期
.toPromise() this.appService.ObserverHttpGet("/wisdomgroup/modules/common/file/getBanner", {}).subscribe((res: Response) => {
.then(res => { this.slidersItems = res.json();
let activity = res.json(); }, error => {
this.navCtrl.push('ActivityDetailPage', {id: activity.id});
}) })
.catch(error => {
});
}
//获取报备
getPremanager(id) {
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
this.storage.remove("person");
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/findById", {id: id}).subscribe((res) => {
let premanager = res.json();
this.storage.set("premanager", premanager);
this.navCtrl.push("OutGoingReportEditPage");
})
}
//消息通知
gotoNotice() {
this.navCtrl.setRoot(NoticePage);
this.navCtrl.parent.select(2);
}
//外出报备跳转
goOutGoingReportAboutAll() {
this.navCtrl.push("OutGoingReportPage", {
type: 1
});
}
//前往
goTo(page) {
this.navCtrl.push(page);
}
readBook(){
this.tts.speak({text: "你好,欢迎,向前走10米,路口右转,执行10米,在左转", locale: 'zh-CN'})
.then(() => {
console.log('Success');
}).catch((reason: any) => {
console.error('Error', reason);
});
}
/**
* 获取是否有新的信息
*/
getHasNew(){
//获取是否有新活动
this.tabsSer.hasNewActivity().subscribe(
(res)=>{
this.hasNew.activity = res;
}
)
//获取是否有新通知 }
this.tabsSer.hasNewNotice().subscribe(
(res)=>{
this.hasNew.notice = res;
}
)
//获取是否有新通知 ionViewDidLeave() {
this.tabsSer.hasNewMessage().subscribe( this.newArr = [];
(res)=>{ if (this.slides) {
this.hasNew.message = res; this.slides.stopAutoplay();
} }
) }
//获取是否有新报备
this.tabsSer.hasNewPremanager().subscribe(
(res)=>{
this.hasNew.premanager = res;
}
)
//获取是否有新问卷 //获取权限
this.tabsSer.hasNewTest().subscribe( getRole() {
(res)=>{ this.tabsSer.getRoles().subscribe(
this.hasNew.test = res; (res) => {
this.role = res
},
error => {
this.appService.alert('系统错误!');
}
)
}
wait() {
this.isWait = true;
}
cancleWait() {
this.isWait = false;
}
go(item) {
if (item.type == 1) {
this.getActivity(item.id);
} else if (item.type == 2) {
this.getPremanager(item.id);
} else if (item.type == 3) {
this.navCtrl.push("AnnouncementViewPage", {
id: item.id
});
} }
) }
}
//获取活动ById
//获取所有未读消息的数量--->设置角标 getActivity(id) {
getNewCount() { this.appService.ObserverHttpPost("/wisdomgroup/modules/activity/appFindById", {id: id})
this.appService.ObserverHttpGetData('/wisdomgroup/modules/activity/hasNewCount', null) .toPromise()
.subscribe((res) => { .then(res => {
let data = Number(res.json()); let activity = res.json();
this.noticeTips = data; this.navCtrl.push('ActivityDetailPage', {id: activity.id});
console.log(this.noticeTips) })
if (data > 0) { .catch(error => {
this.badge.set(data); });
} else { }
this.badge.clear();
}
//获取报备
getPremanager(id) {
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
this.storage.remove("person");
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/findById", {id: id}).subscribe((res) => {
let premanager = res.json();
this.storage.set("premanager", premanager);
this.navCtrl.push("OutGoingReportEditPage");
}) })
} }
//日历 //外出报备跳转
goOutGoingReportAboutAll() {
getCalendar() { this.navCtrl.push("OutGoingReportPage", {
this.newArr = []; type: 1
let date = new Date(); });
let year = date.getFullYear(); }
let month = date.getMonth() + 1;
//前往
//2.参加活动日期 goTo(page) {
this.tabsSer.appOrderCal().subscribe( this.navCtrl.push(page);
(order)=>{ }
order.forEach(event => {
this.newArr.push({ readBook() {
date: new Date(event.batch.batchGoDate), this.tts.speak({text: "你好,欢迎,向前走10米,路口右转,执行10米,在左转", locale: 'zh-CN'})
disable: true, .then(() => {
cssClass: 'dayOff2' console.log('Success');
}).catch((reason: any) => {
console.error('Error', reason);
});
}
/**
* 获取是否有新的信息
*/
getHasNew() {
//获取是否有新活动
this.tabsSer.hasNewActivity().subscribe(
(res) => {
this.hasNew.activity = res;
}
)
//获取是否有新通知
this.tabsSer.hasNewNotice().subscribe(
(res) => {
this.hasNew.notice = res;
}
)
//获取是否有新通知
this.tabsSer.hasNewMessage().subscribe(
(res) => {
this.hasNew.message = res;
}
)
//获取是否有新报备
this.tabsSer.hasNewPremanager().subscribe(
(res) => {
this.hasNew.premanager = res;
}
)
//获取是否有新问卷
this.tabsSer.hasNewTest().subscribe(
(res) => {
this.hasNew.test = res;
}
)
}
//获取所有未读消息的数量--->设置角标
getNewCount() {
this.appService.ObserverHttpGetData('/wisdomgroup/modules/activity/hasNewCount', null)
.subscribe((res) => {
let data = Number(res.json());
this.noticeTips = data;
console.log(this.noticeTips)
if (data > 0) {
this.badge.set(data);
} else {
this.badge.clear();
}
}) })
}); }
this.tabsSer.appPreCal().subscribe( //日历
(pre)=>{
pre.forEach(event => { getCalendar() {
this.newArr.push({ this.newArr = [];
date: new Date(event.formshTime), let date = new Date();
disable: true, let year = date.getFullYear();
cssClass: 'dayOff4' let month = date.getMonth() + 1;
})
//2.参加活动日期
this.tabsSer.appOrderCal().subscribe(
(order) => {
order.forEach(event => {
this.newArr.push({
date: new Date(event.batch.batchGoDate),
disable: true,
cssClass: 'dayOff2'
})
}); });
this.loadEvent(year, month); this.tabsSer.appPreCal().subscribe(
} (pre) => {
) pre.forEach(event => {
} this.newArr.push({
); date: new Date(event.formshTime),
} disable: true,
cssClass: 'dayOff4'
})
});
this.loadEvent(year, month);
}
)
}
);
}
loadEvent(year, month) { loadEvent(year, month) {
//5.获取每月值班信息 //5.获取每月值班信息
const data = { const data = {
date: year + '/' + month + '/01' date: year + '/' + month + '/01'
}; };
this.tabsSer.getMyScheduleOnMonth(data).subscribe( this.tabsSer.getMyScheduleOnMonth(data).subscribe(
(schedule)=>{ (schedule) => {
for (let i = 0; i < schedule.length; i++) { for (let i = 0; i < schedule.length; i++) {
const ev = { const ev = {
date: new Date(schedule[i].dutyDate), date: new Date(schedule[i].dutyDate),
disable: true, disable: true,
cssClass: 'dayOff3' cssClass: 'dayOff3'
}; };
this.newArr.push(ev); this.newArr.push(ev);
} }
this.tabsSer.getFestivalAboutMonth(data).subscribe( this.tabsSer.getFestivalAboutMonth(data).subscribe(
(festival)=>{ (festival) => {
festival.forEach(event => { festival.forEach(event => {
const data = { const data = {
date: new Date(event.date), date: new Date(event.date),
disable: true,
cssClass: 'dayOff1'
};
this.newArr.push(data);
});
this.setCalendar(year, month);
}
)
}
)
}
setCalendar(year, month) {
let date = new Date();
//4.每月的周末
let d = new Date(year, month, 0).getDate();
for (let i = 1; i < d + 1; i++) {
date.setFullYear(year, month - 1, i);
let day = date.getDay();
if (day == 6 || day == 0) {
const data = {
date: new Date(year, month - 1, i),
disable: true, disable: true,
cssClass: 'dayOff1' cssClass: 'dayOff1'
}; };
this.newArr.push(data); this.newArr.push(data);
}); }
this.setCalendar(year, month);
}
)
} }
)
this.optionsMulti = {
} pickMode: 'multi',
monthFormat: 'YYYY 年 MM 月 ',
setCalendar(year, month) { weekdays: weekDay,
let date = new Date(); monthPickerFormat: monthCh,
//4.每月的周末 weekStart: 0,
let d = new Date(year, month, 0).getDate(); disableWeeks: [0, 1, 2, 3, 4, 5, 6],
for (let i = 1; i < d + 1; i++) { daysConfig: this.newArr
date.setFullYear(year, month - 1, i);
let day = date.getDay();
if (day == 6 || day == 0) {
const data = {
date: new Date(year, month - 1, i),
disable: true,
cssClass: 'dayOff1'
}; };
this.newArr.push(data);
}
} }
this.optionsMulti = { onChange(e) {
pickMode: 'multi', }
monthFormat: 'YYYY 年 MM 月 ',
weekdays: weekDay,
monthPickerFormat: monthCh,
weekStart: 0,
disableWeeks: [0, 1, 2, 3, 4, 5, 6],
daysConfig: this.newArr
};
}
onChange(e) { //月份改变
} monChange(e) {
this.loadEvent(e.newMonth.years, e.newMonth.months);
}
//月份改变 //消息提醒页面
monChange(e) { goToNotice() {
this.loadEvent(e.newMonth.years, e.newMonth.months); this.navCtrl.push(NoticePage);
} }
} }
//定义星期实体 //定义星期实体
export class Week { export class Week {
id: number; id: number;
title: string; title: string;
date: number; date: number;
isToday: boolean = false; isToday: boolean = false;
} }
...@@ -118,8 +118,8 @@ export class TabsService{ ...@@ -118,8 +118,8 @@ export class TabsService{
return this.http.post(AppGlobal.domain +'/wisdomgroup/modules/stuff/updateNumByType',data); return this.http.post(AppGlobal.domain +'/wisdomgroup/modules/stuff/updateNumByType',data);
} }
// //是否签到
signNow(): Observable<any>{
return this.http.get(AppGlobal.domain +'/wisdomgroup/modules/twissign/signNow');
}
} }
\ No newline at end of file
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