Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
579d7a99
Commit
579d7a99
authored
Mar 31, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:更新列出商品
parent
5e51f768
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
20 deletions
+30
-20
utils.js
src/pages/ServiceGoods/utils.js
+30
-20
No files found.
src/pages/ServiceGoods/utils.js
View file @
579d7a99
...
@@ -113,32 +113,42 @@ export const filterSendData = (type, params) => {
...
@@ -113,32 +113,42 @@ export const filterSendData = (type, params) => {
const
{
infoMation
,
infoImageData
,
attributeApplyList
,
takeawayItem
}
=
params
;
const
{
infoMation
,
infoImageData
,
attributeApplyList
,
takeawayItem
}
=
params
;
// 外卖商品
// 外卖商品
if
(
type
===
5
)
{
if
(
type
===
5
)
{
const
temp
=
Object
.
assign
({},
takeawayItem
?.
intactData
,
infoMation
)
const
temp
=
Object
.
assign
({},
takeawayItem
?.
intactData
,
infoMation
);
temp
.
categoryId
=
(
Array
.
isArray
(
temp
.
categoryId
)
&&
temp
.
categoryId
?.
slice
(
temp
.
categoryId
?.
length
-
1
)?.
toString
())
temp
.
categoryId
=
temp
.
productRefShopId
=
temp
.
productRefShopId
.
toString
()
Array
.
isArray
(
temp
.
categoryId
)
&&
const
tempWeightName
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'
weightUnits
'
))
temp
.
categoryId
?.
slice
(
temp
.
categoryId
?.
length
-
1
)?.
toString
();
temp
.
productRefShopId
=
temp
.
productRefShopId
.
toString
();
const
tempWeightName
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'
weightUnits
'
));
temp
.
items
.
forEach
(
item
=>
{
temp
.
items
.
forEach
(
item
=>
{
item
.
autoStock
=
item
.
autoStock
?
1
:
0
item
.
autoStock
=
item
.
autoStock
?
1
:
0
;
item
.
serviceItem
.
autoStock
=
item
?.
serviceItem
?.
autoStock
?
1
:
0
item
.
serviceItem
.
autoStock
=
item
?.
serviceItem
?.
autoStock
?
1
:
0
;
item
.
productStock
=
item
?.
serviceItem
?.
productStock
item
.
productStock
=
item
?.
serviceItem
?.
productStock
;
item
.
list
=
temp
.
list
;
if
(
item
?.
specs
?.
length
)
{
if
(
item
?.
specs
?.
length
)
{
item
?.
specs
.
forEach
(
itm
=>
{
item
?.
specs
.
forEach
(
itm
=>
{
if
(
tempWeightName
.
includes
(
itm
.
unit
))
{
if
(
tempWeightName
.
includes
(
itm
.
unit
))
{
itm
.
quantity
=
`
${
itm
?.
quantity
}
`.indexOf('约') > -1 ? itm?.quantity : `
约
$
{
itm
?.
quantity
}
`
itm
.
quantity
=
`
${
itm
?.
quantity
}
`.indexOf('约') > -1 ? itm?.quantity : `
约
$
{
itm
?.
quantity
}
`;
}
}
})
});
}
})
temp.specList && temp.specList.forEach(item => {
if (item?.specs?.length) {
item?.specs.forEach(itm => {
itm.unit = (Array.isArray(itm.unit) && itm.unit?.length>=2 && itm.unit?.splice(itm.unit?.length - 1)[0]) || itm.unit
if (tempWeightName.includes(itm.unit)) {
itm.quantity = `
$
{
itm
?.
quantity
}
`.indexOf('约') > -1 ? itm?.quantity : `
约
$
{
itm
?.
quantity
}
`
}
})
}
}
})
});
temp.specList &&
temp.specList.forEach(item => {
if (item?.specs?.length) {
item?.specs.forEach(itm => {
itm.unit =
(Array.isArray(itm.unit) &&
itm.unit?.length >= 2 &&
itm.unit?.splice(itm.unit?.length - 1)[0]) ||
itm.unit;
if (tempWeightName.includes(itm.unit)) {
itm.quantity =
`
$
{
itm
?.
quantity
}
`.indexOf('约') > -1 ? itm?.quantity : `
约
$
{
itm
?.
quantity
}
`;
}
});
}
});
return temp;
return temp;
}
}
const items = filterItems(type, params);
const items = filterItems(type, params);
...
...
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