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
f1dee619
Commit
f1dee619
authored
Apr 12, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 删除无用组件
parent
620ae826
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
125 deletions
+15
-125
AddMenusModal.jsx
src/pages/ServiceGoods/components/AddMenusModal.jsx
+0
-102
FormInformationBasic.jsx
src/pages/ServiceGoods/components/FormInformationBasic.jsx
+0
-6
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+15
-17
No files found.
src/pages/ServiceGoods/components/AddMenusModal.jsx
deleted
100644 → 0
View file @
620ae826
import
React
,
{
useState
,
useEffect
,
forwardRef
,
useRef
,
useImperativeHandle
}
from
'
react
'
;
import
{
Button
,
Modal
,
Form
,
Switch
,
Input
,
Select
}
from
'
antd
'
;
import
styles
from
'
../common.less
'
;
import
{
apiCreateShop
}
from
'
../service
'
;
const
AddMenusModal
=
(
props
,
ref
)
=>
{
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
open
,
setOpen
]
=
useState
(
false
);
const
[
formProject
]
=
Form
.
useForm
();
const
[
menusSwitch
,
setMenusSwitch
]
=
useState
(
0
);
// 分组开启状态
// const {
// queryShopList,
// } = props;
useImperativeHandle
(
ref
,
()
=>
({
// changeVal 就是暴露给父组件的方法
setOpen
:
newVal
=>
{
setOpen
(
newVal
);
},
}));
const
handleOk
=
()
=>
{
formProject
.
validateFields
()
.
then
(
async
values
=>
{
console
.
log
(
'
valuse
'
,
values
,
menusSwitch
);
const
params
=
{
name
:
values
?.
name
,
necessary
:
menusSwitch
,
};
const
data
=
await
apiCreateShop
(
params
);
if
(
data
.
code
===
'
0000
'
)
{
formProject
.
resetFields
();
// 表单清除历史
setConfirmLoading
(
true
);
setTimeout
(()
=>
{
setOpen
(
false
);
setConfirmLoading
(
false
);
},
2000
);
}
})
.
catch
(
info
=>
{
// queryShopList()
console
.
log
(
'
保存异常
'
,
info
);
});
};
const
handleCancel
=
()
=>
{
console
.
log
(
'
Clicked cancel button
'
);
setOpen
(
false
);
};
const
onChange
=
()
=>
{
if
(
menusSwitch
===
0
)
{
setMenusSwitch
(
1
);
return
false
;
}
setMenusSwitch
(
0
);
return
false
;
};
useEffect
(()
=>
{
console
.
log
(
'
open
'
,
open
);
},
[
open
]);
return
(
<>
{
open
&&
(
<
Modal
title=
"添加分组"
visible=
{
open
}
onOk=
{
handleOk
}
confirmLoading=
{
confirmLoading
}
initialValues=
{
{
menusSwitch
:
0
,
}
}
onCancel=
{
handleCancel
}
>
<
Form
form=
{
formProject
}
>
<
Form
.
Item
label=
"Select"
>
<
Select
>
<
Select
.
Option
value=
"shopId"
>
Demo
</
Select
.
Option
>
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
"分组名称"
name=
"name"
rules=
{
[{
required
:
true
}]
}
>
<
Input
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"下单必选分组"
name=
"necessary"
valuePropName=
{
menusSwitch
}
>
<
Switch
defaultChecked=
{
menusSwitch
}
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
onChange=
{
onChange
}
/>
<
div
className=
{
styles
.
textStyle
}
>
选中后,顾客下单需至少选择1个 “下单必须分组” 商品
</
div
>
<
div
className=
{
styles
.
textStyle
}
>
每店仅可设置1个必点分组
</
div
>
</
Form
.
Item
>
</
Form
>
</
Modal
>
)
}
</>
);
};
export
default
forwardRef
(
AddMenusModal
);
src/pages/ServiceGoods/components/FormInformationBasic.jsx
View file @
f1dee619
...
...
@@ -21,8 +21,6 @@ import {
import
{
formItemLayout
}
from
'
../config
'
;
import
{
ServiceContext
}
from
'
../context
'
;
import
{
debounce
}
from
'
@/utils/utils
'
;
import
AddMenusModal
from
'
./AddMenusModal
'
;
import
UploadImage
from
'
./UploadImage
'
;
import
UploadCropImage
from
'
./UploadCropImage
'
;
import
{
apiShopIds
,
apiQueryShopList
,
getByProductType
}
from
'
../service
'
;
import
GroupInfo
from
'
../../GoodsManage/Takeaway/components/GroupInfo
'
;
...
...
@@ -122,7 +120,6 @@ const FormInformationBasic = forwardRef((props, ref) => {
};
const
getFormValues
=
debounce
(()
=>
{
const
values
=
form
.
getFieldsValue
();
// console.log('infoMation', values);
props
.
onValuesChange
({
infoMation
:
values
});
},
400
);
// 查询shopIds
...
...
@@ -194,7 +191,6 @@ const FormInformationBasic = forwardRef((props, ref) => {
};
form
.
setFieldsValue
(
temp
);
},
[
groupShopData
]);
// useEffect(() => {}, [shopList, shopIdSource]);
return
(
<
Form
{
...
formItemLayout
}
...
...
@@ -261,8 +257,6 @@ const FormInformationBasic = forwardRef((props, ref) => {
/>
</
Form
.
Item
>
)
}
{
/* 新增菜单分组弹框 */
}
{
/* <AddMenusModal ref={childAddMenusModalRef} queryShopList={queryShopList} /> */
}
<
Form
.
Item
name=
"categoryId"
label=
"商品类目"
...
...
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
f1dee619
...
...
@@ -38,7 +38,6 @@ import UploadCropImage from './UploadCropImage';
// import AddSellTimeModal from './AddSellTimeModal';
import
styles
from
'
../common.less
'
;
import
AddRepertoryModal
from
'
./AddRepertoryModal
'
;
// import AddMultiSpecModal from './AddMultiSpecModal';
import
{
apiTagList
,
apiUnits
}
from
'
../service
'
;
import
{
localAutoSaveKey
,
calcDescartes
}
from
'
../utils
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
...
...
@@ -486,19 +485,21 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const
calcLabelName
=
item
=>
{
let
firstName
=
''
;
let
lastName
=
''
;
const
tempName
=
`
${
editData
?.
name
||
''
}
`;
// const tempSpecName = `
$
{
item
?.
specs
[
0
]?.
specName
||
''
}
`;
const tempQuantity = `
(
$
{
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(' ') || '';
if
(
item
?.
unique
&&
item
?.
unique
!==
'
[object Object]
'
)
{
const
tempName
=
`
${
editData
?.
name
||
''
}
`;
// const tempSpecName = `
$
{
item
?.
specs
[
0
]?.
specName
||
''
}
`;
const tempQuantity = `
(
$
{
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
}
`;
}
//
${
tempName
}
return `
$
{
firstName
}
$
{
tempQuantity
}
$
{
tempUnit
}
$
{
lastName
}
`;
};
const init = async () => {
if (!tagList.length) {
...
...
@@ -667,10 +668,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
useEffect(() => {
getFormValues();
}, [repertoryType]);
useEffect(() => {
// setTempMultiSpu(tempMultiSpu);
console.log('tempEdit?.multiSpu1122222', tempMultiSpu);
}, [tempMultiSpu]);
useEffect(() => {}, [tempMultiSpu]);
return (
<>
<Form
...
...
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