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
1b07528b
Commit
1b07528b
authored
Aug 09, 2024
by
刘玉宏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
504a8ec6
cf72bbd2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
cart.vue
src/pages/assistingAgriculture/cart/cart.vue
+18
-8
No files found.
src/pages/assistingAgriculture/cart/cart.vue
View file @
1b07528b
...
@@ -127,24 +127,34 @@ const getSelectedItems = () => {
...
@@ -127,24 +127,34 @@ const getSelectedItems = () => {
return
acc
.
concat
(
selectedProducts
);
return
acc
.
concat
(
selectedProducts
);
},
[]);
},
[]);
};
};
// 跳转到结算页面方法
function
toSettle
()
{
function
toSettle
()
{
const
selected
=
getSelectedItems
();
const
selected
=
getSelectedItems
();
if
(
selected
.
length
>
0
)
{
if
(
selected
.
length
===
0
)
{
console
.
log
(
'Selected items:'
,
selected
);
xma
.
showToast
({
title
:
'请选择需要结算的商品!'
,
icon
:
'none'
,
});
return
;
}
const
shopIds
=
selected
.
map
((
item
)
=>
item
.
shopId
)
.
filter
((
value
,
index
,
self
)
=>
self
.
indexOf
(
value
)
===
index
);
if
(
shopIds
.
length
>
1
)
{
xma
.
showToast
({
title
:
'暂不支持跨店结算,请选择同一店铺的商品!'
,
icon
:
'none'
,
});
}
else
{
const
basketIds
=
selected
.
map
((
item
)
=>
item
.
basket
.
basketId
).
join
(
','
);
const
basketIds
=
selected
.
map
((
item
)
=>
item
.
basket
.
basketId
).
join
(
','
);
console
.
log
(
'Basket IDs:'
,
basketIds
);
console
.
log
(
'Basket IDs:'
,
basketIds
);
// TODO: 跳转到结算页面
// TODO: 跳转到结算页面
xma
.
navigateTo
({
xma
.
navigateTo
({
url
:
`/pages/assistingAgriculture/cart/ConfirmOrder?ids=
${
basketIds
}
`
,
url
:
`/pages/assistingAgriculture/cart/ConfirmOrder?ids=
${
basketIds
}
`
,
});
});
}
else
{
xma
.
showToast
({
title
:
'请选择需要结算的商品!'
,
icon
:
'none'
,
});
}
}
}
}
// 跳转店铺主页
// 跳转店铺主页
const
toStore
=
(
item
)
=>
{
const
toStore
=
(
item
)
=>
{
xma
.
navigateTo
({
xma
.
navigateTo
({
...
...
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