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
46613ff7
Commit
46613ff7
authored
Aug 18, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抢购
parent
3b95fc1c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
68 additions
and
50 deletions
+68
-50
fileHashes.bin
platforms/android/.gradle/4.1/fileHashes/fileHashes.bin
+0
-0
fileHashes.lock
platforms/android/.gradle/4.1/fileHashes/fileHashes.lock
+0
-0
fileSnapshots.bin
platforms/android/.gradle/4.1/taskHistory/fileSnapshots.bin
+0
-0
taskHistory.bin
platforms/android/.gradle/4.1/taskHistory/taskHistory.bin
+0
-0
taskHistory.lock
platforms/android/.gradle/4.1/taskHistory/taskHistory.lock
+0
-0
dex-renamer-state.txt
...ates/incremental/packageDebug/debug/dex-renamer-state.txt
+1
-1
food.html
src/pages/serve-pages/food/food.html
+1
-1
food.ts
src/pages/serve-pages/food/food.ts
+19
-22
rush-buy.html
src/pages/serve-pages/food/rush-buy/rush-buy.html
+20
-20
rush-buy.scss
src/pages/serve-pages/food/rush-buy/rush-buy.scss
+11
-2
rush-buy.ts
src/pages/serve-pages/food/rush-buy/rush-buy.ts
+16
-4
No files found.
platforms/android/.gradle/4.1/fileHashes/fileHashes.bin
View file @
46613ff7
No preview for this file type
platforms/android/.gradle/4.1/fileHashes/fileHashes.lock
View file @
46613ff7
No preview for this file type
platforms/android/.gradle/4.1/taskHistory/fileSnapshots.bin
View file @
46613ff7
No preview for this file type
platforms/android/.gradle/4.1/taskHistory/taskHistory.bin
View file @
46613ff7
No preview for this file type
platforms/android/.gradle/4.1/taskHistory/taskHistory.lock
View file @
46613ff7
No preview for this file type
platforms/android/app/build/intermediates/incremental/packageDebug/debug/dex-renamer-state.txt
View file @
46613ff7
#Sun Aug 18 1
5:09:5
3 CST 2019
#Sun Aug 18 1
7:34:0
3 CST 2019
base.0=/Users/ben/gitLab-project/party-build-cloud/platforms/android/app/build/intermediates/transforms/dexMerger/debug/0
renamed.0=classes.dex
file.0=/Users/ben/gitLab-project/party-build-cloud/platforms/android/app/build/intermediates/transforms/dexMerger/debug/0/classes.dex
src/pages/serve-pages/food/food.html
View file @
46613ff7
...
...
@@ -144,7 +144,7 @@
loadingSpinner=
"bubbles"
loadingText=
"加载中"
></ion-infinite-scroll-content>
</ion-infinite-scroll>
<ion-fab
*
ngIf=
"canShop"
right
bottom
>
<ion-fab
right
bottom
>
<button
ion-fab
color=
"light"
(
click
)="
buy
()"
>
<div
class=
"loader"
>
<div
class=
"rotation"
>
...
...
src/pages/serve-pages/food/food.ts
View file @
46613ff7
...
...
@@ -44,12 +44,10 @@ export class FoodPage {
isLoad
:
true
};
canShop
=
false
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
serveSer
:
ServeService
,
public
datePipe
:
DatePipe
,
private
commonSer
:
CommonService
,
private
appMainSer
:
AppMainService
)
{
this
.
getGoodsInfo
();
}
ionViewDidEnter
()
{
...
...
@@ -121,18 +119,6 @@ export class FoodPage {
)
}
//isPurchasing 0不再时间段 1可以抢购 2已抢完
getGoodsInfo
()
{
this
.
serveSer
.
getGoodsInfo
().
subscribe
(
(
res
)
=>
{
if
(
res
.
data
.
length
>
0
)
{
const
arr
=
res
.
data
.
filter
(
e
=>
e
.
isPurchasing
=
1
);
if
(
arr
.
length
>
0
)
this
.
canShop
=
true
;
}
}
)
}
getDate
(
e
)
{
this
.
date
=
e
;
this
.
getApply
();
...
...
@@ -195,13 +181,24 @@ export class FoodPage {
//抢购 每天的14:00-17:00
buy
()
{
const
nowDate
=
new
Date
().
getTime
();
const
startTime
=
new
Date
(
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM-dd'
)
+
' 14:00:00'
).
getTime
();
const
endTime
=
new
Date
(
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM-dd'
)
+
' 17:00:00'
).
getTime
();
if
(
startTime
<
nowDate
&&
nowDate
<
endTime
)
{
this
.
navCtrl
.
push
(
RushBuyPage
);
}
else
{
this
.
commonSer
.
toast
(
"抢购时间为每天的14:00~17:00"
);
}
this
.
serveSer
.
getGoodsInfo
().
subscribe
(
(
res
)
=>
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
const
arr
=
res
.
data
.
filter
(
e
=>
e
.
isPurchasing
==
0
);
if
(
arr
.
length
>
0
)
{
this
.
navCtrl
.
push
(
RushBuyPage
);
}
else
{
this
.
commonSer
.
toast
(
'未到抢购时间'
)
}
}
else
{
this
.
commonSer
.
toast
(
'未到抢购时间'
)
}
}
)
}
//isPurchasing 0不再时间段 1可以抢购 2已抢完
getGoodsInfo
()
{
}
}
src/pages/serve-pages/food/rush-buy/rush-buy.html
View file @
46613ff7
<ion-header>
<ion-navbar>
<ion-title>
抢购
</ion-title>
</ion-navbar>
<ion-navbar>
<ion-title>
抢购
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-item
(
click
)="
chooseFood
()"
>
<ion-label
class=
"item-left"
><span
class=
"color-red"
>
*
</span>
物品:
</ion-label>
<ion-label
[
ngStyle
]="{'
color
'
:obj
.
foodText =
=
'请选择'?'#
999
'
:
'#
333
'}"
class=
"choose"
>
{{obj.foodText}}
</ion-label>
<ion-label
class=
"right-arrow"
>
<ion-icon
name=
"arrow-forward"
></ion-icon>
</ion-label>
</ion-item>
<div
class=
"item-box"
>
<div
class=
"left"
>
数量:
</div>
<div
class=
"right num"
>
<span
class=
"reduce"
(
click
)="
reduce
()"
>
-
</span>
<input
type=
"number"
value=
"1"
[(
ngModel
)]="
obj
.
peopleCount
"
>
<span
class=
"add"
(
click
)="
add
()"
>
+
</span>
<ion-item
(
click
)="
chooseFood
()"
>
<ion-label
class=
"item-left"
><span
class=
"color-red"
>
*
</span>
物品:
</ion-label>
<ion-label
[
ngStyle
]="{'
color
'
:obj
.
foodText =
=
'请选择'?'#
999
'
:
'#
333
'}"
class=
"choose"
>
{{obj.foodText}}
</ion-label>
<ion-label
class=
"right-arrow"
>
<ion-icon
name=
"arrow-forward"
></ion-icon>
</ion-label>
</ion-item>
<div
class=
"item-box"
>
<div
class=
"left"
>
数量:
</div>
<div
class=
"right num"
>
<span
class=
"reduce"
(
click
)="
reduce
()"
>
-
</span>
<input
type=
"number"
value=
"1"
[(
ngModel
)]="
obj
.
peopleCount
"
>
<span
class=
"add"
(
click
)="
add
()"
>
+
</span>
</div>
</div>
</div
>
<button
class=
"submit-btn submit"
(
click
)="
save
()"
>
提交
</button>
<p
class=
"buy-remark"
>
{{obj.remark}}
</p
>
<button
class=
"submit-btn submit"
(
click
)="
save
()"
>
提交
</button>
</ion-content>
src/pages/serve-pages/food/rush-buy/rush-buy.scss
View file @
46613ff7
page-rush-buy
{
.num
{
text-align
:
right
;
input
{
width
:
40px
;
height
:
24px
;
...
...
@@ -11,7 +12,8 @@ page-rush-buy {
border
:
1px
solid
#f2f2f2
;
margin
:
0
8px
;
}
span
{
span
{
font-size
:
2
.5rem
;
font-weight
:
bold
;
vertical-align
:
initial
;
...
...
@@ -40,7 +42,8 @@ page-rush-buy {
text-align
:
right
;
font-size
:
1
.4rem
;
}
ion-datetime
{
ion-datetime
{
padding-right
:
18px
!
important
;
}
...
...
@@ -130,4 +133,10 @@ page-rush-buy {
}
}
.buy-remark
{
padding
:
20px
;
color
:
#666
;
letter-spacing
:
1px
;
}
}
src/pages/serve-pages/food/rush-buy/rush-buy.ts
View file @
46613ff7
import
{
Component
}
from
'@angular/core'
;
import
{
ActionSheetController
,
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
ActionSheetController
,
IonicPage
,
LoadingController
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
ServeService
}
from
"../../serve.service"
;
import
{
CommonService
}
from
"../../../../provide/common.service"
;
...
...
@@ -15,12 +15,14 @@ export class RushBuyPage {
foodText
:
'请选择'
,
type
:
null
,
unitPrice
:
null
,
version
:
null
version
:
null
,
remark
:
null
};
foodList
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
commonSer
:
CommonService
,
private
actionSheetCtrl
:
ActionSheetController
,
private
serveSer
:
ServeService
)
{
private
actionSheetCtrl
:
ActionSheetController
,
private
serveSer
:
ServeService
,
private
loadCtrl
:
LoadingController
)
{
}
ionViewDidLoad
()
{
...
...
@@ -32,6 +34,11 @@ export class RushBuyPage {
this
.
serveSer
.
getGoodsInfo
().
subscribe
(
(
res
)
=>
{
this
.
foodList
=
res
.
data
;
this
.
obj
.
foodText
=
this
.
foodList
[
0
].
goodsName
;
this
.
obj
.
version
=
this
.
foodList
[
0
].
version
;
this
.
obj
.
unitPrice
=
this
.
foodList
[
0
].
unitPrice
;
this
.
obj
.
type
=
this
.
foodList
[
0
].
id
this
.
obj
.
remark
=
this
.
foodList
[
0
].
remark
}
)
}
...
...
@@ -79,15 +86,20 @@ export class RushBuyPage {
this
.
commonSer
.
toast
(
'请选择物品'
);
return
false
;
}
const
loading
=
this
.
loadCtrl
.
create
({
content
:
'抢购中...'
,
});
loading
.
present
();
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
)
=>
{
loading
.
dismiss
();
if
(
res
.
errcode
==
"1000"
)
{
this
.
commonSer
.
toast
(
'抢购成功'
);
this
.
navCtrl
.
pop
();
...
...
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