Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-ces
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
wisdom-ces
Commits
3025e2b6
Commit
3025e2b6
authored
Oct 17, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
ca5ad94d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
12 deletions
+46
-12
replace-apply.html
src/pages/activity-track/replace-apply/replace-apply.html
+1
-1
replace-apply.ts
src/pages/activity-track/replace-apply/replace-apply.ts
+45
-11
No files found.
src/pages/activity-track/replace-apply/replace-apply.html
View file @
3025e2b6
...
@@ -29,5 +29,5 @@
...
@@ -29,5 +29,5 @@
<ion-textarea
[(
ngModel
)]="
order
.
Orderbz
"
class=
"content-textarea"
></ion-textarea>
<ion-textarea
[(
ngModel
)]="
order
.
Orderbz
"
class=
"content-textarea"
></ion-textarea>
</ion-item>
</ion-item>
<button
class=
"submit-btn submit"
(
click
)="
submit
Order
()"
>
提交订单
</button>
<button
class=
"submit-btn submit"
(
click
)="
confirm
Order
()"
>
提交订单
</button>
</ion-content>
</ion-content>
src/pages/activity-track/replace-apply/replace-apply.ts
View file @
3025e2b6
...
@@ -53,15 +53,6 @@ export class ReplaceApplyPage {
...
@@ -53,15 +53,6 @@ export class ReplaceApplyPage {
.
subscribe
((
res
:
Response
)
=>
{
.
subscribe
((
res
:
Response
)
=>
{
this
.
activity
=
res
.
json
();
this
.
activity
=
res
.
json
();
this
.
batchList
=
this
.
activity
.
batchList
;
this
.
batchList
=
this
.
activity
.
batchList
;
// for( let i = 0;i<this.batchList.length;i++ ){
// let endDate = this.batchList[i].batchEndDate + " 24:00:00";
// endDate = new Date(endDate).getTime() +''; //判断是否过截止日期
// if( now > Number(endDate) ){ //已截止
// this.batchList[i].signUp = false;
// }else{ //
// this.batchList[i].signUp = true;
// }
// }
},
(
error
)
=>
{
},
(
error
)
=>
{
this
.
appService
.
alert
(
'网络异常!'
);
this
.
appService
.
alert
(
'网络异常!'
);
}
}
...
@@ -92,12 +83,55 @@ export class ReplaceApplyPage {
...
@@ -92,12 +83,55 @@ export class ReplaceApplyPage {
selectblock
(){
selectblock
(){
let
modal
=
this
.
modalCtrl
.
create
(
BlockModalPage
,{
blockList
:
this
.
batchList
});
let
modal
=
this
.
modalCtrl
.
create
(
BlockModalPage
,{
blockList
:
this
.
batchList
});
modal
.
onDidDismiss
(
res
=>
{
modal
.
onDidDismiss
(
res
=>
{
this
.
item
=
res
;
if
(
res
){
this
.
itemName
=
res
.
batchName
;
this
.
item
=
res
;
this
.
itemName
=
res
.
batchName
;
}
});
});
modal
.
present
();
modal
.
present
();
}
}
//报名
confirmOrder
(
orderId
)
{
//验证信息:
/**0.对于暂未有批次的。
1.判断携带人数是否超过限额人数。
leaveNum: 剩余人数
applyNum:报名批次数量
**/
if
(
!
this
.
item
){
this
.
appService
.
popToastView
(
"请选择报名批次"
,
'middle'
,
1000
);
return
false
;
}
if
(
new
Date
().
getTime
()
>
new
Date
(
this
.
item
.
batchEndDate
).
getTime
()
){
this
.
appService
.
popToastView
(
"该批次已过截止时间"
,
'middle'
,
1000
);
return
false
;
}
let
leaveNum
=
this
.
item
.
batchLimitNumber
-
this
.
item
.
hasSignUpCount
;
let
applyNum
=
0
;
this
.
activity
.
batchList
.
forEach
((
res
)
=>
{
if
(
res
.
order
){
console
.
log
(
res
.
order
);
applyNum
++
;
}
});
//报名次数 applyCount 1,2,3,4,5,0-> 不限
if
(
this
.
activity
.
applyCount
>
0
){
if
(
applyNum
>=
this
.
activity
.
applyCount
){
this
.
appService
.
popToastView
(
"提交失败,报名批次达到上限"
,
'middle'
,
1000
);
return
false
;
}
else
if
(
Number
(
this
.
order
.
Personnumber
+
1
)
>
Number
(
leaveNum
))
{
this
.
appService
.
popToastView
(
"报名人数超过了该批次的剩余人数"
,
'middle'
,
1000
);
return
false
;
}
else
{
this
.
submitOrder
();
}
}
else
{
//报名(新增)
this
.
submitOrder
();
}
}
// 提交订单
// 提交订单
submitOrder
(){
submitOrder
(){
const
order
=
{
const
order
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment