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
ec1bae36
Commit
ec1bae36
authored
Apr 06, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理外卖商品全线
parent
94dbfc8f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
37 deletions
+44
-37
index.jsx
src/pages/GoodsManage/SearchForm/index.jsx
+0
-1
staticdata.js
src/pages/GoodsManage/staticdata.js
+9
-0
config.js
src/pages/ServiceGoods/config.js
+28
-31
index.jsx
src/pages/ServiceGoods/index.jsx
+7
-5
No files found.
src/pages/GoodsManage/SearchForm/index.jsx
View file @
ec1bae36
...
...
@@ -172,7 +172,6 @@ class goodsManage extends Component {
<
FormItem
label=
"商品类型"
name=
"productType"
>
<
Select
style=
{
selectW
}
placeholder=
"请选择商品类型"
onChange=
{
this
.
onChangeProductType
}
>
<
Option
value=
{
1
}
>
实体商品
</
Option
>
<
Option
value=
{
2
}
>
虚拟商品
</
Option
>
<
Option
value=
{
4
}
>
服务类商品
</
Option
>
<
Option
value=
{
5
}
>
外卖商品
</
Option
>
</
Select
>
...
...
src/pages/GoodsManage/staticdata.js
View file @
ec1bae36
...
...
@@ -8,6 +8,15 @@ import { apiChangeStateGoods, apiGoodsActionBatch } from './service';
const
{
confirm
}
=
Modal
;
export
const
NormalProduct
=
1
;
export
const
ServiceProduct
=
4
;
export
const
TakeawayProduct
=
5
;
export
const
GoodTypes
=
{
[
NormalProduct
]:
'
实体商品
'
,
[
ServiceProduct
]:
'
服务类商品
'
,
[
TakeawayProduct
]:
'
外卖商品
'
,
};
export
const
productType
=
[
{
value
:
1
,
...
...
src/pages/ServiceGoods/config.js
View file @
ec1bae36
...
...
@@ -7,7 +7,7 @@ export const formItemLayout = {
},
};
export
const
TaskList
=
(
canAddService
,
canAddNormal
)
=>
[
export
const
TaskList
=
(
canAddService
,
canAddNormal
,
canTakeawayService
)
=>
[
{
name
:
'
实体商品
'
,
type
:
1
,
...
...
@@ -33,31 +33,31 @@ export const TaskList = (canAddService, canAddNormal) => [
},
},
},
{
name
:
'
虚拟商品
'
,
type
:
2
,
desc
:
'
无需物流
'
,
hide
:
!
canAddNormal
,
imgConfig
:
{
commonImageList
:
{
title
:
'
公共滑动图
'
,
rule
:
false
,
limit
:
null
,
renderExtra
:
()
=>
'
(图片最大上传2M)
'
,
},
imageList
:
{
rule
:
false
,
limit
:
null
,
renderExtra
:
()
=>
'
(图片最大上传2M)
'
,
},
detailImageList
:
{
title
:
'
详情图
'
,
rule
:
true
,
limit
:
null
,
renderExtra
:
()
=>
'
(图片最大上传2M)
'
,
},
},
},
//
{
//
name: '虚拟商品',
//
type: 2,
//
desc: '无需物流',
//
hide: !canAddNormal,
//
imgConfig: {
//
commonImageList: {
//
title: '公共滑动图',
//
rule: false,
//
limit: null,
//
renderExtra: () => '(图片最大上传2M)',
//
},
//
imageList: {
//
rule: false,
//
limit: null,
//
renderExtra: () => '(图片最大上传2M)',
//
},
//
detailImageList: {
//
title: '详情图',
//
rule: true,
//
limit: null,
//
renderExtra: () => '(图片最大上传2M)',
//
},
//
},
//
},
{
name
:
'
服务类商品
'
,
type
:
4
,
...
...
@@ -94,7 +94,7 @@ export const TaskList = (canAddService, canAddNormal) => [
name
:
'
外卖商品
'
,
type
:
5
,
desc
:
'
无需物流
'
,
// hide: !canAdd
Service,
hide
:
!
canTakeaway
Service
,
imgConfig
:
{
commonImageList
:
{
title
:
'
封面图片
'
,
...
...
@@ -324,10 +324,7 @@ export const StaticColumns = customer => [
},
];
export
const
ENUM_REPERTORY
=
[{
label
:
'
单规格
'
,
value
:
'
1
'
},
{
label
:
'
多规格
'
,
value
:
'
2
'
}];
export
const
ENUM_SET_REPERTORY
=
[
{
label
:
'
清零
'
,
value
:
'
0
'
},
{
label
:
'
最大
'
,
value
:
'
1
'
},
];
export
const
ENUM_SET_REPERTORY
=
[{
label
:
'
清零
'
,
value
:
'
0
'
},
{
label
:
'
最大
'
,
value
:
'
1
'
}];
export
const
ENUM_WEEK
=
[
{
value
:
'
1
'
,
label
:
'
周一
'
},
{
value
:
'
2
'
,
label
:
'
周二
'
},
...
...
src/pages/ServiceGoods/index.jsx
View file @
ec1bae36
...
...
@@ -46,7 +46,7 @@ const ServiceGoods = options => {
}
=
options
;
const
canAddService
=
permissions
[
GOOD_MANAGE
.
ADD_SERVICE_GOODS
];
const
canAddNormal
=
permissions
[
GOOD_MANAGE
.
ADD_NORMAL_GOODS
];
//
const canTakeawayService = permissions[GOOD_MANAGE.ADD_TAKEAWAY_GOODS];
const
canTakeawayService
=
permissions
[
GOOD_MANAGE
.
ADD_TAKEAWAY_GOODS
];
// const canTakeawayService = true
const
basicRef
=
useRef
(
null
);
const
stockRef
=
useRef
(
null
);
...
...
@@ -60,7 +60,9 @@ const ServiceGoods = options => {
const
[
categoryIds
,
setCategoryIds
]
=
useState
([]);
// 商品品类ID
const
[
isEdit
,
setIsEdit
]
=
useState
(
false
);
// 是否是编辑状态
const
[
isUseCache
,
setIsUseCache
]
=
useState
(
false
);
// 是否使用缓存
const
[
productType
,
setProductType
]
=
useState
(
canAddNormal
?
1
:
4
);
// 商品状态
let
ptype
=
canTakeawayService
?
5
:
4
;
ptype
=
canAddNormal
?
1
:
ptype
;
const
[
productType
,
setProductType
]
=
useState
(
ptype
);
// 商品状态
const
[
pageLoading
,
setPageLoading
]
=
useState
(
false
);
// 页面加载状态
const
[
afterAddressList
,
setAfterAddressList
]
=
useState
([]);
// 售后地址
const
[
supplierIdList
,
setSupplierIdList
]
=
useState
([]);
// 适用们店列表
...
...
@@ -160,7 +162,7 @@ const ServiceGoods = options => {
const
onResetData
=
refresh
=>
{
setPageId
(
null
);
setIsEdit
(
false
);
setProductType
(
canAddNormal
?
1
:
4
);
setProductType
(
ptype
);
setEditData
({});
setSpecKeyList
([]);
resetForm
();
...
...
@@ -383,7 +385,7 @@ const ServiceGoods = options => {
},
[
isEdit
,
options
.
visible
]);
useEffect
(()
=>
{
setProductType
(
canAddNormal
?
1
:
4
);
setProductType
(
ptype
);
},
[
canAddNormal
]);
const
onSpecCommonImgEvent
=
useCallback
(
...
...
@@ -489,7 +491,7 @@ const ServiceGoods = options => {
productType
,
canAddService
,
// 是否可以添加服务商品(电子卡券)
canAddNormal
,
// 是否可以添加实物商品
//
canTakeawayService, // 是否可以添加外卖商品
canTakeawayService
,
// 是否可以添加外卖商品
isCard
:
productType
===
4
,
isTakeawayService
:
productType
===
5
,
// 0, "商品删除" 1, "新建" 2, "提交审核" 3, "待审核" 4, "驳回" 5, "未上架" 6, "已上架" 7, "已下架"
...
...
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