Commit ec1bae36 authored by 武广's avatar 武广

fix: 处理外卖商品全线

parent 94dbfc8f
......@@ -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>
......
......@@ -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,
......
......@@ -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: !canAddService,
hide: !canTakeawayService,
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: '周二' },
......
......@@ -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, "已下架"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment