Commit 5cefb65c authored by wangqinghua's avatar wangqinghua

update

parent 80e8ba7e
......@@ -15,6 +15,9 @@ import {MobileAccessibility} from "@ionic-native/mobile-accessibility";
import {timer} from "rxjs/observable/timer";
import {ScreenOrientation} from "@ionic-native/screen-orientation";
import {AppMainService} from "./app.service";
import {async} from "rxjs/scheduler/async";
import {TabsService} from "../pages/tabs/tabs.service";
import {version} from "moment";
@Component({
templateUrl: 'app.html'
......@@ -27,7 +30,7 @@ export class MyApp {
user;
constructor(platform: Platform,
constructor(public platform: Platform,
public statusBar: StatusBar,
public splashScreen: SplashScreen,
private alertCtrl: AlertController,
......@@ -36,92 +39,90 @@ export class MyApp {
private appVersion: AppVersion,
private screenOrientation: ScreenOrientation,
public emitSer: EmitService,
public storage: Storage,
public storage: Storage, private tabSer: TabsService,
public mobileAccess: MobileAccessibility,
private appMainSer:AppMainService,
private appMainSer: AppMainService,
public appService: AppService) {
platform.ready().then(() => {
this.platform.ready().then(() => {
this.splashScreen.hide();
this.statusBar.show();
this.statusBar.overlaysWebView(false);
this.statusBar.backgroundColorByHexString('#e12724');
this.statusBar.styleLightContent();
if (platform.is('android')) {
this.screenOrientation.lock('portrait-primary'); //锁定竖屏
}
timer(4500).subscribe((res) => {
this.showSplash = false;
this.checkVersion();
this.device();
this.loadLogin();
});
//app字体不跟随手机字体大小变化
this.mobileAccess.usePreferredTextZoom(false);
});
});
}
//用户设备
device(){
if (this.platform.is('android')) {
this.screenOrientation.lock('portrait-primary'); //锁定竖屏
this.checkVersion();
}
}
//检测是否需要更新
checkVersion() {
//检测是否需要更新
this.appVersion.getVersionNumber().then((version: string) => {
version = version.replace(' ', '');
this.appUpdateService.compariVersion().subscribe(res => {
let data = res.json();
data.latestVersion = data.latestVersion.replace(' ', '');
if (data.code == 200) {
if (data.latestVersion != null && data.latestVersion != version) {
this.appUpdateService.detectionUpgrade(data.androidDownload, true); //提示升级
}
async checkVersion() {
let appVersion;
await this.appVersion.getVersionNumber().then((ver: string) => {
appVersion = ver.trim();
});
await this.appUpdateService.compariVersion().subscribe(res => {
const data = res.json();
data.latestVersion = data.latestVersion.trim();
if (data.code == 200) {
if (data.latestVersion != null && data.latestVersion != appVersion) {
this.appUpdateService.detectionUpgrade(data.androidDownload, true); //提示升级
}
});
}).catch(err => {
console.log('getVersionNumber:' + err);
}
});
}
async loadLogin() {
loadLogin() {
this.storage.get("userLoginInfo").then((value) => {
await setTimeout(()=>{
console.log('setTimeout')
},3000);
await this.storage.get('userLoginInfo').then((value => {
console.log('userLoginInfo')
if (value != null && value != '') {
this.user = value;
if (this.user.remember) {
this.appService.ObserverHttpPost("/wisdomgroup/app/loginpost", this.user)
.subscribe((res: Response) => {
let data = res.json();
if (data["code"] == '200') {
this.storage.set('user', data.data);
this.user.userid = data.data.id;
this.storage.set('userLoginInfo', this.user);
this.rootPage = TabsPage;
} else {
this.appService.alert('手机号或密码错误!');
this.rootPage = LoginPage;
}
}, error => {
this.rootPage = LoginPage;
this.appService.alert('网络异常!');
}
);
} else {
this.rootPage = LoginPage;
}
this.getNoRead();
} else {
this.rootPage = LoginPage;
}
}));
await this.tabSer.loginpost(this.user).subscribe((res) => {
if (res.code == '200') {
this.storage.set('user', res.data);
this.user.userid = res.data.id;
this.storage.set('userLoginInfo', this.user);
this.rootPage = TabsPage;
} else {
this.appService.alert('手机号或密码错误!');
this.rootPage = LoginPage;
}
});
await this.getNoRead();
}
getNoRead() {
this.appService.ObserverHttpPost("/wisdomgroup/modules/message/findAllActivityForAppWithXQ", null)
.subscribe((res: Response) => {
console.log('getNoRead');
let data = res.json();
let num = 0;
if (data.length > 0) {
......@@ -129,7 +130,6 @@ export class MyApp {
if (e.isRead == 0) num++;
});
this.appMainSer.setRead(num);
console.log(num);
}
}, error => {
}
......
......@@ -44,7 +44,13 @@
</div>
</div>
</div>
<ion-list text-center style="margin-top: 10rem;color: #666666"
*ngIf="page.isLoad && newList.length == 0">
<img style="width: 20%;" src="./assets/imgs/no-info.png" alt="">
<p text-center>
暂无
</p>
</ion-list>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content
loadingSpinner="bubbles"
......
......@@ -18,14 +18,15 @@ export class BusinessUnitPage {
picture: string = AppGlobal.picture;
newList = [];
searchObj = {
page = {
isLoad: false,
P_pageNumber: 1,
P_pageSize: AppGlobal.pageCount,
title: '',
total: null
};
pageNumber: number = 1;
pageSize = AppGlobal.pageCount;
totalNum: number;
constructor(public navCtrl: NavController, public navParams: NavParams,
public serveSer: ServeService) {
}
......@@ -38,13 +39,14 @@ export class BusinessUnitPage {
search() {
const data = {
P_pageNumber: 1,
P_pageSize: this.pageSize,
title: this.searchObj.title
P_pageSize: this.page.P_pageSize,
title: this.page.title
};
this.serveSer.searchBusinessSystem(data).subscribe(
(res) => {
this.newList = res.data.list;
this.totalNum = res.data.total;
this.page.total = res.data.total;
this.page.isLoad = true;
this.newList.forEach(e => {
if (e.attachments && e.attachments.length > 0) {
e.path = e.attachments[0].path;
......@@ -66,19 +68,19 @@ export class BusinessUnitPage {
//上拉加载
doInfinite(e) {
if (this.totalNum == this.newList.length) {
if (this.page.total == this.newList.length) {
console.log('done');
e.enable(false);
return false;
}
this.pageNumber++;
this.page.P_pageNumber++;
const data = {
P_pageNumber: this.pageNumber,
P_pageSize: this.pageSize,
P_pageNumber: this.page.P_pageNumber,
P_pageSize: this.page.P_pageSize,
};
this.serveSer.searchBusinessSystem(data).subscribe(
(res) => {
this.totalNum = res.data.total;
this.page.total = res.data.total;
res.data.list.forEach(e => {
if (e.attachments && e.attachments.length > 0) {
e.path = e.attachments[0].path;
......
......@@ -12,7 +12,7 @@
<ion-item>
<ion-label class="item-left"><span class="color-red">*</span>用餐日期:</ion-label>
<ion-datetime cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD"
pickerFormat="YYYY MM DD" placeholder="请选择"
pickerFormat="YYYY MM DD" placeholder="请选择" [min]="nowDate"
[(ngModel)]="obj.orderDate"></ion-datetime>
<ion-label class="right-arrow">
<ion-icon name="arrow-forward"></ion-icon>
......
......@@ -33,6 +33,7 @@ export class FoodApplyPage {
personList = [];
applyId; //是否编辑
type;
nowDate;
constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public modalCtrl: ModalController,
......@@ -53,6 +54,7 @@ export class FoodApplyPage {
//初始化参数
initParams() {
const data = this.navParams.get('data');
this.nowDate = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
console.log(data);
if (data) {
......@@ -101,14 +103,6 @@ export class FoodApplyPage {
}
},
{
text: '20元',
handler: () => {
this.obj.standard = '2';
this.obj.standardText = '20元';
this.obj.amount = '20';
}
},
{
text: '其他',
handler: () => {
this.obj.standard = '3';
......
......@@ -58,7 +58,7 @@
<div class="morning">
<div class="morning-room">
<ng-container *ngFor="let item3 of room?.uncheckList">
<span (click)="goApplyEdit(item3)" *ngIf=" role.includes(11) || (role.includes(1) && mineInfo.orgName == item1.orgName)" >
<span (click)="goApplyEdit(item3)" *ngIf=" role.includes(11) || (role.includes(1) && mineInfo.orgName == item3.orgName)" >
<span *ngIf="item3?.type == 1">午餐</span>&nbsp;&nbsp;
<span *ngIf="item3?.type == 2">晚餐</span> {{item3.orgName}}等{{item3.peopleCount}}人,标准:{{item3.total}}元
</span>
......@@ -119,6 +119,11 @@
loadingSpinner="bubbles"
loadingText="加载中"></ion-infinite-scroll-content>
</ion-infinite-scroll>
<ion-fab right bottom>
<button ion-fab color="light" (click)="buy()">
<span class="issue">抢购</span>
</button>
</ion-fab>
</ion-content>
</ion-content>
......@@ -178,4 +178,9 @@ export class FoodPage {
this.navCtrl.push(FoodApplyPage);
}
}
//抢购
buy(){
}
}
......@@ -12,7 +12,7 @@
<ion-item>
<ion-label class="item-left"><span class="color-red">*</span>预约时间:</ion-label>
<ion-datetime cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD"
pickerFormat="YYYY MM DD" placeholder="请选择"
pickerFormat="YYYY MM DD" placeholder="请选择" [min]="nowDate"
[(ngModel)]="obj.appointmentDate"></ion-datetime>
<ion-label *ngIf="check.appointmentDate" class="check-tips">请选择开始时间</ion-label>
</ion-item>
......
......@@ -44,6 +44,7 @@ export class HairApplyPage {
];
applyId; //是否编辑
nowDate;
constructor(public navCtrl: NavController, public navParams: NavParams, private actionSheetCtrl: ActionSheetController,
private serveSer: ServeService, public modalCtrl: ModalController,
......@@ -60,6 +61,7 @@ export class HairApplyPage {
//初始化参数
initParams() {
this.nowDate = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
const data = this.navParams.get('data');
console.log(data);
if (data) {
......
......@@ -39,7 +39,7 @@
<ion-item>
<ion-label class="item-left"><span class="color-red">*</span>开始时间:</ion-label>
<ion-datetime cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [max]="obj.endTime"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [max]="obj.endTime" [min]="nowDate"
[(ngModel)]="obj.startTime"></ion-datetime>
<ion-label class="right-arrow">
<ion-icon name="arrow-forward"></ion-icon>
......
......@@ -20,8 +20,8 @@ export class RoomApplyPage {
roomText: '请选择',
orgId: null,
orgText: '请选择',
startTime: '',
endTime: '',
startTime: null,
endTime: null,
orgLeader: [],
personList: [],
remark: '',
......@@ -70,6 +70,7 @@ export class RoomApplyPage {
applyId; //是否编辑
mineInfo; //申请人信息
nowDate;
constructor(public navCtrl: NavController, public navParams: NavParams, private actionSheetCtrl: ActionSheetController,
private serveSer: ServeService, public _modalCtrl: ModalController, private appMainSer: AppMainService,
......@@ -81,27 +82,27 @@ export class RoomApplyPage {
}
ionViewDidLoad() {
this.initParams();
this.applyId = this.navParams.get('id');
if (this.applyId) {
this.meetDetail();
this.roomMax = `该会议室可容纳${this.navParams.get('accommodation')}人`;
}else{
this.initParams();
}
}
//时间和会议室初始化
initParams() {
this.obj.startTime = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
this.nowDate = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
const data = this.navParams.get('data');
if (data) {
this.obj.startTime = this.datePipe.transform(data.startTime, 'yyyy-MM-ddTHH:mm');
this.obj.roomId = data.roomId;
this.obj.roomText = data.roomName;
this.roomMax = `该会议室可容纳${data.accommodation}人`;
this.obj.equipmervice = data.equipmervice.split(',');
this.getEquipmervice(this.obj.equipmervice);
} else {
const now = this.datePipe.transform(new Date(), 'yyyy-MM-dd') + ' 9:00';
this.obj.startTime = this.datePipe.transform(now, 'yyyy-MM-ddTHH:mm');
}
}
......@@ -127,6 +128,7 @@ export class RoomApplyPage {
this.obj.startTime = this.datePipe.transform(res.startTime, 'yyyy-MM-ddTHH:mm');
this.obj.endTime = this.datePipe.transform(res.endTime, 'yyyy-MM-ddTHH:mm');
this.obj.remark = res.remark;
this.obj.orgText = res.orgName;
this.obj.equipmervice = res.equipmervice.split(',');
this.obj.participantAmount = res.participantAmount;
this.obj.orgId = res.orgId;
......@@ -155,7 +157,7 @@ export class RoomApplyPage {
(res) => {
this.orgList = res;
const org = <any>this.orgList.filter(e => e.name == this.mineInfo.orgName);
if (org && org.length > 0) {
if (org && org.length > 0 && !this.applyId) {
this.obj.orgText = org[0].name;
this.obj.orgId = org[0].id;
}
......@@ -298,7 +300,6 @@ export class RoomApplyPage {
}
const max = this.roomMax.replace(/[^0-9]/ig, "");
console.log(max);
if (isNaN(this.obj.participantAmount)) {
console.log("max is Nan");
this.check.participantAmount = true;
......
......@@ -12,7 +12,7 @@
<ion-item>
<ion-label class="item-left"><span class="color-red">*</span>用车时间:</ion-label>
<ion-datetime [disabled]="type == 'deal' " cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [max]="obj.endTime" [min]="nowDate"
[(ngModel)]="obj.startTime"></ion-datetime>
<ion-label class="right-arrow">
<ion-icon name="arrow-forward"></ion-icon>
......@@ -22,7 +22,7 @@
<ion-item>
<ion-label class="item-left"><span class="color-red">*</span>还车时间:</ion-label>
<ion-datetime [disabled]="type == 'deal' " cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [min]="obj.startTime"
[(ngModel)]="obj.endTime"></ion-datetime>
<ion-label class="right-arrow">
<ion-icon name="arrow-forward"></ion-icon>
......
......@@ -28,13 +28,14 @@ page-car-apply {
font-size: 1.4rem;
}
.segment-ios .segment-button{
.segment-ios .segment-button {
border-color: #e12724;
color: #e12724;
height: 2.2rem;
line-height: 2rem;
}
.segment-ios .segment-button.segment-activated{
.segment-ios .segment-button.segment-activated {
background-color: #e12724;
}
......@@ -50,7 +51,7 @@ page-car-apply {
font-size: 1.6rem;
}
.choose{
.choose {
text-align: right;
margin-right: 20px;
font-size: 1.5rem;
......@@ -118,10 +119,12 @@ page-car-apply {
}
}
}
ion-item,.item-box{
ion-item, .item-box {
position: relative;
}
.check-tips{
.check-tips {
position: absolute;
font-size: 1.2rem;
top: 24px;
......@@ -135,8 +138,12 @@ page-car-apply {
padding: 0;
min-height: 4rem;
}
.picker-columns > div:first-child,
.picker-columns > div:last-child{
flex: 2;
.picker-columns > div:nth-child(2) button {
text-align: right;
}
.picker-columns > div:nth-child(6) button {
text-align: left;
}
......@@ -34,6 +34,7 @@ export class CarApplyPage {
personList = [];
applyId; //是否编辑
type;
nowDate;
constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public modalCtrl: ModalController,
......@@ -59,6 +60,10 @@ export class CarApplyPage {
} else {
this.obj.startTime = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
this.nowDate = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
console.log(this.obj)
console.log(this.nowDate)
}
}
......
......@@ -29,7 +29,7 @@
<ion-item>
<ion-label class="item-left"><span class="color-red">*</span>到访时间:</ion-label>
<ion-datetime (ionChange)="change($event)" cancelText="取消" doneText="确认" displayFormat="YYYY-MM-DD HH:mm"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择"
pickerFormat="YYYY MM DD HH mm" placeholder="请选择" [min]="nowDate"
[(ngModel)]="obj.visitTime"></ion-datetime>
<ion-label class="right-arrow">
<ion-icon name="arrow-forward"></ion-icon>
......
......@@ -28,6 +28,7 @@ export class VistorApplyPage {
applyId; //是否编辑
mineInfo; //申请人信息
nowDate;
constructor(public navCtrl: NavController, public navParams: NavParams, private actionSheetCtrl: ActionSheetController,
private serveSer: ServeService, public _modalCtrl: ModalController, private appMainSer: AppMainService,
......@@ -51,6 +52,7 @@ export class VistorApplyPage {
//时间初始化
initParams() {
this.nowDate = this.datePipe.transform(new Date(), 'yyyy-MM-ddTHH:mm');
const data = this.navParams.get('data');
if (data) {
// this.obj.visitTime = this.datePipe.transform(new Date(data.startTime).toISOString(), 'yyyy-MM-ddTHH:mm');
......
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