Commit 01942776 authored by wangqinghua's avatar wangqinghua

签到发布

parent 500b0360
<?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>
<description>An awesome Ionic/Cordova app.</description>
<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}]
\ No newline at end of file
[{"name":"main","index":0,"scopes":["EXTERNAL_LIBRARIES","SUB_PROJECTS","PROJECT"],"types":["DEX"],"format":"DIRECTORY","present":true}]
\ No newline at end of file
......@@ -12,6 +12,7 @@ import {Response} from "@angular/http";
import {TabsPage} from "../pages/tabs/tabs";
import {Geolocation} from "@ionic-native/geolocation";
import {AppService} from "../service/http.service";
import {EmitService} from "../provide/emit.service";
@Component({
templateUrl: 'app.html'
......@@ -31,8 +32,7 @@ export class MyApp {
appUpdateService: AppUpdateService,
appVersion: AppVersion,
private geolocation: Geolocation,
badge: Badge,
// public navCtrl: NavController,
public emitSer:EmitService,
public storage: Storage,
public appService: AppService) {
platform.ready().then(() => {
......@@ -88,7 +88,7 @@ export class MyApp {
}else{
this.rootPage = LoginPage;
}
this.getNoRead();
}
else {
this.rootPage = LoginPage;
......@@ -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/style";
@import "../assets/iconfont/iconfont";
html{
font-family: "Noto Sans CJK SC", "Source Han Sans CN";
}
//html,ion-app.ios{
// font-family: "webfont",serif !important;
// font-style: normal;
......@@ -304,6 +307,13 @@ p {
height: 50%;
overflow: scroll;
}
.close{
position: absolute;
top: 5px;
right: 10px;
color: #666666;
font-size: 2.5rem;
}
}
}
a[disabled], button[disabled], [ion-button][disabled],
......
......@@ -16,9 +16,9 @@
</button>
</ion-buttons>
<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>
<span class="num">2</span>
<span *ngIf="noReadNum > 0" class="num">{{noReadNum}}</span>
</button>
</ion-buttons>
</ion-navbar>
......
......@@ -4,6 +4,8 @@ import {SearchNewPage} from "../../home-pages/search-new/search-new";
import {TabsService} from "../tabs.service";
import {StuffDetailPage} from "../../home-pages/stuff-detail/stuff-detail";
import {PublishPage} from "../../discover-pages/publish/publish";
import {EmitService} from "../../../provide/emit.service";
import {NoticePage} from "../notice/notice";
@IonicPage()
......@@ -27,8 +29,15 @@ export class DiscoverPage {
index = 0;
isSign = false;
newList; //新闻列表
noReadNum;
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() {
......@@ -76,4 +85,9 @@ export class DiscoverPage {
this.navCtrl.push(PublishPage);
}
//消息提醒页面
goToNotice(){
this.navCtrl.push(NoticePage);
}
}
......@@ -10,14 +10,17 @@
<ion-icon class="search-icon" name="search"></ion-icon>
</ion-buttons>
<ion-buttons end>
<button ion-button icon-only (click)="isSign = true" class="toolbar-signUp">
<span class="signUp-span" >签到</span>
<button ion-button icon-only *ngIf="signObj.isSign == 'no'" (click)="signNow()" class="toolbar-signUp">
<span class="signUp-span">签到</span>
</button>
<button ion-button icon-only *ngIf="signObj.isSign == 'yes'" class="toolbar-signUp">
<span class="signUp-span">已签到</span>
</button>
</ion-buttons>
<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>
<span class="num">2</span>
<span *ngIf="noReadNum > 0" class="num">{{noReadNum}}</span>
</button>
</ion-buttons>
</ion-navbar>
......@@ -26,7 +29,7 @@
<div style="height: 160px">
<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;">
<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>
</ion-slide>
</ion-slides>
......@@ -70,12 +73,12 @@
</ion-content>
<div *ngIf="isSign" class="signMask">
<div class="mask-content">
<ion-icon class="close" (click)="isSign = false" name="close"></ion-icon>
<div class="record-conten">
"进入新时代,国际国内形势发生广泛而深刻的变化,改革发展面临着新形势新任务新挑战,
我们要抓住机遇、迎接挑战,关键在于高举新时代改革开放旗帜,继续全面深化改革。"
{{signObj.text}}
</div>
<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>
......@@ -156,6 +156,9 @@ page-home {
width: 50%;
height: 35px;
}
a[disabled], button[disabled], [ion-button][disabled]{
opacity: .4;
}
}
}
......@@ -20,6 +20,7 @@ import {TextToSpeech} from "@ionic-native/text-to-speech";
import {CommonService} from "../../../provide/common.service";
import {SearchNewPage} from "../../home-pages/search-new/search-new";
import {StuffDetailPage} from "../../home-pages/stuff-detail/stuff-detail";
import {EmitService} from "../../../provide/emit.service";
declare var Swiper;
......@@ -42,20 +43,33 @@ export class HomePage {
isSign = false;
newList = [];
noReadNum;
signObj = {
'text':'',
'isSign':''
}; //签到参数
disabledClick = true;
signText; 签到倒计时
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 badge: Badge, public tabsSer: TabsService) {
// 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => {
if(!isNaN(value)){
this.noReadNum = value;
}
});
}
ionViewDidLoad(){
this.tabsSer.getBanner().subscribe(
this.tabsSer.signNow().subscribe(
(res)=>{
this.slidersItems = res;
this.signObj = res.data;
}
)
this.change(0);
......@@ -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){
this.navCtrl.push(StuffDetailPage,{
......@@ -126,4 +156,10 @@ export class HomePage {
this.navCtrl.push(SearchNewPage);
}
//消息提醒页面
goToNotice(){
this.navCtrl.push(NoticePage);
}
}
......@@ -6,9 +6,9 @@
</button>
</ion-buttons>
<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>
<span class="num">2</span>
<span *ngIf="noReadNum > 0" class="num">{{noReadNum}}</span>
</button>
</ion-buttons>
</ion-navbar>
......
......@@ -15,6 +15,8 @@ import {AppUpdateService} from "../../../service/appUpdate.service";
import {MyDutyPage} from "../../mine/my-duty/my-duty";
import {MySurveyPage} from "../../home/mySurvey/my-survey/my-survey";
import {TabsService} from "../tabs.service";
import {EmitService} from "../../../provide/emit.service";
import {NoticePage} from "../notice/notice";
@Component({
......@@ -32,16 +34,23 @@ export class MinePage {
picUrl;
mineInfo;
noReadNum;
constructor(public navCtrl: NavController,
private appCtrl: App,
private alertCtrl: AlertController,
public navParams: NavParams,
public tabSer:TabsService,
public appService: AppService,
public emitSer:EmitService,
public storage: Storage,public app:App,
private appUpdateService: AppUpdateService,
private appVersion: AppVersion) {
// 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => {
if(!isNaN(value)){
this.noReadNum = value;
}
});
}
ionViewWillEnter() {
......@@ -128,4 +137,9 @@ export class MinePage {
goDuty() {
this.navCtrl.push("MyDutyPage");
}
//消息提醒页面
goToNotice(){
this.navCtrl.push(NoticePage);
}
}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {Response} from "@angular/http";
import {AppService} from "../../../service/http.service";
import {Badge} from "@ionic-native/badge";
import {EmitService} from "../../../provide/emit.service";
@IonicPage()
......@@ -13,12 +14,14 @@ import {Badge} from "@ionic-native/badge";
export class NoticePage {
noticeList;
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService:AppService,public badge:Badge) {
public emitSer:EmitService,
public appService: AppService, public badge: Badge) {
}
ionViewDidEnter() {
this.appService.ObserverHttpPost("/wisdomgroup/modules/message/findAllActivityForAppWithXQ",null)
this.appService.ObserverHttpPost("/wisdomgroup/modules/message/findAllActivityForAppWithXQ", null)
.subscribe((res: Response) => {
let data = res.json();
this.noticeList = data;
......@@ -29,10 +32,11 @@ export class NoticePage {
}
//增加阅读记录
addRecodings(){
addRecodings() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/message/addRecodings", null)
.subscribe((res: Response) => {
this.badge.clear();
this.emitSer.eventEmit.emit(0);
}, error => {
}
);
......
......@@ -6,9 +6,9 @@
</button>
</ion-buttons>
<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>
<span class="num">2</span>
<span *ngIf="noReadNum > 0" class="num">{{noReadNum}}</span>
</button>
</ion-buttons>
</ion-navbar>
......@@ -80,7 +80,7 @@
</div>
</div>
<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%;">
<span *ngIf="hasNew.message == 1" class="img-tips"></span>
<img src="./assets/imgs/home/icon-mail.png" >
......
......@@ -18,6 +18,7 @@ import {Badge} from '@ionic-native/badge';
import {TabsService} from "../tabs.service";
import {TextToSpeech} from "@ionic-native/text-to-speech";
import {CommonService} from "../../../provide/common.service";
import {EmitService} from "../../../provide/emit.service";
@IonicPage()
......@@ -30,11 +31,11 @@ export class ServePage {
@ViewChild(Slides) slides: Slides;
hasNew = {
activity:0,
notice:0,
premanager:0,
message:0,
test:0,
activity: 0,
notice: 0,
premanager: 0,
message: 0,
test: 0,
};
//日历
......@@ -67,11 +68,18 @@ export class ServePage {
noticeTips;
role;
noReadNum;
constructor(public navCtrl: NavController,public tts:TextToSpeech,
public commonSer:CommonService,
constructor(public navCtrl: NavController, public tts: TextToSpeech,
public commonSer: CommonService, public emitSer: EmitService,
public appService: AppService, public http: Http, private calendar: Calendar, public storage: Storage,
public badge: Badge, public tabsSer: TabsService) {
// 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => {
if (!isNaN(value)) {
this.noReadNum = value;
}
});
}
......@@ -171,12 +179,6 @@ export class ServePage {
})
}
//消息通知
gotoNotice() {
this.navCtrl.setRoot(NoticePage);
this.navCtrl.parent.select(2);
}
//外出报备跳转
goOutGoingReportAboutAll() {
this.navCtrl.push("OutGoingReportPage", {
......@@ -189,7 +191,7 @@ export class ServePage {
this.navCtrl.push(page);
}
readBook(){
readBook() {
this.tts.speak({text: "你好,欢迎,向前走10米,路口右转,执行10米,在左转", locale: 'zh-CN'})
.then(() => {
console.log('Success');
......@@ -201,38 +203,38 @@ export class ServePage {
/**
* 获取是否有新的信息
*/
getHasNew(){
getHasNew() {
//获取是否有新活动
this.tabsSer.hasNewActivity().subscribe(
(res)=>{
(res) => {
this.hasNew.activity = res;
}
)
//获取是否有新通知
this.tabsSer.hasNewNotice().subscribe(
(res)=>{
(res) => {
this.hasNew.notice = res;
}
)
//获取是否有新通知
this.tabsSer.hasNewMessage().subscribe(
(res)=>{
(res) => {
this.hasNew.message = res;
}
)
//获取是否有新报备
this.tabsSer.hasNewPremanager().subscribe(
(res)=>{
(res) => {
this.hasNew.premanager = res;
}
)
//获取是否有新问卷
this.tabsSer.hasNewTest().subscribe(
(res)=>{
(res) => {
this.hasNew.test = res;
}
)
......@@ -263,7 +265,7 @@ export class ServePage {
//2.参加活动日期
this.tabsSer.appOrderCal().subscribe(
(order)=>{
(order) => {
order.forEach(event => {
this.newArr.push({
date: new Date(event.batch.batchGoDate),
......@@ -273,7 +275,7 @@ export class ServePage {
});
this.tabsSer.appPreCal().subscribe(
(pre)=>{
(pre) => {
pre.forEach(event => {
this.newArr.push({
date: new Date(event.formshTime),
......@@ -295,7 +297,7 @@ export class ServePage {
date: year + '/' + month + '/01'
};
this.tabsSer.getMyScheduleOnMonth(data).subscribe(
(schedule)=>{
(schedule) => {
for (let i = 0; i < schedule.length; i++) {
const ev = {
date: new Date(schedule[i].dutyDate),
......@@ -305,7 +307,7 @@ export class ServePage {
this.newArr.push(ev);
}
this.tabsSer.getFestivalAboutMonth(data).subscribe(
(festival)=>{
(festival) => {
festival.forEach(event => {
const data = {
date: new Date(event.date),
......@@ -358,6 +360,11 @@ export class ServePage {
this.loadEvent(e.newMonth.years, e.newMonth.months);
}
//消息提醒页面
goToNotice() {
this.navCtrl.push(NoticePage);
}
}
//定义星期实体
......
......@@ -118,8 +118,8 @@ export class TabsService{
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