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
f72e657f
Commit
f72e657f
authored
Nov 15, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改属性组件升级
parent
8634de87
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
34 deletions
+69
-34
index.jsx
src/components/CustomSelect/index.jsx
+6
-3
index.less
src/components/CustomSelect/index.less
+15
-0
index.jsx
src/components/MessageReminder/Complex/index.jsx
+1
-0
index.jsx
src/components/MessageReminder/Simple/index.jsx
+1
-0
index.jsx
src/pages/GoodsManage/index.jsx
+13
-12
FormAttr.jsx
src/pages/ServiceGoods/components/FormAttr.jsx
+9
-10
FormPriceOrStock.jsx
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
+9
-4
index.jsx
src/pages/ServiceGoods/index.jsx
+9
-3
utils.js
src/pages/ServiceGoods/utils.js
+6
-2
No files found.
src/components/CustomSelect/index.jsx
View file @
f72e657f
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'
react
'
;
import
{
Select
,
Space
,
Divider
,
Input
,
Button
}
from
'
antd
'
;
import
{
PlusOutlined
}
from
'
@ant-design/icons
'
;
import
styles
from
'
./index.less
'
;
const
CustomSelect
=
props
=>
{
const
[
name
,
setName
]
=
useState
(
''
);
...
...
@@ -45,15 +46,17 @@ const CustomSelect = props => {
{
menu
}
{
props
.
isCustom
&&
(
<>
<
Divider
style=
{
{
margin
:
'
8px 0
'
}
}
/>
<
Space
style=
{
{
padding
:
'
0 8px 4px
'
}
}
>
<
Divider
className=
{
styles
.
SelectDivider
}
/>
<
Space
className=
{
styles
.
SelectSpace
}
>
<
Input
className=
{
styles
.
SelectInput
}
placeholder=
"请输入自定义属性"
ref=
{
inputRef
}
value=
{
name
}
maxLength=
{
30
}
onChange=
{
onNameChange
}
/>
<
Button
type=
"
text
"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
addItem
}
/>
<
Button
type=
"
primary
"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
addItem
}
/>
</
Space
>
</>
)
}
...
...
src/components/CustomSelect/index.less
0 → 100644
View file @
f72e657f
.SelectDivider {
margin: 8px 0;
}
.SelectSpace {
width: 100%;
padding: 0 8px 4px;
:global {
.ant-space-item:first-child {
width: 100%;
}
}
}
.SelectInput {
width: 100%;
}
src/components/MessageReminder/Complex/index.jsx
View file @
f72e657f
...
...
@@ -98,6 +98,7 @@ const Complex = props => {
setLoading
(
true
);
const
res
=
await
apiGetBussinessMsgList
(
data
,
params
);
setLoading
(
false
);
if
(
!
res
)
return
;
if
(
res
.
code
!==
'
0000
'
)
{
notification
.
error
(
res
.
msg
);
return
;
...
...
src/components/MessageReminder/Simple/index.jsx
View file @
f72e657f
...
...
@@ -149,6 +149,7 @@ const Simple = props => {
setLoading
(
true
);
const
res
=
await
apiGetBussinessMsgList
(
data
,
params
);
setLoading
(
false
);
if
(
!
res
)
return
;
if
(
res
.
code
!==
'
0000
'
)
{
notification
.
error
(
res
.
msg
);
return
;
...
...
src/pages/GoodsManage/index.jsx
View file @
f72e657f
...
...
@@ -56,7 +56,7 @@ class goodsManage extends Component {
stockSkuIds
:
[],
isType
:
''
,
serviceVisble
:
tru
e
,
serviceVisble
:
fals
e
,
serviceData
:
{},
visibleAuditModal
:
false
,
auditRow
:
{},
// 查看审核信息使用
...
...
@@ -529,17 +529,18 @@ class goodsManage extends Component {
isType=
{
this
.
state
.
isType
}
templateList=
{
this
.
state
.
templateList
}
/>
{
/* '894048258062' */
}
<
ServiceGoods
visible=
{
this
.
state
.
serviceVisble
}
onChange=
{
this
.
serviceVisbleClose
}
SourceData=
{
this
.
state
.
serviceData
}
shopList=
{
this
.
shopList
}
categoryList=
{
this
.
state
.
treeData
}
virtualCategoryList=
{
this
.
state
.
virtualTreeData
}
specListData=
{
this
.
state
.
specListData
}
permissions=
{
permissions
}
/>
{
this
.
state
.
serviceVisble
&&
(
<
ServiceGoods
visible=
{
this
.
state
.
serviceVisble
}
onChange=
{
this
.
serviceVisbleClose
}
SourceData=
{
this
.
state
.
serviceData
}
shopList=
{
this
.
shopList
}
categoryList=
{
this
.
state
.
treeData
}
virtualCategoryList=
{
this
.
state
.
virtualTreeData
}
specListData=
{
this
.
state
.
specListData
}
permissions=
{
permissions
}
/>
)
}
</
Spin
>
<
InfoAudit
visible=
{
this
.
state
.
visibleAuditModal
}
...
...
src/pages/ServiceGoods/components/FormAttr.jsx
View file @
f72e657f
...
...
@@ -77,19 +77,16 @@ const FormAttr = forwardRef((props, ref) => {
return
attrs
;
};
const
getMode
=
optionType
=>
{
if
(
+
optionType
.
code
===
2
)
{
return
'
multiple
'
;
}
return
'
default
'
;
};
// 获取下拉框类型
const
getMode
=
optionType
=>
(
+
optionType
.
code
===
2
?
'
multiple
'
:
'
default
'
);
// 获取下拉框校验
const
getAttrRules
=
k
=>
{
if
(
+
k
.
required
.
code
===
1
)
{
return
[
{
required
:
true
,
type
:
+
k
.
supportCustomValue
.
code
===
1
||
+
k
.
optionType
.
code
===
2
?
'
array
'
:
'
string
'
,
type
:
+
k
.
optionType
.
code
===
2
?
'
array
'
:
'
string
'
,
message
:
'
请选择
'
,
},
];
...
...
@@ -97,13 +94,15 @@ const FormAttr = forwardRef((props, ref) => {
return
[];
};
// 处理下拉框返回值
const
deal
=
attr
=>
{
try
{
const
json
=
JSON
.
parse
(
attr
);
if
(
typeof
json
===
'
object
'
&&
checkInAttrList
(
json
.
attributeValueId
))
{
if
(
typeof
json
===
'
object
'
)
{
json
.
attributeValueName
=
json
.
name
;
return
json
;
}
return
{
attributeValueName
:
json
};
return
{
attributeValueName
:
json
.
name
};
}
catch
{
return
{
attributeValueName
:
attr
};
}
...
...
@@ -164,7 +163,7 @@ const FormAttr = forwardRef((props, ref) => {
return
(
<>
<
div
className=
{
styles
.
attrbox
+
(
isMore
?
styles
.
attrboxMore
:
''
)
}
more=
{
isMore
}
>
<
div
className=
{
styles
.
attrbox
+
(
isMore
?
styles
.
attrboxMore
:
''
)
}
>
<
Form
form=
{
form
}
initialValues=
{
getInitAttrValue
()
}
>
<
Row
>
{
categoryAttrs
.
length
>
0
&&
...
...
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
View file @
f72e657f
...
...
@@ -227,18 +227,23 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const
onCheck
=
async
()
=>
{
try
{
const
setMealContent
=
await
packageRef
.
current
.
onCheck
();
let
setMealContent
=
''
;
if
(
customer
.
isCard
)
{
setMealContent
=
await
packageRef
.
current
.
onCheck
();
}
const
values
=
await
form
.
validateFields
();
const
items
=
await
editRef
.
current
.
onCheck
();
if
(
!
setMealContent
)
{
if
(
customer
.
isCard
&&
!
setMealContent
)
{
notification
.
open
({
message
:
'
提示
'
,
description
:
'
请添加正确的套餐信息!
'
,
});
return
null
;
}
if
(
items
&&
setMealContent
)
{
return
{
...
values
,
items
,
setMealContent
,
temp
:
'
infoSpecData
'
};
if
(
items
)
{
const
obj
=
{
...
values
,
items
,
temp
:
'
infoSpecData
'
};
customer
.
isCard
&&
setMealContent
&&
(
obj
.
setMealContent
=
setMealContent
);
return
obj
;
}
notification
.
open
({
message
:
'
提示
'
,
...
...
src/pages/ServiceGoods/index.jsx
View file @
f72e657f
...
...
@@ -44,7 +44,7 @@ const ServiceGoods = options => {
const
[
pageId
,
setPageId
]
=
useState
(
null
);
const
[
categoryIds
,
setCategoryIds
]
=
useState
([]);
// 商品品类ID
const
[
isEdit
,
setIsEdit
]
=
useState
(
false
);
// 是否是编辑状态
const
[
productType
,
setProductType
]
=
useState
(
1
);
// 商品状态 canAddNormal ? 1 : 4
const
[
productType
,
setProductType
]
=
useState
(
canAddNormal
?
1
:
4
);
// 商品状态
const
[
pageLoading
,
setPageLoading
]
=
useState
(
false
);
// 页面加载状态
const
[
afterAddressList
,
setAfterAddressList
]
=
useState
([]);
// 售后地址
const
[
supplierIdList
,
setSupplierIdList
]
=
useState
([]);
// 适用们店列表
...
...
@@ -162,6 +162,7 @@ const ServiceGoods = options => {
if
(
isEdit
)
{
sendData
.
id
=
pageId
;
}
// console.log('sendData :>> ', sendData);
sendMerchantProductHttpRequest
(
sendData
);
}
};
...
...
@@ -215,6 +216,11 @@ const ServiceGoods = options => {
}
},
[
productType
,
options
.
visible
]);
useEffect
(()
=>
{
console
.
log
(
'
1---canAddNormal :>>
'
,
canAddNormal
);
setProductType
(
canAddNormal
?
1
:
4
);
},
[
canAddNormal
]);
const
onSpecCommonImgEvent
=
useCallback
(
keys
=>
{
setSpecKeyList
(
keys
);
...
...
@@ -295,8 +301,8 @@ const ServiceGoods = options => {
/>
{
[
1
,
2
].
includes
(
productType
)
&&
[
<
Title
title=
"商品属性"
/>,
<
FormAttr
ref=
{
attrRef
}
categoryIds=
{
categoryIds
}
initData=
{
editData
}
/>,
<
Title
title=
"商品属性"
key=
"attrtitle"
/>,
<
FormAttr
key=
"attr"
ref=
{
attrRef
}
categoryIds=
{
categoryIds
}
initData=
{
editData
}
/>,
]
}
<
Title
title=
"价格与库存"
/>
...
...
src/pages/ServiceGoods/utils.js
View file @
f72e657f
...
...
@@ -107,10 +107,10 @@ const filterItems = (type, props) => {
export
const
filterSendData
=
(
type
,
params
)
=>
{
console
.
log
(
'
===============>生成数据
'
,
params
);
const
{
infoMation
,
infoImageData
}
=
params
;
const
{
infoMation
,
infoImageData
,
attributeApplyList
}
=
params
;
const
items
=
filterItems
(
type
,
params
);
const
commonImageList
=
type
===
4
?
[]
:
infoImageData
.
commonImageList
;
return
{
const
obj
=
{
type
,
items
,
name
:
infoMation
.
name
,
...
...
@@ -123,6 +123,10 @@ export const filterSendData = (type, params) => {
detailImageList
:
infoImageData
.
detailImageList
,
commonImageList
,
};
if
(
attributeApplyList
&&
attributeApplyList
.
attributeApplyList
)
{
obj
.
attributeApplyList
=
attributeApplyList
.
attributeApplyList
;
}
return
obj
;
};
export
const
fliterSkuListSortData
=
list
=>
{
...
...
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