Commit 35dfe8ba authored by wangqinghua's avatar wangqinghua

防止订单多次提交

parent c336b4a8
......@@ -29,5 +29,5 @@
<ion-textarea [(ngModel)]="order.Orderbz"></ion-textarea>
</ion-item>
<button class="submit-btn submit" (click)="condirmAlert()">提交订单</button>
<button [disabled]="submitLoading" class="submit-btn submit" (click)="condirmAlert()">提交订单</button>
</ion-content>
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams, AlertController, ToastController, Events} from 'ionic-angular';
import {
IonicPage,
NavController,
NavParams,
AlertController,
ToastController,
Events,
LoadingController
} from 'ionic-angular';
import { MyActivityListPage } from "../../../mine/myActivityList/myActivityList";
import {Http, Response} from '@angular/http';
......@@ -8,6 +16,7 @@ import {AppService,AppGlobal} from "../../../../service/http.service";
import {ActivityConfirmPage} from "../activityConfirm/activityConfirm";
import { MinePage } from "../../../tabs/mine/mine";
import {ActivityDetailPage} from "../activityDetail/activityDetail";
import {CommonService} from "../../../../provide/common.service";
@IonicPage()
@Component({
......@@ -58,18 +67,15 @@ export class ActivityApplyPage {
//报名成功
isSuccess: boolean = false;
//报名失败
isError: boolean = false;
activityType: Array<String> = ['未知', '体检', '疗休养', '培训', '工会活动'];
submitLoading = false;
//活动须知
noticeArry: object[];
pageflag: boolean = false;
constructor(public navCtrl: NavController,
public navParams: NavParams, public storage: Storage,
public alertCtrl: AlertController,
public http: Http,
private commonSer:CommonService,
private loadCtrl:LoadingController,
public appService: AppService,
public toast: ToastController,
// public keyboard: Keyboard,
......@@ -127,6 +133,7 @@ export class ActivityApplyPage {
//报名
confirmOrder() {
this.submitLoading = true;
//验证信息:
/**0.对于暂未有批次的。
1.判断携带人数是否超过限额人数。
......@@ -158,7 +165,6 @@ export class ActivityApplyPage {
//报名操作
commitSignUpOrder() {
this.appService.ObserverHttpPost("/wisdomgroup/modules/order/create", this.order)
.subscribe((res: Response) => {
if (true) {
......@@ -177,6 +183,10 @@ export class ActivityApplyPage {
submitOrder() {
const loading = this.loadCtrl.create({
content:'报名中...'
});
loading.present();
this.order.Batchid = this.item.id;
this.order.Activityid = this.item.activityId;
this.order.batchlist = this.item.id + ',';
......@@ -184,11 +194,13 @@ export class ActivityApplyPage {
.subscribe((res: Response) => {
if (true) {
this.isSuccess = true;
this.commonSer.toast('报名成功');
//清空 插入
this.navCtrl.push("ActivityDetailPage", {id: this.item.activityId});
} else {
}
loading.dismiss();
}, error => {
}
);
......
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