Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c0e1f693
authored
Feb 15, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
接口联调
1 parent
4fa73149
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
20 deletions
src/views/purchase/components/goodsDetailCom.vue
src/views/purchase/components/shoppingCartCom.vue
src/views/purchase/purchasingMall.vue
src/views/purchase/components/goodsDetailCom.vue
View file @
c0e1f69
...
...
@@ -44,6 +44,7 @@
<
/div>
<
el
-
button
class
=
"carBtn"
icon
=
"carIcon"
type
=
"primary"
@
click
=
"updateCarShopping"
>
加入购物车
<
/el-button>
<
/div>
<!--
<
i
class
=
"carIcon"
><
/i> -->
...
...
@@ -289,8 +290,8 @@ export default {
}
}
.
carBtn
{
color
:
#
ffffff
;
background
-
color
:
#
185
efe
;
//
color: #ffffff;
//
background-color: #185efe;
display
:
flex
;
align
-
items
:
center
;
}
...
...
src/views/purchase/components/shoppingCartCom.vue
View file @
c0e1f69
<
template
>
<div
class=
"shopCarCon"
>
<div
class=
"carBtnCon"
@
click=
"drawer = true"
>
购物车按钮
</div>
<el-button
class=
"carBtnCon"
type=
"primary"
:data-attr=
"goodsTotalNumber"
icon=
"carIcon"
@
click=
"drawer = true"
>
购物车
</el-button>
<el-drawer
class=
"shoppingCartDrawerCon"
title=
"
我是标题
"
title=
"
购物车
"
:visible
.
sync=
"drawer"
size=
"500px"
:direction=
"direction"
>
...
...
@@ -33,7 +36,14 @@
</div>
</div>
</div>
<div
class=
"totalCon"
>
总价
{{
totalPrice
}}
</div>
<div
class=
"totalCon"
>
<span
class=
"label"
>
总价:
</span>
<span
class=
"num"
>
¥
{{
totalPrice
}}
</span>
<!--
<div></div>
-->
<el-button
class=
"submitBtn"
@
click=
"handleSubmit"
type=
"primary"
>
结算
</el-button>
</div>
</el-drawer>
</div>
</
template
>
...
...
@@ -48,6 +58,7 @@ export default {
direction
:
'rtl'
,
isAllCheck
:
true
,
totalPrice
:
0
,
goodsTotalNumber
:
0
,
goodsList
:
[{
goodsType
:
1
,
goodsTypeName
:
"太阳膜"
,
...
...
@@ -133,11 +144,12 @@ export default {
},
mounted
()
{
this
.
restGoodsList
()
this
.
getGoodsList
()
// 更新购物车数据
this
.
$EventBus
.
$on
(
'updateCarShopping'
,
()
=>
{
console
.
log
(
'updateCarShopping'
)
// 需要执行的代码
//
console.log('updateCarShopping')
this
.
getGoodsList
()
})
// this.getGoodsList()
},
methods
:
{
deleteGoods
(
upgradeGoodsId
)
{
...
...
@@ -175,10 +187,13 @@ export default {
})
},
getGoodsList
()
{
listGroupByGoodsType
.
then
((
result
)
=>
{
listGroupByGoodsType
({}).
then
((
result
)
=>
{
let
goodsTotalNumber
=
0
console
.
log
(
result
)
this
.
goodsList
=
result
.
map
((
item
)
=>
{
// item.upgradeGoodsList
const
upgradeGoodsList
=
item
.
list
.
reduce
((
total
,
cur
)
=>
{
goodsTotalNumber
+=
cur
.
goodsNumber
total
.
push
({
upgradeGoodsName
:
cur
.
upgradeGoods
.
upgradeGoodsName
,
upgradeGoodsId
:
cur
.
upgradeGoodsId
,
...
...
@@ -194,6 +209,7 @@ export default {
upgradeGoodsList
}
})
this
.
goodsTotalNumber
=
goodsTotalNumber
this
.
restGoodsList
()
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
...
...
@@ -233,8 +249,15 @@ export default {
<
style
lang=
"scss"
scoped
>
.shoppingCartDrawerCon
{
box-sizing
:
border-box
;
//
position
:
relative
;
margin-top
:
20vh
;
::v-deep
.el-drawer__header
{
color
:
#333333
;
border-bottom
:
1px
solid
#e7eaec
;
margin-bottom
:
20px
;
padding-bottom
:
10px
;
font-weight
:
600
;
font-size
:
20px
;
}
//
padding-bottom
:
300px
;
::v-deep
.el-drawer.rtl
{
padding-bottom
:
50px
;
...
...
@@ -245,11 +268,60 @@ export default {
position
:
absolute
;
bottom
:
0
;
left
:
0
;
display
:
flex
;
align-items
:
center
;
width
:
100%
;
border-top
:
1px
solid
#e7eaec
;
color
:
#333333
;
padding
:
20px
20px
;
W
.num
{
margin-left
:
3px
;
font-size
:
20px
;
font-weight
:
600
;
color
:
#ee3040
;
}
.submitBtn
{
margin-left
:
auto
;
}
}
.carBtnCon
{
position
:
absolute
;
top
:
10vh
;
right
:
0
;
cursor
:
pointer
;
::v-deep
.carBtnCon
{
//
position
:
absolute
;
position
:
fixed
;
top
:
30vh
;
right
:
2vw
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
padding
:
32px
12px
;
&::after
{
//
content
:
"123"
;
content
:
attr
(
data-attr
);
box-sizing
:
border-box
;
position
:
absolute
;
//
right
:
7px
;
top
:
30px
;
left
:
30px
;
display
:
block
;
height
:
14px
;
border-radius
:
7px
;
padding
:
1px
4px
0
;
color
:
#185efe
;
background
:
#ffffff
;
//
width
:
100%
;
//
height
:
100%
;
//
background
:
url(../assets/img/car.png)
no-repeat
;
//
background-size
:
100%
100%
;
}
.carIcon
{
width
:
30px
;
height
:
30px
;
background-position
:
1px
0
;
margin
:
0
;
}
//
cursor
:
pointer
;
span
{
//
writing-mode
:
vertical-lr
;
writing-mode
:
vertical-lr
;
}
}
</
style
>
src/views/purchase/purchasingMall.vue
View file @
c0e1f69
...
...
@@ -34,7 +34,7 @@
v-for=
"(item, i) in navList"
:key=
"i"
@
click=
"getchange(item, i)"
:class=
"scopedSlots == i ? 'item-one' : ''"
>
{{
item
.
navItem
}}
</span>
:class=
"scopedSlots == i ? 'item-one' : ''"
>
{{
item
.
goodsTypeName
}}
</span>
</div>
<div
@
click=
"showMoreSourceList"
v-show=
"ulheight > 34"
...
...
@@ -123,7 +123,7 @@ export default {
return
{
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
addressComVisible
:
false
,
goodsDetailComVisible
:
tru
e
,
goodsDetailComVisible
:
fals
e
,
emptyImgUrl
:
require
(
'@/views/systemConfig/images/empty.png'
),
showFormData
:
[{
// label: '商户名称',
...
...
@@ -296,7 +296,7 @@ export default {
}
.goodsCon
{
display
:
flex
;
justify-content
:
space-between
;
//
justify-content
:
space-between
;
flex-wrap
:
wrap
;
.goodsItemCon
{
box-sizing
:
border-box
;
...
...
@@ -431,7 +431,7 @@ export default {
flex
:
1
;
display
:
flex
;
flex-wrap
:
wrap
;
padding-left
:
42px
;
//
padding-left
:
42px
;
height
:
33px
;
overflow
:
hidden
;
//
margin-left
:
30px
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment