Commit fa286e2b authored by wangqinghua's avatar wangqinghua

key update

parent c1d842c6
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<span *ngIf="item.typeList && item.typeList.includes(2)">晚餐</span> <span *ngIf="item.typeList && item.typeList.includes(2)">晚餐</span>
</span> </span>
</p> </p>
<p (click)="removeItem(item)" class="cancelBtn"> <span>取消</span> </p> <p *ngIf="nowDate < item.orderDateTime" (click)="removeItem(item)" class="cancelBtn"> <span>取消</span> </p>
</ion-item> </ion-item>
<ion-item *ngIf="item.diffFlag == 2"> <ion-item *ngIf="item.diffFlag == 2">
<p> <p>
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<span>{{item.orderDate | date:'yyyy-MM-dd'}}</span> <span>{{item.orderDate | date:'yyyy-MM-dd'}}</span>
</span> </span>
</p> </p>
<p (click)="removeItem(item)" class="cancelBtn"> <span>取消</span> </p> <p *ngIf="nowDate < item.orderDateTime" (click)="removeItem(item)" class="cancelBtn"> <span>取消</span> </p>
</ion-item> </ion-item>
</ion-item-sliding> </ion-item-sliding>
......
...@@ -44,6 +44,8 @@ export class FoodPage { ...@@ -44,6 +44,8 @@ export class FoodPage {
isLoad: true isLoad: true
}; };
nowDate;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public datePipe: DatePipe, private serveSer: ServeService, public datePipe: DatePipe,
...@@ -79,6 +81,9 @@ export class FoodPage { ...@@ -79,6 +81,9 @@ export class FoodPage {
this.serveSer.myBook(data).subscribe( this.serveSer.myBook(data).subscribe(
(res) => { (res) => {
this.page.isLoad = false; this.page.isLoad = false;
res.data.list.forEach(e => {
e.orderDateTime = new Date(e.orderDate + ' 00:00:00').getTime();
});
this.applyList = res.data.list; this.applyList = res.data.list;
this.page.total = res.data.total; this.page.total = res.data.total;
timer(800).subscribe(() => e.complete()); timer(800).subscribe(() => e.complete());
...@@ -102,6 +107,7 @@ export class FoodPage { ...@@ -102,6 +107,7 @@ export class FoodPage {
(res) => { (res) => {
this.page.total = res.data.total; this.page.total = res.data.total;
res.data.list.forEach(e => { res.data.list.forEach(e => {
e.orderDateTime = new Date(e.orderDate + ' 00:00:00').getTime();
this.applyList.push(e); this.applyList.push(e);
}); });
timer(800).subscribe(() => e.complete()); timer(800).subscribe(() => e.complete());
...@@ -126,6 +132,7 @@ export class FoodPage { ...@@ -126,6 +132,7 @@ export class FoodPage {
//我的预定 //我的预定
myApply() { myApply() {
this.nowDate = new Date().getTime();
const data = { const data = {
P_pageNumber: this.page.P_pageNumber, P_pageNumber: this.page.P_pageNumber,
P_pageSize: this.page.P_pageSize, P_pageSize: this.page.P_pageSize,
...@@ -134,6 +141,10 @@ export class FoodPage { ...@@ -134,6 +141,10 @@ export class FoodPage {
(res) => { (res) => {
this.page.isLoad = false; this.page.isLoad = false;
this.applyList = res.data.list; this.applyList = res.data.list;
//orderDate
this.applyList.forEach(e => {
e.orderDateTime = new Date(e.orderDate + ' 00:00:00').getTime();
})
this.page.total = res.data.total; this.page.total = res.data.total;
} }
) )
...@@ -145,7 +156,7 @@ export class FoodPage { ...@@ -145,7 +156,7 @@ export class FoodPage {
this.commonSer.toast("已过期不可取消"); this.commonSer.toast("已过期不可取消");
return; return;
} }
this.commonSer.alert('确定取消?',()=>{ this.commonSer.alert('确定取消?', () => {
this.serveSer.cancelMeals(item.id).subscribe( this.serveSer.cancelMeals(item.id).subscribe(
(res) => { (res) => {
if (res.errcode == 1000) { if (res.errcode == 1000) {
......
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
</div> </div>
<div class="morning-room"> <div class="morning-room">
<ng-container *ngFor="let item2 of room?.afternoonUse"> <ng-container *ngFor="let item2 of room?.afternoonUse">
<span [ngClass]="item2.isImportant == 1?'import':''" *ngIf="role.includes(9) || item2.userName == mineInfo?.username" <span [ngClass]="item2.isImportant == 1?'import':''"
*ngIf="role.includes(9) || item2.userName == mineInfo?.username"
(click)="goApplyEdit(item2)"> (click)="goApplyEdit(item2)">
<span *ngIf="item2.startEnd == 4">13:00-14:00</span> <span *ngIf="item2.startEnd == 4">13:00-14:00</span>
<span *ngIf="item2.startEnd == 5">14:00-15:00</span> <span *ngIf="item2.startEnd == 5">14:00-15:00</span>
...@@ -134,7 +135,8 @@ ...@@ -134,7 +135,8 @@
<span *ngIf="item.startEnd == 7">16:00-17:00</span> <span *ngIf="item.startEnd == 7">16:00-17:00</span>
</span> </span>
</p> </p>
<p (click)="removeItem(item)" class="cancelBtn"> <span>取消</span> </p> <p *ngIf="nowDate < item.appointmentTime" (click)="removeItem(item)" class="cancelBtn">
<span>取消</span></p>
</ion-item> </ion-item>
</ion-item-sliding> </ion-item-sliding>
</ion-list> </ion-list>
......
...@@ -42,6 +42,7 @@ export class HairCutPage { ...@@ -42,6 +42,7 @@ export class HairCutPage {
}; };
mineInfo; //登录人信息 mineInfo; //登录人信息
nowDate;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
private serveSer: ServeService, public datePipe: DatePipe, private tabSer: TabsService, private serveSer: ServeService, public datePipe: DatePipe, private tabSer: TabsService,
...@@ -90,12 +91,16 @@ export class HairCutPage { ...@@ -90,12 +91,16 @@ export class HairCutPage {
this.page.isLoad = false; this.page.isLoad = false;
this.applyList = res.data.list; this.applyList = res.data.list;
this.page.total = res.data.total; this.page.total = res.data.total;
this.applyList.forEach(e=>{
e.appointmentTime = new Date(e.appointmentDate+' 00:00:00').getTime();
})
timer(800).subscribe(e.complete()); timer(800).subscribe(e.complete());
} }
) )
} }
doInfinite(e) { doInfinite(e) {
this.nowDate = new Date().getTime();
if (this.page.total == this.applyList.length) { if (this.page.total == this.applyList.length) {
e.enable(false); e.enable(false);
return false; return false;
...@@ -108,9 +113,10 @@ export class HairCutPage { ...@@ -108,9 +113,10 @@ export class HairCutPage {
this.serveSer.myAppointment(data).subscribe( this.serveSer.myAppointment(data).subscribe(
(res) => { (res) => {
this.page.total = res.total; this.page.total = res.total;
res.list.forEach(e => { this.applyList = this.applyList.concat(res.list);
this.applyList.push(e); this.applyList.forEach(e=>{
}); e.appointmentTime = new Date(e.appointmentDate+' 00:00:00').getTime();
})
timer(800).subscribe(() => e.complete()); timer(800).subscribe(() => e.complete());
} }
) )
...@@ -118,6 +124,7 @@ export class HairCutPage { ...@@ -118,6 +124,7 @@ export class HairCutPage {
//我的预定 //我的预定
myApply() { myApply() {
this.nowDate = new Date().getTime();
const data = { const data = {
P_pageNumber: this.page.P_pageNumber, P_pageNumber: this.page.P_pageNumber,
P_pageSize: this.page.P_pageSize, P_pageSize: this.page.P_pageSize,
...@@ -127,6 +134,9 @@ export class HairCutPage { ...@@ -127,6 +134,9 @@ export class HairCutPage {
this.page.isLoad = false; this.page.isLoad = false;
this.applyList = res.data.list; this.applyList = res.data.list;
this.page.total = res.data.total; this.page.total = res.data.total;
this.applyList.forEach(e=>{
e.appointmentTime = new Date(e.appointmentDate+' 00:00:00').getTime();
})
} }
) )
} }
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<span>{{item.phone}}</span> <span>{{item.phone}}</span>
</span> </span>
</p> </p>
<p *ngIf="nowDate < item.startTime" (click)="removeItem(item)" class="cancelBtn"> <p *ngIf="nowDate < item.startTime" (click)="removeItem(item,$event)" class="cancelBtn">
<span>取消</span></p> <span>取消</span></p>
</ion-item> </ion-item>
</ion-item-sliding> </ion-item-sliding>
......
...@@ -144,7 +144,8 @@ export class UseCarPage { ...@@ -144,7 +144,8 @@ export class UseCarPage {
} }
//取消预定 //取消预定
removeItem(item) { removeItem(item, ev) {
ev.stopPropagation();
if (item.startTime < new Date().getTime()) { if (item.startTime < new Date().getTime()) {
this.commonSer.toast("已过期不可取消"); this.commonSer.toast("已过期不可取消");
return; return;
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
</button> </button>
</ion-col> </ion-col>
</ion-row> </ion-row>
<p *ngIf="nowDate < item.startTime" (click)="removeItem(item,$event)" class="cancelBtn"> <span>取消</span> </p> <p *ngIf="nowDate < item.visitTime" (click)="removeItem(item,$event)" class="cancelBtn"> <span>取消</span> </p>
</ion-item> </ion-item>
</ion-item-sliding> </ion-item-sliding>
</ion-list> </ion-list>
......
...@@ -107,7 +107,7 @@ export class VistorRegisterPage { ...@@ -107,7 +107,7 @@ export class VistorRegisterPage {
//取消预定 //取消预定
removeItem(item, ev) { removeItem(item, ev) {
ev.stopPropagation(); ev.stopPropagation();
if (item.submitTime < new Date().getTime() || item.status == 2) { if (item.visitTime < new Date().getTime() || item.status == 2) {
this.commonSer.toast("已过期不可取消"); this.commonSer.toast("已过期不可取消");
return; return;
} }
......
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