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
60719448
Commit
60719448
authored
Apr 12, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改文案
parent
f3a99ff4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
21 deletions
+17
-21
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+17
-21
No files found.
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
60719448
...
...
@@ -481,23 +481,27 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
AddRepertoryRef
.
current
.
setOpenRepertory
(
true
);
setRepertoryModel
({
type
,
idx
,
item
});
};
// 过滤单位
const
filterUnit
=
unit
=>
(
Array
.
isArray
(
unit
)
&&
unit
?.
length
&&
unit
?.
slice
(
1
).
toString
())
||
unit
;
// 拼接sku 名称
const
calcLabelName
=
item
=>
{
let
firstName
=
''
;
let
lastName
=
''
;
if
(
item
?.
unique
&&
item
?.
unique
!==
'
[object Object]
'
)
{
const
tempName
=
`
${
editData
?.
name
||
''
}
`;
// const tempSpecName = `
$
{
item
?.
specs
[
0
]?.
specName
||
''
}
`;
const tempQuantity = `
(
$
{
item
.
specs
[
0
]?.
quantity
||
''
}
`;
if
((
item
?.
unique
||
item
?.
specs
?.
length
>=
0
)
&&
item
?.
unique
!==
'
[object Object]
'
)
{
const
tempQuantity
=
`(
${
item
?.
specs
[
0
]?.
unit
?
(
weightUnits
.
includes
(
filterUnit
(
item
.
specs
[
0
]?.
unit
))
&&
'
约
'
)
||
''
:
''
}
$
{
peopleUnits
.
includes
(
filterUnit
(
item
.
specs
[
0
]?.
unit
))
?
''
:
item
.
specs
[
0
]?.
quantity
||
''
}
`;
const tempUnit = `
$
{
item
.
specs
[
0
]?.
unit
||
''
}
$
{
item
.
specs
[
0
]?.
unit
?
'
)
'
:
''
}
`;
// const tempSecondSpecName = `
$
{
item
.
specs
[
1
]?.
specName
||
''
}
`;
// const isShow = tempQuantity && tempUnit && '+';
const uniqueName = item?.unique?.split(',') || [];
if (uniqueName && uniqueName?.length) {
firstName = uniqueName[0] || '';
lastName = uniqueName?.slice(1).join(' ') || '';
}
//
${
tempName
}
return `
$
{
firstName
}
$
{
tempQuantity
}
$
{
tempUnit
}
$
{
lastName
}
`;
}
};
...
...
@@ -633,7 +637,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
props.onValuesChange(editData, !0);
let tempEdit = JSON.parse(JSON.stringify(editData));
tempEdit = Object.assign({}, editData, { ...tempEdit.takeawayItem, ...tempEdit.infoMation });
console.log('tempEdit', tempEdit);
if (Object.keys(tempEdit).length) {
if (tempEdit?.saleTimes) {
tempEdit.saleTimes = tempEdit?.saleTimes?.length
...
...
@@ -647,7 +650,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
setRepertoryType('2');
form.setFieldsValue({ weight: tempEdit?.weight });
form.setFieldsValue({ specs: tempEdit?.specs });
console.log('tempEdit?.multiSpu', tempEdit?.multiSpu);
setTempMultiSpu(JSON.parse(JSON.stringify(tempEdit?.multiSpu)));
}
if (tempEdit?.detailImageList) {
...
...
@@ -862,9 +864,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
>
{form => {
let unit = form.getFieldValue('unit') || '';
unit =
(unit && (Array.isArray(unit) && unit?.length && unit?.slice(1).toString())) ||
unit;
unit = filterUnit(unit);
if (!peopleUnits.includes(unit)) {
return (
<Form.Item
...
...
@@ -1036,21 +1036,17 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
>
<Input style={{ width: '200px' }} placeholder="名称" />
</Form.Item>
{weightUnits.includes(form.getFieldValue(['weight'])?.[index]?.unit) && (
<span className="ant-form-text"> 约</span>
)}
{weightUnits.includes(
filterUnit(form.getFieldValue(['weight'])?.[index]?.unit),
) && <span className="ant-form-text"> 约</span>}
<Form.Item
// noStyle
shouldUpdate={(prevValues, curValues) => false}
>
{form => {
let unit = form.getFieldValue(['weight'])?.[index]?.unit || '';
unit =
(unit &&
(Array.isArray(unit) &&
unit?.length &&
unit?.slice(1).toString())) ||
unit;
unit = filterUnit(unit);
if (!peopleUnits.includes(unit)) {
return (
<Form.Item
...
...
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