Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
party-build-cloud
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
party-build-cloud
Commits
e243da46
Commit
e243da46
authored
Aug 18, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抢购
parent
717c0366
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
22 deletions
+80
-22
food.ts
src/pages/serve-pages/food/food.ts
+10
-1
rush-buy.html
src/pages/serve-pages/food/rush-buy/rush-buy.html
+2
-1
rush-buy.ts
src/pages/serve-pages/food/rush-buy/rush-buy.ts
+44
-8
serve.service.ts
src/pages/serve-pages/serve.service.ts
+0
-0
car-apply.html
src/pages/serve-pages/use-car/car-apply/car-apply.html
+6
-6
car-apply.ts
src/pages/serve-pages/use-car/car-apply/car-apply.ts
+18
-6
No files found.
src/pages/serve-pages/food/food.ts
View file @
e243da46
...
@@ -53,6 +53,7 @@ export class FoodPage {
...
@@ -53,6 +53,7 @@ export class FoodPage {
ionViewDidEnter
()
{
ionViewDidEnter
()
{
this
.
myApply
();
this
.
myApply
();
this
.
getApply
();
this
.
getApply
();
this
.
getGoodsInfo
();
}
}
ionViewDidLoad
()
{
ionViewDidLoad
()
{
...
@@ -119,6 +120,14 @@ export class FoodPage {
...
@@ -119,6 +120,14 @@ export class FoodPage {
)
)
}
}
getGoodsInfo
(){
this
.
serveSer
.
getGoodsInfo
().
subscribe
(
(
res
)
=>
{
}
)
}
getDate
(
e
)
{
getDate
(
e
)
{
this
.
date
=
e
;
this
.
date
=
e
;
this
.
getApply
();
this
.
getApply
();
...
@@ -182,7 +191,7 @@ export class FoodPage {
...
@@ -182,7 +191,7 @@ export class FoodPage {
//抢购 每天的14:00-17:00
//抢购 每天的14:00-17:00
buy
()
{
buy
()
{
const
nowDate
=
new
Date
().
getTime
();
const
nowDate
=
new
Date
().
getTime
();
const
startTime
=
new
Date
(
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM-dd'
)
+
' 1
3
:00:00'
).
getTime
();
const
startTime
=
new
Date
(
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM-dd'
)
+
' 1
0
:00:00'
).
getTime
();
const
endTime
=
new
Date
(
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM-dd'
)
+
' 17:00:00'
).
getTime
();
const
endTime
=
new
Date
(
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM-dd'
)
+
' 17:00:00'
).
getTime
();
if
(
startTime
<
nowDate
&&
nowDate
<
endTime
){
if
(
startTime
<
nowDate
&&
nowDate
<
endTime
){
this
.
commonSer
.
toast
(
'开始抢购'
);
this
.
commonSer
.
toast
(
'开始抢购'
);
...
...
src/pages/serve-pages/food/rush-buy/rush-buy.html
View file @
e243da46
...
@@ -21,8 +21,9 @@
...
@@ -21,8 +21,9 @@
<div
class=
"left"
>
数量:
</div>
<div
class=
"left"
>
数量:
</div>
<div
class=
"right num"
>
<div
class=
"right num"
>
<span
class=
"reduce"
(
click
)="
reduce
()"
>
-
</span>
<span
class=
"reduce"
(
click
)="
reduce
()"
>
-
</span>
<input
type=
"number"
value=
"1"
[(
ngModel
)]="
obj
.
am
ount
"
>
<input
type=
"number"
value=
"1"
[(
ngModel
)]="
obj
.
peopleC
ount
"
>
<span
class=
"add"
(
click
)="
add
()"
>
+
</span>
<span
class=
"add"
(
click
)="
add
()"
>
+
</span>
</div>
</div>
</div>
</div>
<button
class=
"submit-btn submit"
(
click
)="
save
()"
>
提交
</button>
</ion-content>
</ion-content>
src/pages/serve-pages/food/rush-buy/rush-buy.ts
View file @
e243da46
import
{
Component
}
from
'@angular/core'
;
import
{
Component
}
from
'@angular/core'
;
import
{
ActionSheetController
,
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
ActionSheetController
,
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
ServeService
}
from
"../../serve.service"
;
import
{
CommonService
}
from
"../../../../provide/common.service"
;
@
Component
({
@
Component
({
selector
:
'page-rush-buy'
,
selector
:
'page-rush-buy'
,
...
@@ -8,28 +10,42 @@ import {ActionSheetController, IonicPage, NavController, NavParams} from 'ionic-
...
@@ -8,28 +10,42 @@ import {ActionSheetController, IonicPage, NavController, NavParams} from 'ionic-
export
class
RushBuyPage
{
export
class
RushBuyPage
{
obj
=
{
obj
=
{
amount
:
null
,
peopleCount
:
10
,
food
:
''
,
food
:
''
,
foodText
:
'请选择'
,
foodText
:
'请选择'
,
type
:
null
,
unitPrice
:
null
,
version
:
null
};
};
foodList
;
foodList
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
commonSer
:
CommonService
,
private
actionSheetCtrl
:
ActionSheetController
)
{
private
actionSheetCtrl
:
ActionSheetController
,
private
serveSer
:
ServeService
)
{
}
}
ionViewDidLoad
()
{
ionViewDidLoad
()
{
console
.
log
(
'ionViewDidLoad RushBuyPage'
);
console
.
log
(
'ionViewDidLoad RushBuyPage'
);
this
.
getGoodsInfo
();
}
getGoodsInfo
()
{
this
.
serveSer
.
getGoodsInfo
().
subscribe
(
(
res
)
=>
{
this
.
foodList
=
res
.
data
;
}
)
}
}
chooseFood
()
{
chooseFood
()
{
const
btnArr
=
this
.
foodList
.
map
(
e
=>
{
const
btnArr
=
this
.
foodList
.
map
(
e
=>
{
const
data
=
{
const
data
=
{
text
:
e
.
n
ame
,
text
:
e
.
goodsN
ame
,
role
:
e
.
id
,
role
:
e
.
id
,
handler
:
()
=>
{
handler
:
()
=>
{
// this.obj.orgId = e.id;
this
.
obj
.
foodText
=
e
.
goodsName
;
// this.obj.orgText = e.name;
this
.
obj
.
version
=
e
.
version
;
this
.
obj
.
unitPrice
=
e
.
unitPrice
;
this
.
obj
.
type
=
e
.
id
}
}
};
};
return
data
;
return
data
;
...
@@ -50,12 +66,32 @@ export class RushBuyPage {
...
@@ -50,12 +66,32 @@ export class RushBuyPage {
//增加
//增加
add
()
{
add
()
{
if
(
this
.
obj
.
amount
<
10
)
this
.
obj
.
amount
++
;
if
(
this
.
obj
.
peopleCount
<
10
)
this
.
obj
.
peopleCount
++
;
}
}
//减少
//减少
reduce
()
{
reduce
()
{
if
(
this
.
obj
.
amount
>
1
)
this
.
obj
.
amount
--
;
if
(
this
.
obj
.
peopleCount
>
1
)
this
.
obj
.
peopleCount
--
;
}
save
()
{
const
data
=
{
diffFlag
:
'2'
,
type
:
this
.
obj
.
type
,
peopleCount
:
this
.
obj
.
peopleCount
,
unitPrice
:
this
.
obj
.
unitPrice
,
version
:
this
.
obj
.
version
}
this
.
serveSer
.
saveMeals
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errcode
==
"1000"
)
{
this
.
commonSer
.
toast
(
'抢购成功'
);
this
.
navCtrl
.
pop
();
}
else
{
this
.
commonSer
.
toast
(
res
.
errmsg
);
}
}
)
}
}
}
}
src/pages/serve-pages/serve.service.ts
View file @
e243da46
This diff is collapsed.
Click to expand it.
src/pages/serve-pages/use-car/car-apply/car-apply.html
View file @
e243da46
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
<div
class=
"padding-6"
>
<div
class=
"padding-6"
>
<ion-item>
<ion-item>
<ion-label
class=
"item-left"
><span
class=
"color-red"
>
*
</span>
用车时间:
</ion-label>
<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"
<ion-datetime
(
ionChange
)="
changeStartTime
($
event
)"
[
disabled
]="
type =
=
'
deal
'
"
cancelText=
"取消"
doneText=
"确认"
displayFormat=
"YYYY-MM-DD HH:mm"
pickerFormat=
"YYYY MM DD HH mm"
placeholder=
"请选择"
[
max
]="
obj
.
endTime
"
[
min
]="
nowDate
"
pickerFormat=
"YYYY MM DD HH mm"
placeholder=
"请选择"
[
max
]="
obj
.
endTime
Change
"
[
min
]="
nowDate
"
[(
ngModel
)]="
obj
.
startTime
"
></ion-datetime>
[(
ngModel
)]="
obj
.
startTime
Change
"
></ion-datetime>
<ion-label
class=
"right-arrow"
>
<ion-label
class=
"right-arrow"
>
<ion-icon
name=
"arrow-forward"
></ion-icon>
<ion-icon
name=
"arrow-forward"
></ion-icon>
</ion-label>
</ion-label>
...
@@ -21,9 +21,9 @@
...
@@ -21,9 +21,9 @@
</ion-item>
</ion-item>
<ion-item>
<ion-item>
<ion-label
class=
"item-left"
><span
class=
"color-red"
>
*
</span>
还车时间:
</ion-label>
<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"
<ion-datetime
(
ionChange
)="
changeEndTime
($
event
)"
[
disabled
]="
type =
=
'
deal
'
"
cancelText=
"取消"
doneText=
"确认"
displayFormat=
"YYYY-MM-DD HH:mm"
pickerFormat=
"YYYY MM DD HH mm"
placeholder=
"请选择"
[
min
]="
obj
.
startTime
"
pickerFormat=
"YYYY MM DD HH mm"
placeholder=
"请选择"
[
min
]="
obj
.
startTime
Change
"
[(
ngModel
)]="
obj
.
endTime
"
></ion-datetime>
[(
ngModel
)]="
obj
.
endTime
Change
"
></ion-datetime>
<ion-label
class=
"right-arrow"
>
<ion-label
class=
"right-arrow"
>
<ion-icon
name=
"arrow-forward"
></ion-icon>
<ion-icon
name=
"arrow-forward"
></ion-icon>
</ion-label>
</ion-label>
...
...
src/pages/serve-pages/use-car/car-apply/car-apply.ts
View file @
e243da46
...
@@ -14,7 +14,9 @@ export class CarApplyPage {
...
@@ -14,7 +14,9 @@ export class CarApplyPage {
obj
=
{
obj
=
{
startTime
:
null
,
startTime
:
null
,
startTimeChange
:
null
,
endTime
:
null
,
endTime
:
null
,
endTimeChange
:
null
,
carUser
:
''
,
carUser
:
''
,
useReason
:
''
,
useReason
:
''
,
useText
:
'请选择'
,
useText
:
'请选择'
,
...
@@ -59,11 +61,8 @@ export class CarApplyPage {
...
@@ -59,11 +61,8 @@ export class CarApplyPage {
if
(
data
)
{
if
(
data
)
{
}
else
{
}
else
{
this
.
obj
.
startTime
=
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM-ddTHH:mm'
);
this
.
obj
.
startTime
Change
=
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM-ddTHH:mm'
);
this
.
nowDate
=
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
)
}
}
}
}
...
@@ -91,6 +90,18 @@ export class CarApplyPage {
...
@@ -91,6 +90,18 @@ export class CarApplyPage {
)
)
}
}
changeStartTime
(
e
)
{
const
minute
=
e
.
minute
>
9
?
e
.
minute
:
'0'
+
e
.
minute
;
const
hour
=
e
.
hour
>
9
?
e
.
hour
:
'0'
+
e
.
hour
;
this
.
obj
.
startTime
=
e
.
year
+
'-'
+
e
.
month
+
'-'
+
e
.
day
+
" "
+
hour
+
":"
+
minute
+
":00"
;
}
changeEndTime
(
e
)
{
const
minute
=
e
.
minute
>
9
?
e
.
minute
:
'0'
+
e
.
minute
;
const
hour
=
e
.
hour
>
9
?
e
.
hour
:
'0'
+
e
.
hour
;
this
.
obj
.
endTime
=
e
.
year
+
'-'
+
e
.
month
+
'-'
+
e
.
day
+
" "
+
hour
+
":"
+
minute
+
":00"
;
}
//选择事由
//选择事由
chooseReason
()
{
chooseReason
()
{
const
buttonsArr
=
[
const
buttonsArr
=
[
...
@@ -200,14 +211,15 @@ export class CarApplyPage {
...
@@ -200,14 +211,15 @@ export class CarApplyPage {
carUser
.
push
(
e
.
id
);
carUser
.
push
(
e
.
id
);
});
});
const
data
=
<
any
>
{
const
data
=
<
any
>
{
startTime
:
new
Date
(
this
.
obj
.
startTime
).
getTime
()
-
8
*
60
*
60
*
1000
,
startTime
:
new
Date
(
this
.
obj
.
startTime
).
getTime
(),
endTime
:
new
Date
(
this
.
obj
.
endTime
).
getTime
()
-
8
*
60
*
60
*
1000
,
endTime
:
new
Date
(
this
.
obj
.
endTime
).
getTime
(),
passengerCount
:
this
.
obj
.
passengerCount
,
passengerCount
:
this
.
obj
.
passengerCount
,
carUser
:
carUser
.
join
(
","
),
carUser
:
carUser
.
join
(
","
),
useReason
:
this
.
obj
.
useReason
,
useReason
:
this
.
obj
.
useReason
,
fromTo
:
this
.
obj
.
fromTo
,
fromTo
:
this
.
obj
.
fromTo
,
};
};
if
(
this
.
applyId
)
data
.
id
=
this
.
applyId
;
if
(
this
.
applyId
)
data
.
id
=
this
.
applyId
;
console
.
log
(
data
);
this
.
commonSer
.
alert
(
'确认提交?'
,
()
=>
{
this
.
commonSer
.
alert
(
'确认提交?'
,
()
=>
{
this
.
serveSer
.
saveCarApply
(
data
).
subscribe
(
this
.
serveSer
.
saveCarApply
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
...
...
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