Commit 80307d8b authored by wangqinghua's avatar wangqinghua

push

parent 2e5ff253
......@@ -28,18 +28,17 @@ export class MyApp {
badge:Badge
) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
//检测是否需要更新
appVersion.getVersionNumber().then((version: string) => {
appUpdateService.compariVersion().subscribe(data => {
alert(data.code);
alert(data.latestVersion);
if (data.code == 200) {
if (data.latestVersion != null && data.latestVersion != version) {
appUpdateService.detectionUpgrade(data.androidDownload, true); //提示升级
}
if (data.latestVersion != null && data.latestVersion != version) {
appUpdateService.detectionUpgrade(data.androidDownload, true); //提示升级
}
}
});
}).catch(err => {
......
......@@ -15,7 +15,7 @@
<div class="item1-content-box">
<ion-icon name="md-contact" class="item1-icon"></ion-icon>
<span class="item-type" *ngIf="activity?.activityType =='1'">体检</span>
<span class="item-type" *ngIf="activity?.activityType =='2'">疗养</span>
<span class="item-type" *ngIf="activity?.activityType =='2'">疗养</span>
<span class="item-type" *ngIf="activity?.activityType =='3'">培训</span>
<span class="item-type" *ngIf="activity?.activityType =='4'">工会活动</span>
</div>
......
......@@ -11,7 +11,7 @@
</ion-refresher-content>
</ion-refresher>
<ion-list>
<ion-list *ngIf="items.length > 0">
<ion-item *ngFor="let item of items">
<div class="item">
<div class="item-header">
......@@ -51,6 +51,11 @@
</ion-item>
</ion-list>
<ion-list text-center style="margin-top: 10rem" *ngIf="items.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无数据
</p>
</ion-list>
</ion-content>
\ No newline at end of file
......@@ -13,7 +13,7 @@ import {ActivityDetailPage} from "../activityDetail/activityDetail";
})
export class ActivityListPage {
items: object[];
items = [];
activityType:Array<String> = ['未知','体检','疗休养','培训','工会活动'];
......
......@@ -5,7 +5,7 @@
</ion-header>
<ion-content scrollbar-y="true" direction="y" class="bgc-e7e8ed">
<ion-list>
<ion-list *ngIf="allNotice.length > 0">
<ion-item class="margin-bottom-10" *ngFor="let notice of allNotice" (click)="goView(notice.id,notice.read)">
<div class="item">
<div class="item-header">
......@@ -31,4 +31,11 @@
</div>
</ion-item>
</ion-list>
<ion-list text-center style="margin-top: 10rem" *ngIf="allNotice.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无数据
</p>
</ion-list>
</ion-content>
\ No newline at end of file
......@@ -11,7 +11,7 @@ import { AnnouncementViewPage } from '../announcementView/announcementView';
export class AnnouncementPage {
allNotice: Array<any> = [];
allNotice = [];
constructor(
public navCtrl: NavController,
......
......@@ -7,7 +7,7 @@ page-block-list {
justify-content: left;
box-sizing: border-box;
padding: 10px 0 10px 15px;
border-bottom: 1px solid #333;
}
.contact-icon{
......
......@@ -26,26 +26,26 @@
format="YYYY-MM-DD">
</ion-calendar>
<div class="margin-top-10 duty-Obj">
<ion-item>
<ion-item class="">
<div>
<p> <span class="daySpan">白班</span></p>
<p>
<p class="padding-left-15">
<span *ngIf="dayObj.name" >{{dayObj.name}}</span>
<span *ngIf="!dayObj.name" >暂无</span>
<span>{{dayObj?.phone}}</span>
</p>
<p>{{dayObj?.orgName}}</p>
<p class="padding-left-15">{{dayObj?.orgName}}</p>
</div>
</ion-item>
<ion-item class="margin-top-10">
<ion-item class=" margin-top-10">
<div>
<p><span class="nightSpan">夜班</span></p>
<p>
<p class="padding-left-15">
<span *ngIf="nightObj.name" >{{nightObj.name}}</span>
<span *ngIf="!nightObj.name" >暂无</span>
<span>{{nightObj?.phone}}</span>
</p>
<p>{{nightObj?.orgName}}</p>
<p class="padding-left-15">{{nightObj?.orgName}}</p>
</div>
</ion-item>
</div>
......@@ -73,8 +73,11 @@
</div>
</ion-item>
</ion-list>
<ion-list *ngIf="nowDuty.length == 0">
<p text-center>暂无数据</p>
<ion-list text-center style="margin-top: 10rem" *ngIf="nowDuty.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无数据
</p>
</ion-list>
</div>
</ng-container>
......
......@@ -58,6 +58,14 @@ page-duty {
border-bottom-right-radius: 5px;
}
.duty-Obj .item-ios p {
margin-bottom: 10px;
margin-bottom: 15px;
}
.duty-Obj .label-ios{
margin: 0;
}
.duty-Obj{
.item-ios.item-block .item-inner{
background-color: #f5f6f7;
}
}
}
......@@ -36,8 +36,16 @@
</div>
</div>
</ion-item>
<div text-center style="margin-top: 10rem" *ngIf="noList.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无数据
</p>
</div>
</ng-container>
<ng-container *ngIf="changeType == 2">
<ion-item *ngFor="let item2 of doneList;" class="margin-bottom-10" (click)="goToDetail(item2)">
<div class="margin-bottom-10" >
<span>{{item2.name}}</span>
......@@ -57,6 +65,13 @@
</div>
</ion-item>
<div text-center style="margin-top: 10rem" *ngIf="doneList.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无数据
</p>
</div>
</ng-container>
</ion-list>
</ion-content>
......
......@@ -16,8 +16,8 @@ export class ChangeApplyListPage {
{name:'已处理'},
];
changeType = 1;
noList;
doneList;
noList = [];
doneList = [];
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
......
......@@ -9,28 +9,34 @@
<ion-content class="bgc-e7e8ed">
<ion-list>
<ion-item class="item-list margin-bottom-10" *ngFor="let item of list">
<div class="item" >
<div class="item-header padding-15-0">
<div class="item-header-style">
<span class="item-title">{{item.title}}</span>
<span float-right class="done" *ngIf="item.state==1 ">未发布</span>
<span float-right class="done" *ngIf="item.state==2 ">已发布</span>
<span float-right class="done" *ngIf="item.state==3 ">已过期</span>
<ng-container *ngIf="list.length > 0">
<ion-item class="item-list margin-bottom-10" *ngFor="let item of list">
<div class="item" >
<div class="item-header padding-15-0">
<div class="item-header-style">
<span class="item-title">{{item.title}}</span>
<span float-right class="done" *ngIf="item.state==1 ">未发布</span>
<span float-right class="done" *ngIf="item.state==2 ">已发布</span>
<span float-right class="done" *ngIf="item.state==3 ">已过期</span>
</div>
</div>
<div class="content-button padding-15-0">
<span>参与人员:</span>
<span *ngIf="item.groupName">{{item.groupName}}</span>
<span *ngIf="!item.groupName">全体人员</span>
<span float-right class="join" (click)="geToWrite(item)">参与</span>
<span float-right class="look" (click)="goToResult(item)">查看</span>
</div>
</div>
<div class="content-button padding-15-0">
<span>参与人员:</span>
<span *ngIf="item.groupName">{{item.groupName}}</span>
<span *ngIf="!item.groupName">全体人员</span>
<span float-right class="join" (click)="geToWrite(item)">参与</span>
<span float-right class="look" (click)="goToResult(item)">查看</span>
</div>
</ion-item>
</ng-container>
<ng-container *ngIf="list.length == 0">
<div text-center style="margin-top: 10rem" *ngIf="list.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无数据
</p>
</div>
</ion-item>
<!--</ng-container>-->
<!--<ng-container *ngIf="contentList.datalist.length == 0">-->
<!--暂无数据-->
<!--</ng-container>-->
</ng-container>
</ion-list>
</ion-content>
......@@ -14,7 +14,7 @@ import {SurveyResultPage} from "../survey-result/survey-result";
export class MySurveyPage {
userId;
list;
list = [];
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService,public storage: Storage) {
}
......
......@@ -57,6 +57,6 @@
<div (click)="delete()"><span>删除</span></div>
</div>
<ion-toolbar>
<ion-title> <span (click)="cancle()">取消</span> </ion-title>
<p class="text-center" (click)="cancle()"> 取消 </p>
</ion-toolbar>
</ion-footer>
......@@ -64,6 +64,7 @@ page-list {
height: 11rem;
background-color: #f8f8f8;
border-bottom: 1px solid #bbbbbb;
box-shadow: 0px -2px 5px #bbb;
}
.footter-opr div{
width: 33%;
......
......@@ -83,12 +83,12 @@ export class HomePage {
goActivity() {
this.navCtrl.push('ActivityListPage', {
});
this.badge.clear();
this.navCtrl.push('ActivityListPage', {});
}
goAnnouncement() {
this.badge.clear();
this.navCtrl.push("AnnouncementPage");
}
......@@ -284,6 +284,7 @@ export class HomePage {
//消息通知
gotoNotice(){
this.badge.clear();
this.navCtrl.setRoot(NoticePage);
this.navCtrl.parent.select(2);
}
......@@ -294,6 +295,7 @@ export class HomePage {
//外出报备跳转
goOutGoingReportAboutAll() {
this.badge.clear();
this.navCtrl.push("OutGoingReportPage", {
type: 1
});
......@@ -320,8 +322,7 @@ export class HomePage {
this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/hasNewActivity", null)
.subscribe((res: Response) => {
let data = res.json();
this.badge.set(data.length);
console.log(data);
this.badge.set(1);
this.hasNewActivity = data;
}, error => {
this.appService.alert('网络异常!');
......@@ -347,7 +348,7 @@ export class HomePage {
this.appService.ObserverHttpGet("/wisdomgroup/modules/premanager/hasNewPremanager", null)
.subscribe((res: Response) => {
let data = res.json();
this.badge.set(data.length);
this.badge.set(1);
this.hasNewPremanager = data;
}, error => {
this.appService.alert('网络异常!');
......
......@@ -3,15 +3,15 @@
<ion-title text-center>设置</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-content class="bgc-e7e8ed">
<ion-list>
<ion-item>
<ion-label>是否接受推送消息</ion-label>
<ion-toggle [(ngModel)]="pusNumber" (ionChange)="savePush()"></ion-toggle>
</ion-item>
<ion-item>
<span>当前版本</span>
<span float-right>{{version}}</span>
<ion-item class="margin-top-20">
<span (click)="update()">当前版本</span>
<span float-right (click)="update()"><span *ngIf="!isLatest" class="red-span"></span>{{version}}</span>
</ion-item>
</ion-list>
<button class="submit-btn submit" (click)="logoutApp()">退出</button>
......
......@@ -50,4 +50,13 @@ page-version {
.list-ios .item-block .item-inner {
border-bottom: 0.55px solid #c8c7cc;
}
.red-span{
background-color: red;
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 10px;
margin-bottom: 2px;
}
}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {AlertController, IonicPage, NavController, NavParams} from 'ionic-angular';
import { AppService } from '../../service/appHttpService';
import { AppVersion } from '@ionic-native/app-version';
import { AppUpdateService } from '../../service/appUpdateService';
......@@ -23,7 +23,8 @@ export class VersionPage {
public appService:AppService,
private appUpdateService: AppUpdateService,
private appVersion: AppVersion,
private storage:Storage
private storage:Storage,
private alertCtrl: AlertController
) {
}
......@@ -31,6 +32,13 @@ export class VersionPage {
ionViewWillEnter() {
this.getversion();
this.getAppPush();
this.appUpdateService.compariVersion().subscribe(res => {
var data = res.json();
if (data.code == 200) {
this.latestVersion = data.latestVersion;
}
});
}
//获取推送开关
......@@ -72,7 +80,32 @@ export class VersionPage {
//更新
update(){
this.appUpdateService.downloadApp("/wisdomgroup/app/download");
if(!this.isLatest){
const alert = this.alertCtrl.create({
subTitle: '已是最新版本',
buttons: ['确定']
});
alert.present();
}else{
const confirm = this.alertCtrl.create({
message: '有最新版本,是否更新?',
buttons: [
{
text: '取消',
handler: () => {
console.log('Disagree clicked');
}
},
{
text: '确定',
handler: () => {
this.appUpdateService.downloadApp("/wisdomgroup/app/download");
}
}
]
});
confirm.present();
}
}
......
......@@ -54,7 +54,6 @@ export class AppUpdateService {
buttons: ['后台下载']
});
// const fileTransfer: FileTransferObject = this.fileTransfer.create();
// const apk = this.file.externalRootDirectory + 'app.apk'; //apk保存的目录
// fileTransfer.download(AppGlobal.domain+apkUrl, apk).then(() => {
......@@ -98,7 +97,8 @@ export class AppUpdateService {
let path = this.file.externalDataDirectory;
this.file.writeFile(path, fileName, blob, {
replace: true
}).then(() => {
}).then(
() => {
this.fileOpener.open(
path + fileName,
'application/vnd.android.package-archive'
......
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