Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
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
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
72c94007
Commit
72c94007
authored
Aug 14, 2024
by
张娇(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车渲染
parent
58cc4489
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
cart.vue
src/pages/assistingAgriculture/cart/cart.vue
+6
-5
No files found.
src/pages/assistingAgriculture/cart/cart.vue
View file @
72c94007
...
...
@@ -14,7 +14,7 @@
<wd-icon
name=
"arrow-right"
size=
"32rpx"
style=
"margin-left: -15rpx"
></wd-icon>
</div>
<div
class=
"commodity-list"
>
<div
class=
"commodity-item flex-align-center"
v-for=
"(item, j) in s
econdaryList
"
:key=
"j"
>
<div
class=
"commodity-item flex-align-center"
v-for=
"(item, j) in s
hop.prodInfos
"
:key=
"j"
>
<div
class=
"check"
:class=
"
{ 'is-checked': item.isChecked }"
...
...
@@ -61,6 +61,7 @@ import { ref, computed, onMounted } from 'vue';
import
{
getshoppingCartList
}
from
'../../../api/packageDetail'
;
import
{
categoryPresaleList
}
from
'../../../api/assistingAgriculture/building'
;
import
{
quantity
}
from
'../../../api/assistingAgriculture/shop'
;
// 计算是否全选
const
checkedAll
=
computed
(()
=>
{
return
cartList
.
value
.
every
((
item
)
=>
item
.
isChecked
);
...
...
@@ -103,18 +104,18 @@ const changeCheckedAll = () => {
});
};
// 购物车列表
const
presaleSortList
=
(
index
)
=>
{
const
presaleSortList
=
()
=>
{
getshoppingCartList
({}).
then
((
res
)
=>
{
cartList
.
value
=
res
.
data
;
cartList
.
value
.
forEach
((
shop
)
=>
{
secondaryList
.
value
=
shop
.
prodInfos
;
secondaryList
.
value
.
forEach
((
item
)
=>
{
shop
.
prodInfos
.
forEach
((
item
)
=>
{
item
.
count
=
item
.
basket
.
basketCount
;
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
});
});
};
// 购物车数量修改
const
changeQuantity
=
async
(
item
)
=>
{
const
res
=
await
quantity
({
...
...
@@ -145,7 +146,7 @@ function toSettle() {
});
return
;
}
const
shopIds
=
selected
const
shopIds
=
cartList
.
value
.
map
((
item
)
=>
item
.
shopId
)
.
filter
((
value
,
index
,
self
)
=>
self
.
indexOf
(
value
)
===
index
);
if
(
shopIds
.
length
>
1
)
{
...
...
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