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
a9e8af17
Commit
a9e8af17
authored
Mar 21, 2022
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改数据结构
parent
b51bead2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
17 deletions
+32
-17
index.jsx
src/pages/GoodsManage/createModal/index.jsx
+12
-17
index.jsx
src/pages/GoodsManage/index.jsx
+20
-0
No files found.
src/pages/GoodsManage/createModal/index.jsx
View file @
a9e8af17
...
@@ -333,6 +333,7 @@ class goodsManage extends Component {
...
@@ -333,6 +333,7 @@ class goodsManage extends Component {
const
{
const
{
form
:
{
validateFields
},
form
:
{
validateFields
},
initData
,
initData
,
specListData
,
}
=
this
.
props
;
}
=
this
.
props
;
const
{
editData
,
productType
}
=
this
.
state
;
const
{
editData
,
productType
}
=
this
.
state
;
...
@@ -357,6 +358,15 @@ class goodsManage extends Component {
...
@@ -357,6 +358,15 @@ class goodsManage extends Component {
notification
.
error
({
message
:
'
滑动图不全,请检查!
'
});
notification
.
error
({
message
:
'
滑动图不全,请检查!
'
});
return
;
return
;
}
}
const
specs
=
[];
specListData
.
forEach
(
item
=>
{
if
(
values
.
hasOwnProperty
(
item
.
specId
))
{
specs
.
push
({
specId
:
item
.
specId
,
specValues
:
values
[
item
.
specId
]
||
[],
});
}
});
await
this
.
setState
(
prev
=>
({
await
this
.
setState
(
prev
=>
({
confirmLoading
:
true
,
confirmLoading
:
true
,
createData
:
{
createData
:
{
...
@@ -370,6 +380,7 @@ class goodsManage extends Component {
...
@@ -370,6 +380,7 @@ class goodsManage extends Component {
categoryId
:
prev
.
categoryId
?
prev
.
categoryId
:
initData
?.
thirdCategoryId
,
categoryId
:
prev
.
categoryId
?
prev
.
categoryId
:
initData
?.
thirdCategoryId
,
// productType: values.productType,
// productType: values.productType,
type
:
values
.
productType
,
type
:
values
.
productType
,
specs
,
},
},
}));
}));
const
data
=
initData
.
id
const
data
=
initData
.
id
...
@@ -448,23 +459,7 @@ class goodsManage extends Component {
...
@@ -448,23 +459,7 @@ class goodsManage extends Component {
};
};
render
()
{
render
()
{
// specListData
const
{
visible
,
form
,
initData
=
{},
treeData
,
virtualTreeData
,
specListData
}
=
this
.
props
;
const
{
visible
,
form
,
initData
=
{},
treeData
,
virtualTreeData
,
specListData
}
=
this
.
props
;
// const specListData = [{
// "specName": "服务",
// "specId":"services",
// "specValues": [
// {
// "value": 1,
// "label": "七天无理由退货"
// },
// {
// "value": 2,
// "label": "2222"
// }
// ]
// }
// ]
const
isEdit
=
Object
.
keys
(
initData
).
length
!==
0
;
const
isEdit
=
Object
.
keys
(
initData
).
length
!==
0
;
// 是否仅编辑卖点和服务
// 是否仅编辑卖点和服务
const
isService
=
initData
.
state
!==
4
;
const
isService
=
initData
.
state
!==
4
;
...
@@ -642,7 +637,7 @@ class goodsManage extends Component {
...
@@ -642,7 +637,7 @@ class goodsManage extends Component {
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
FormItem
label=
"商品卖点"
labelCol=
{
{
span
:
2
}
}
>
<
FormItem
label=
"商品卖点"
labelCol=
{
{
span
:
2
}
}
>
{
getFieldDecorator
(
'
name
'
,
{
{
getFieldDecorator
(
'
character
'
,
{
initialValue
:
initData
.
character
,
initialValue
:
initData
.
character
,
})(
})(
<
Input
<
Input
...
...
src/pages/GoodsManage/index.jsx
View file @
a9e8af17
...
@@ -131,6 +131,9 @@ class goodsManage extends Component {
...
@@ -131,6 +131,9 @@ class goodsManage extends Component {
}
}
});
});
data
.
specs
.
forEach
(
item
=>
{
data
[
item
.
specId
]
=
item
.
specValues
;
});
data
.
imageList
=
[];
data
.
imageList
=
[];
data
.
carouseList
.
forEach
(
i
=>
{
data
.
carouseList
.
forEach
(
i
=>
{
data
.
imageList
[
`
${
i
.
specValue
}
`
]
=
i
.
skuSpecImageList
||
[];
data
.
imageList
[
`
${
i
.
specValue
}
`
]
=
i
.
skuSpecImageList
||
[];
...
@@ -244,6 +247,23 @@ class goodsManage extends Component {
...
@@ -244,6 +247,23 @@ class goodsManage extends Component {
if
(
data
.
code
===
'
0000
'
&&
data
.
data
.
length
)
{
if
(
data
.
code
===
'
0000
'
&&
data
.
data
.
length
)
{
this
.
setState
({
specListData
:
data
.
data
});
this
.
setState
({
specListData
:
data
.
data
});
}
}
const
specListData
=
[
{
specName
:
'
服务
'
,
specId
:
'
services
'
,
specValues
:
[
{
value
:
1
,
label
:
'
七天无理由退货
'
,
},
{
value
:
2
,
label
:
'
2222
'
,
},
],
},
];
this
.
setState
({
specListData
});
};
};
render
()
{
render
()
{
...
...
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