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
d46d29b8
Commit
d46d29b8
authored
Jul 31, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车优化
parent
be643688
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
43 deletions
+70
-43
spces.ts
src/components/spces/spces.ts
+5
-5
goods-cart.html
...ages/serve-pages/goods-collect/goods-cart/goods-cart.html
+30
-22
goods-cart.scss
...ages/serve-pages/goods-collect/goods-cart/goods-cart.scss
+21
-6
goods-cart.ts
src/pages/serve-pages/goods-collect/goods-cart/goods-cart.ts
+2
-0
goods-collect.ts
src/pages/serve-pages/goods-collect/goods-collect.ts
+12
-10
No files found.
src/components/spces/spces.ts
View file @
d46d29b8
...
@@ -70,23 +70,23 @@ export class SpcesComponent {
...
@@ -70,23 +70,23 @@ export class SpcesComponent {
this
.
choose
.
id
=
this
.
goods
.
id
;
this
.
choose
.
id
=
this
.
goods
.
id
;
this
.
choose
.
model
=
this
.
goods
.
model
;
this
.
choose
.
model
=
this
.
goods
.
model
;
console
.
log
(
this
.
choose
);
console
.
log
(
this
.
choose
);
if
(
this
.
goods
.
specs1List
.
length
>
0
&&
!
this
.
choose
.
specs1
){
if
(
this
.
goods
.
specs1List
&&
this
.
goods
.
specs1List
.
length
>
0
&&
!
this
.
choose
.
specs1
){
this
.
commonSer
.
toast
(
'请选择规格!'
);
this
.
commonSer
.
toast
(
'请选择规格!'
);
return
false
;
return
false
;
}
}
if
(
this
.
goods
.
specs2List
.
length
>
0
&&
!
this
.
choose
.
specs2
){
if
(
this
.
goods
.
specs2List
&&
this
.
goods
.
specs2List
.
length
>
0
&&
!
this
.
choose
.
specs2
){
this
.
commonSer
.
toast
(
'请选择规格!'
);
this
.
commonSer
.
toast
(
'请选择规格!'
);
return
false
;
return
false
;
}
}
if
(
this
.
goods
.
specs3List
.
length
>
0
&&
!
this
.
choose
.
specs3
){
if
(
this
.
goods
.
specs3List
&&
this
.
goods
.
specs3List
.
length
>
0
&&
!
this
.
choose
.
specs3
){
this
.
commonSer
.
toast
(
'请选择规格!'
);
this
.
commonSer
.
toast
(
'请选择规格!'
);
return
false
;
return
false
;
}
}
if
(
this
.
goods
.
specs4List
.
length
>
0
&&
!
this
.
choose
.
specs4
){
if
(
this
.
goods
.
specs4List
&&
this
.
goods
.
specs4List
.
length
>
0
&&
!
this
.
choose
.
specs4
){
this
.
commonSer
.
toast
(
'请选择规格!'
);
this
.
commonSer
.
toast
(
'请选择规格!'
);
return
false
;
return
false
;
}
}
if
(
this
.
goods
.
specs5List
.
length
>
0
&&
!
this
.
choose
.
specs5
){
if
(
this
.
goods
.
specs5List
&&
this
.
goods
.
specs5List
.
length
>
0
&&
!
this
.
choose
.
specs5
){
this
.
commonSer
.
toast
(
'请选择规格!'
);
this
.
commonSer
.
toast
(
'请选择规格!'
);
return
false
;
return
false
;
}
}
...
...
src/pages/serve-pages/goods-collect/goods-cart/goods-cart.html
View file @
d46d29b8
...
@@ -12,35 +12,43 @@
...
@@ -12,35 +12,43 @@
<ion-content>
<ion-content>
<div
class=
"goodsItem"
*
ngFor=
"let goods of cartList"
>
<div
class=
"cart"
>
<ion-row
class=
"cart-item"
>
<div
class=
"goodsItem"
*
ngFor=
"let goods of cartList"
>
<ion-col
col-2
class=
"center"
>
<ion-row
class=
"cart-item"
>
<ion-checkbox
[(
ngModel
)]="
goods
.
checkbox
"
color=
"danger"
<ion-col
col-2
class=
"center"
>
(
ngModelChange
)="
changeCheck
(
goods
)"
></ion-checkbox>
<ion-checkbox
[(
ngModel
)]="
goods
.
checkbox
"
color=
"danger"
</ion-col>
(
ngModelChange
)="
changeCheck
(
goods
)"
></ion-checkbox>
<ion-col
col-6
>
</ion-col>
<p
class=
"model"
>
<ion-col
col-6
>
{{goods.model}}
<p
class=
"model"
>
</p>
{{goods.model}}
<p>
</p>
<span
class=
"amount"
>
数量:{{goods.amount}}
</span>
<p>
<span
class=
"specs"
>
规格:
<span
class=
"amount"
>
数量:{{goods.amount}}
</span>
<span
class=
"specs"
>
规格:
<span>
{{goods.specs1}}
</span>
<span>
{{goods.specs1}}
</span>
<span>
{{goods.specs2}}
</span>
<span>
{{goods.specs2}}
</span>
<span>
{{goods.specs3}}
</span>
<span>
{{goods.specs3}}
</span>
<span>
{{goods.specs4}}
</span>
<span>
{{goods.specs4}}
</span>
<span>
{{goods.specs5}}
</span>
<span>
{{goods.specs5}}
</span>
</span>
</span>
</p>
</p>
</ion-col>
</ion-col>
<ion-col
col-2
class=
"center"
(
click
)="
deletI
(
goods
)"
>
<ion-col
col-2
class=
"center"
(
click
)="
deletI
(
goods
)"
>
<span
class=
"icon iconfont icon-round-delete"
></span>
<span
class=
"icon iconfont icon-round-delete"
></span>
</ion-col>
</ion-col>
<ion-col
col-2
class=
"center"
(
click
)="
choose
(
goods
)"
>
<ion-col
col-2
class=
"center"
(
click
)="
choose
(
goods
)"
>
<span
class=
"icon iconfont icon-fabu"
></span>
<span
class=
"icon iconfont icon-fabu"
></span>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
</div>
</div>
</div>
<ion-list
text-center
style=
"margin-top: 10rem;color: #666666"
*
ngIf=
"!isLoad && cartList.length == 0"
>
<img
style=
"width: 20%;"
src=
"./assets/imgs/no-info.png"
alt=
""
>
<p
text-center
>
购物车空空如也
</p>
</ion-list>
</ion-content>
</ion-content>
<div
*
ngIf=
"footerView"
class=
"stuff-footer"
>
<div
*
ngIf=
"footerView"
class=
"stuff-footer"
>
<div
class=
"footer-flex"
>
<div
class=
"footer-flex"
>
...
...
src/pages/serve-pages/goods-collect/goods-cart/goods-cart.scss
View file @
d46d29b8
page-goods-cart
{
page-goods-cart
{
.cart
{
margin-bottom
:
8rem
;
}
.stuff-footer
{
.stuff-footer
{
position
:
fixed
;
position
:
fixed
;
bottom
:
0
;
bottom
:
0
;
height
:
4
rem
;
height
:
5
rem
;
width
:
100%
;
width
:
100%
;
text-align
:
center
;
text-align
:
center
;
border-top
:
1px
solid
#eeeeee
;
border-top
:
1px
solid
#eeeeee
;
z-index
:
9
;
z-index
:
9
;
background-color
:
#fff
;
.item-ios.item-block
.item-inner
{
border
:
none
;
}
.button-small-ios
{
height
:
2
.6rem
;
}
img
{
img
{
margin-top
:
.5rem
;
margin-top
:
.5rem
;
...
@@ -49,7 +61,8 @@ page-goods-cart {
...
@@ -49,7 +61,8 @@ page-goods-cart {
border-bottom
:
1px
solid
#ddd
;
border-bottom
:
1px
solid
#ddd
;
margin-bottom
:
5px
;
margin-bottom
:
5px
;
padding
:
5px
;
padding
:
5px
;
.model
{
.model
{
padding
:
5px
0
;
padding
:
5px
0
;
font-size
:
1
.4rem
;
font-size
:
1
.4rem
;
}
}
...
@@ -69,18 +82,20 @@ page-goods-cart {
...
@@ -69,18 +82,20 @@ page-goods-cart {
}
}
}
}
.center
{
.center
{
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
}
}
}
}
.footer-flex
{
.footer-flex
{
display
:
flex
;
display
:
flex
;
}
}
.footer-flex
>
div
{
.footer-flex
>
div
{
width
:
50%
;
width
:
50%
;
line-height
:
3
rem
;
line-height
:
4
rem
;
padding
:
0
20px
;
padding
:
0
20px
;
}
}
...
...
src/pages/serve-pages/goods-collect/goods-cart/goods-cart.ts
View file @
d46d29b8
...
@@ -16,6 +16,7 @@ export class GoodsCartPage {
...
@@ -16,6 +16,7 @@ export class GoodsCartPage {
chooseObj
=
[];
chooseObj
=
[];
checkAll
;
checkAll
;
isLoad
=
true
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
serveSer
:
ServeService
,
private
modalCtrl
:
ModalController
,
private
serveSer
:
ServeService
,
private
modalCtrl
:
ModalController
,
...
@@ -66,6 +67,7 @@ export class GoodsCartPage {
...
@@ -66,6 +67,7 @@ export class GoodsCartPage {
this
.
serveSer
.
shoppingCar
(
data
).
subscribe
(
this
.
serveSer
.
shoppingCar
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
cartList
=
res
.
list
;
this
.
cartList
=
res
.
list
;
this
.
isLoad
=
false
;
this
.
cartList
.
forEach
(
e
=>
{
this
.
cartList
.
forEach
(
e
=>
{
e
.
checkbox
=
false
;
e
.
checkbox
=
false
;
})
})
...
...
src/pages/serve-pages/goods-collect/goods-collect.ts
View file @
d46d29b8
...
@@ -45,12 +45,12 @@ export class GoodsCollectPage {
...
@@ -45,12 +45,12 @@ export class GoodsCollectPage {
this
.
getTypeList
();
this
.
getTypeList
();
}
}
search
(){
search
()
{
this
.
pageNumber
=
1
;
this
.
pageNumber
=
1
;
this
.
getList
();
this
.
getList
();
}
}
filterType
(
item
){
filterType
(
item
)
{
this
.
obj
.
type
=
item
;
this
.
obj
.
type
=
item
;
this
.
getList
();
this
.
getList
();
}
}
...
@@ -82,12 +82,14 @@ export class GoodsCollectPage {
...
@@ -82,12 +82,14 @@ export class GoodsCollectPage {
//打开过滤条件
//打开过滤条件
fliter
()
{
fliter
()
{
let
modal
=
this
.
modalCtrl
.
create
(
FilterComponent
,
{
list
:
this
.
typeList
,
choose
:
this
.
obj
.
type
},
{
let
modal
=
this
.
modalCtrl
.
create
(
FilterComponent
,
{
list
:
this
.
typeList
,
choose
:
this
.
obj
.
type
},
{
enterAnimation
:
'modal-from-right-enter'
,
enterAnimation
:
'modal-from-right-enter'
,
leaveAnimation
:
'modal-from-right-leave'
leaveAnimation
:
'modal-from-right-leave'
});
});
modal
.
onDidDismiss
(
data
=>
{
modal
.
onDidDismiss
(
data
=>
{
this
.
filterType
(
data
.
choose
);
if
(
data
)
{
this
.
filterType
(
data
.
choose
);
}
});
});
modal
.
present
();
modal
.
present
();
}
}
...
@@ -142,7 +144,7 @@ export class GoodsCollectPage {
...
@@ -142,7 +144,7 @@ export class GoodsCollectPage {
}
}
//选择规格 数量
//选择规格 数量
choose
(
item
){
choose
(
item
)
{
let
modal
=
this
.
modalCtrl
.
create
(
SpcesComponent
,
{
goodsId
:
item
.
id
});
let
modal
=
this
.
modalCtrl
.
create
(
SpcesComponent
,
{
goodsId
:
item
.
id
});
modal
.
onDidDismiss
(
res
=>
{
modal
.
onDidDismiss
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
...
@@ -154,20 +156,20 @@ export class GoodsCollectPage {
...
@@ -154,20 +156,20 @@ export class GoodsCollectPage {
}
}
//添加到购物车
//添加到购物车
addCart
(){
addCart
()
{
const
data
=
{
const
data
=
{
"status"
:
1
,
"status"
:
1
,
"orderSuppies"
:[
this
.
chooseObj
]
"orderSuppies"
:
[
this
.
chooseObj
]
};
};
this
.
serveSer
.
saveOrder
(
data
).
subscribe
(
this
.
serveSer
.
saveOrder
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
commonSer
.
toast
(
'添加成功!'
)
this
.
commonSer
.
toast
(
'添加成功!'
)
}
}
)
)
}
}
//购物车
//购物车
goCart
(){
goCart
()
{
this
.
navCtrl
.
push
(
GoodsCartPage
);
this
.
navCtrl
.
push
(
GoodsCartPage
);
}
}
...
...
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