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) {
}
......
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Response } from '@angular/http';
import { Storage } from '@ionic/storage';
import { AppService, AppGlobal } from "../../../service/appHttpService";
import { OutGoingReportDetailPage } from '../outGoingReportDetail/outGoingReportDetail';
import { MyReportPage } from "../../myReport/myReport";
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {Response} from '@angular/http';
import {Storage} from '@ionic/storage';
import {AppService, AppGlobal} from "../../../service/appHttpService";
import {OutGoingReportDetailPage} from '../outGoingReportDetail/outGoingReportDetail';
import {MyReportPage} from "../../myReport/myReport";
import {MinePage} from "../../tabs/mine/mine";
@IonicPage()
@Component({
selector: 'page-outGoingReportEdit',
templateUrl: 'outGoingReportEdit.html'
selector: 'page-outGoingReportEdit',
templateUrl: 'outGoingReportEdit.html'
})
export class OutGoingReportEditPage {
isLeave = false;
//picture: string = "./assets/imgs/logo.png";
picture: string;
//报备详情显示处理
introduce: string;
edit_CityList ;
addressid:string = '';
syn_addressid:string = '';
//报备
premanager = {};
//个人报备
userpre = {
id:"",
managerId : "", //报备id
isorFromsh : 0, //默认不离沪
leaveTime : "", //离沪时间
backTime : "", //回沪时间
userpreDesc : "", //离沪说明
outaddressids : "" //个人报备选择的地点地址:保存id值
}
//报备截至日期
temp_endTime;
//临时离沪信息
temp_userpre = {}
//离沪时间差
dategap : any;
//离沪地点显示
locations : any;
constructor(
public navCtrl: NavController,
public navParams: NavParams,
public appService: AppService,
public storage: Storage
) {
//当前页面----个人报备1页面
//this.gettemp_userprePre();
}
ngOnInit():void{
//报备列表页面 到 个人报备1页面
this.storage.get("premanager").then((value)=>{
if(value != null && value != ''){
this.premanager = value;
//加载报备的图片
this.picture = AppGlobal.picture + this.premanager["uploadPic"];
//加载报备详细说明
this.subIntroduce(this.premanager["managerDesc"]);
this.userpre.managerId = this.premanager["id"]; //1.保存-报备id
this.temp_endTime = this.premanager["endTime"]; //报备截止时间
if(this.premanager["reported"]){ //已报备--修改操作,
//编辑初始化:查询
this.appService.ObserverHttpPost("/wisdomgroup/modules/userpre/getUserpre",{premanagerId:value.id})
.subscribe((res: Response) => {
let result = res.json();
this.userpre.id = result["id"]; //保存-id
//离沪勾选
if(result.isorFromsh == 1){ //离沪
this.userpre.isorFromsh = 1;
this.isLeave = true;
this.edit_CityList = result.areaList;
if( this.edit_CityList != null && this.edit_CityList.length > 0){
this.addressid = '';
this.locations = '';
for (let index = 0; index < this.edit_CityList.length; index++) {
const element = this.edit_CityList[index];
this.addressid += element["id"]+",";
this.locations += element["areaName"]+",";
}
this.addressid = this.addressid.substring(0,this.addressid.lastIndexOf(","));
this.locations = this.locations.substring(0,this.locations.lastIndexOf(",")); //回显地点
this.userpre.outaddressids = this.addressid; //保存-离沪地点
}
this.userpre.leaveTime = result["formshTime"]; //保存-离沪时间
this.userpre.backTime = result["comeshTime"]; //保存-回沪时间
if(result.userpreDesc != ''||typeof(result.userpreDesc)!='undefined'){
this.userpre.userpreDesc = result["userpreDesc"]; //保存-离沪说明
}
//页面显示 时间差
this.dategap = this.userpre.leaveTime+"~"+this.userpre.backTime; //回显时间差
}
}, error => {
this.appService.alert('网络异常!');
}
);
}
}
});
//此操作只从报备列表页面到此页面,仅执行一次(不然每次都初始化了)
this.storage.remove("premanager");
this.gettemp_userprePre();
}
gettemp_userprePre(){
//从个人报备2页面 到 个人报备1页面
this.storage.get("temp_userpre").then((value)=>{
if(value != null && value != ''){
this.isLeave = true;
this.userpre.isorFromsh = 1;
//temp_userpre 保存的是个人报备2 页面中选择的值
this.temp_userpre = value;
this.userpre.leaveTime = this.temp_userpre["leaveDate"];
this.userpre.backTime = this.temp_userpre["backDate"];
if(value.managerDesc != ''||typeof(value.managerDesc)!='undefined'){
this.userpre.userpreDesc = this.temp_userpre["managerDesc"];
}
this.userpre.outaddressids = this.temp_userpre["outaddressids"];
this.userpre.managerId = this.temp_userpre["managerId"];
//编辑 (存在个人报备id)
if(this.temp_userpre["id"]!=null&&this.temp_userpre["id"]!=''){
this.userpre.id = this.temp_userpre["id"];
}
//页面显示 时间差
this.dategap = this.temp_userpre["leaveDate"].substring(0,10)+"~"+this.temp_userpre["backDate"].substring(0,10);
this.locations = this.temp_userpre["areaName"];
this.temp_endTime = this.temp_userpre["entTime"];
this.picture = AppGlobal.picture + this.temp_userpre["premanagerImg"];
this.premanager["managerDesc"]=this.temp_userpre["premanagerIntroduce"];
this.subIntroduce(this.temp_userpre["premanagerIntroduce"]);
}
});
}
//详细说明展示
isCover: boolean = false;
//具体介绍
hidden() {
this.isCover = false;
}
show() {
this.isCover = true;
}
//报备详情限定一行17个字符串,两行57个字符串,多余以省略号代替
subIntroduce(str: string) {
console.log("introduce:"+str.length);
if (!str) this.introduce = '';
if (str.length <= 17) this.introduce = str;
if (str.length > 17 && str.length <= 25) this.introduce = str.substr(0, 17) + "...";
if (str.length > 25 && str.length <= 42) this.introduce = str.substr(0, 25) + "...";
if (str.length > 42) this.introduce = str.substr(0, 42) + "...";
}
//选择是否离沪
chooseLeave(status) {
if(status==1){ //不离沪
this.isLeave = false;
this.userpre.isorFromsh = 0;
this.userpre.leaveTime = "";
this.userpre.backTime = "";
this.userpre.userpreDesc = "";
this.userpre.outaddressids = "";
}else if(status==0){
this.isLeave = true;
this.userpre.isorFromsh = 1;
isLeave = false;
//picture: string = "./assets/imgs/logo.png";
picture: string;
//报备详情显示处理
introduce: string;
edit_CityList;
addressid: string = '';
syn_addressid: string = '';
//报备
premanager = {};
//个人报备
userpre = {
id: "",
managerId: "", //报备id
isorFromsh: 0, //默认不离沪
leaveTime: "", //离沪时间
backTime: "", //回沪时间
userpreDesc: "", //离沪说明
outaddressids: "" //个人报备选择的地点地址:保存id值
}
//报备截至日期
temp_endTime;
//临时离沪信息
temp_userpre = {}
//离沪时间差
dategap: any;
//离沪地点显示
locations: any;
//详细说明展示
isCover: boolean = false;
constructor(public navCtrl: NavController,
public navParams: NavParams,
public appService: AppService,
public storage: Storage) {
//当前页面----个人报备1页面
//this.gettemp_userprePre();
}
ngOnInit(): void {
//报备列表页面 到 个人报备1页面
this.storage.get("premanager").then((value) => {
if (value != null && value != '') {
this.premanager = value;
//加载报备的图片
this.picture = AppGlobal.picture + this.premanager["uploadPic"];
//加载报备详细说明
this.subIntroduce(this.premanager["managerDesc"]);
this.userpre.managerId = this.premanager["id"]; //1.保存-报备id
this.temp_endTime = this.premanager["endTime"]; //报备截止时间
if (this.premanager["reported"]) { //已报备--修改操作,
//编辑初始化:查询
this.appService.ObserverHttpPost("/wisdomgroup/modules/userpre/getUserpre", {premanagerId: value.id})
.subscribe((res: Response) => {
let result = res.json();
this.userpre.id = result["id"]; //保存-id
//离沪勾选
if (result.isorFromsh == 1) { //离沪
this.userpre.isorFromsh = 1;
this.isLeave = true;
this.edit_CityList = result.areaList;
if (this.edit_CityList != null && this.edit_CityList.length > 0) {
this.addressid = '';
this.locations = '';
for (let index = 0; index < this.edit_CityList.length; index++) {
const element = this.edit_CityList[index];
this.addressid += element["id"] + ",";
this.locations += element["areaName"] + ",";
}
this.addressid = this.addressid.substring(0, this.addressid.lastIndexOf(","));
this.locations = this.locations.substring(0, this.locations.lastIndexOf(",")); //回显地点
this.userpre.outaddressids = this.addressid; //保存-离沪地点
}
this.userpre.leaveTime = result["formshTime"]; //保存-离沪时间
this.userpre.backTime = result["comeshTime"]; //保存-回沪时间
if (result.userpreDesc != '' || typeof(result.userpreDesc) != 'undefined') {
this.userpre.userpreDesc = result["userpreDesc"]; //保存-离沪说明
}
//页面显示 时间差
this.dategap = this.userpre.leaveTime + "~" + this.userpre.backTime; //回显时间差
}
}, error => {
this.appService.alert('网络异常!');
}
);
}
}
});
//此操作只从报备列表页面到此页面,仅执行一次(不然每次都初始化了)
this.storage.remove("premanager");
this.gettemp_userprePre();
}
gettemp_userprePre() {
//从个人报备2页面 到 个人报备1页面
this.storage.get("temp_userpre").then((value) => {
if (value != null && value != '') {
this.isLeave = true;
this.userpre.isorFromsh = 1;
//temp_userpre 保存的是个人报备2 页面中选择的值
this.temp_userpre = value;
this.userpre.leaveTime = this.temp_userpre["leaveDate"];
this.userpre.backTime = this.temp_userpre["backDate"];
if (value.managerDesc != '' || typeof(value.managerDesc) != 'undefined') {
this.userpre.userpreDesc = this.temp_userpre["managerDesc"];
}
this.userpre.outaddressids = this.temp_userpre["outaddressids"];
this.userpre.managerId = this.temp_userpre["managerId"];
//编辑 (存在个人报备id)
if (this.temp_userpre["id"] != null && this.temp_userpre["id"] != '') {
this.userpre.id = this.temp_userpre["id"];
}
//页面显示 时间差
this.dategap = this.temp_userpre["leaveDate"].substring(0, 10) + "~" + this.temp_userpre["backDate"].substring(0, 10);
this.locations = this.temp_userpre["areaName"];
this.temp_endTime = this.temp_userpre["entTime"];
this.picture = AppGlobal.picture + this.temp_userpre["premanagerImg"];
this.premanager["managerDesc"] = this.temp_userpre["premanagerIntroduce"];
this.subIntroduce(this.temp_userpre["premanagerIntroduce"]);
}
});
}
}
// 跳转到报备详情页面页面
editReport(){
this.storage.remove("city");
this.navCtrl.push("OutGoingReportDetailPage",{premanager:this.premanager});
}
//提交报备
savePremanager(){
if(this.userpre.isorFromsh == 1){
//判断离沪地点是否选择
if(this.userpre.outaddressids == null || this.userpre.outaddressids == ''){
this.appService.alert("请填写离沪详情信息!");
return false;
}
if(this.userpre.userpreDesc != null && this.userpre.userpreDesc != '' ){
//离沪乱码处理
let temp_userpreDesc = encodeURIComponent(this.userpre["userpreDesc"]) ;
this.userpre.userpreDesc = temp_userpreDesc;
//具体介绍
hidden() {
this.isCover = false;
}
show() {
this.isCover = true;
}
//报备详情限定一行17个字符串,两行57个字符串,多余以省略号代替
subIntroduce(str: string) {
console.log("introduce:" + str.length);
if (!str) this.introduce = '';
if (str.length <= 17) this.introduce = str;
if (str.length > 17 && str.length <= 25) this.introduce = str.substr(0, 17) + "...";
if (str.length > 25 && str.length <= 42) this.introduce = str.substr(0, 25) + "...";
if (str.length > 42) this.introduce = str.substr(0, 42) + "...";
}
//选择是否离沪
chooseLeave(status) {
if (status == 1) { //不离沪
this.isLeave = false;
this.userpre.isorFromsh = 0;
this.userpre.leaveTime = "";
this.userpre.backTime = "";
this.userpre.userpreDesc = "";
this.userpre.outaddressids = "";
} else if (status == 0) {
this.isLeave = true;
this.userpre.isorFromsh = 1;
}
}
//判断报备截止日期
let signflag = Date.parse(this.temp_endTime.toString()) > Date.parse(new Date().toString());
if(!signflag){
this.appService.alert('超过报备截至时间!');
return false;
// 跳转到报备详情页面页面
editReport() {
this.storage.remove("city");
this.navCtrl.push("OutGoingReportDetailPage", {premanager: this.premanager});
}
//提交报备
savePremanager() {
if (this.userpre.isorFromsh == 1) {
//判断离沪地点是否选择
if (this.userpre.outaddressids == null || this.userpre.outaddressids == '') {
this.appService.alert("请填写离沪详情信息!");
return false;
}
if (this.userpre.userpreDesc != null && this.userpre.userpreDesc != '') {
//离沪乱码处理
let temp_userpreDesc = encodeURIComponent(this.userpre["userpreDesc"]);
this.userpre.userpreDesc = temp_userpreDesc;
}
}
//判断报备截止日期
let signflag = Date.parse(this.temp_endTime.toString()) > Date.parse(new Date().toString());
// if(this.userpre.userpreDesc != null && this.userpre.userpreDesc != '' ){
// //离沪乱码处理
// let temp_userpreDesc = encodeURIComponent(this.userpre["userpreDesc"]) ;
// this.userpre.userpreDesc = temp_userpreDesc;
// }
this.appService.ObserverHttpPost("/wisdomgroup/modules/userpre/create",this.userpre)
.subscribe((res: Response) => {
let resultback = res.json();
if(resultback.code == '200'){
//this.appService.popToastView(resultback.msg,'middle',1000);
this.navCtrl.push("MyReportPage");
this.storage.remove("premanager");
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
}else{
//失败
this.appService.popToastView(resultback.msg,'middle',1000);
}
}, error => {
this.appService.alert('网络异常!');
}
);
}
//修改报备
editPremanager(){
if(this.userpre.isorFromsh == 1){
//判断离沪地点是否选择
if(this.userpre.outaddressids == null || this.userpre.outaddressids == ''){
this.appService.alert("请填写离沪详情信息!");
return false;
if (!signflag) {
this.appService.alert('超过报备截至时间!');
return false;
}
if(this.userpre.userpreDesc != null && this.userpre.userpreDesc != '' ){
//离沪乱码处理
let temp_userpreDesc = encodeURIComponent(this.userpre["userpreDesc"]) ;
this.userpre.userpreDesc = temp_userpreDesc;
this.appService.ObserverHttpPost("/wisdomgroup/modules/userpre/create", this.userpre)
.subscribe((res: Response) => {
let resultback = res.json();
if (resultback.code == '200') {
const index = this.navCtrl.getActive().index;
this.navCtrl.remove(0, index);
this.navCtrl.setRoot(MinePage);
this.navCtrl.parent.select(3);
this.navCtrl.push("MyReportPage");
this.storage.remove("premanager");
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
} else {
//失败
this.appService.popToastView(resultback.msg, 'middle', 1000);
}
}, error => {
this.appService.alert('网络异常!');
}
);
}
//修改报备
editPremanager() {
if (this.userpre.isorFromsh == 1) {
//判断离沪地点是否选择
if (this.userpre.outaddressids == null || this.userpre.outaddressids == '') {
this.appService.alert("请填写离沪详情信息!");
return false;
}
if (this.userpre.userpreDesc != null && this.userpre.userpreDesc != '') {
//离沪乱码处理
let temp_userpreDesc = encodeURIComponent(this.userpre["userpreDesc"]);
this.userpre.userpreDesc = temp_userpreDesc;
}
}
this.storage.get("cityList").then((value) => {
if (value != null && value != '') { //离沪
this.addressid = '';
for (let index = 0; index < value.length; index++) {
const element = value[index];
this.addressid += element["id"] + ",";
}
this.addressid = this.addressid.substring(0, this.addressid.lastIndexOf(","));
this.userpre.outaddressids = this.addressid;
} //编辑或者是选择不离沪
this.savePremanager_sysn(this.userpre, result => {
let resultback = result;
if (resultback.code == '200') {
//this.appService.popToastView(resultback.msg,'middle',1000);
//清空 插入
const index = this.navCtrl.getActive().index;
this.navCtrl.remove(0, index);
this.navCtrl.setRoot(MinePage);
this.navCtrl.parent.select(3);
this.navCtrl.push("MyReportPage");
} else {
//失败
this.appService.popToastView(resultback.msg, 'middle', 1000);
}
});
});
}
this.storage.get("cityList").then((value)=>{
if(value != null && value != ''){ //离沪
this.addressid = '';
for (let index = 0; index < value.length; index++) {
const element = value[index];
this.addressid += element["id"]+",";
}
this.addressid = this.addressid.substring(0,this.addressid.lastIndexOf(","));
this.userpre.outaddressids = this.addressid;
} //编辑或者是选择不离沪
this.savePremanager_sysn(this.userpre,result=>{
let resultback = result;
if(resultback.code == '200'){
//this.appService.popToastView(resultback.msg,'middle',1000);
//清空 插入
const index = this.navCtrl.getActive().index;
this.navCtrl.remove(0, index);
this.navCtrl.setRoot(MinePage);
this.navCtrl.parent.select(3);
this.navCtrl.push("MyReportPage");
}else{
//失败
this.appService.popToastView(resultback.msg,'middle',1000);
}
});
});
}
//防止异步
savePremanager_sysn(userprev,callback?): any {
this.appService.ObserverHttpPost("/wisdomgroup/modules/userpre/create",userprev)
.toPromise()
.then(res => {
this.storage.remove("premanager");
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
let data = res.json();
callback(data == null ? "[]" : data);
})
.catch(error => {
});
}
//防止异步
savePremanager_sysn(userprev, callback?): any {
this.appService.ObserverHttpPost("/wisdomgroup/modules/userpre/create", userprev)
.toPromise()
.then(res => {
this.storage.remove("premanager");
this.storage.remove("temp_userpre");
this.storage.remove("managerId");
this.storage.remove("city");
this.storage.remove("cityList");
let data = res.json();
callback(data == null ? "[]" : data);
})
.catch(error => {
});
}
}
......@@ -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