Commit 28cf37c8 authored by baxibaba's avatar baxibaba

feat: 修改商品逻辑

parent 12a59224
......@@ -69,7 +69,7 @@ const ServiceGoods = options => {
const [editData, setEditData] = useState({}); // 编辑保存数据
const [newCategoryList, setNewCategoryList] = useState({});
const [takeawayEditData, setTakeawayEditData] = useState({}); // 外卖编辑保存数据
const [groupShopData, setGroupShopData] = useState('') // 从分组进入创建
const [groupShopData, setGroupShopData] = useState(''); // 从分组进入创建
const [visibleCacheEdit, setVisibleCacheEdit] = useState(false); // 显示有缓存未保存提示
const [checkFormList] = useState([
basicRef,
......@@ -247,6 +247,7 @@ const ServiceGoods = options => {
}, {});
const sendData = filterSendData(productType, params);
if (productType === 5) {
console.log(sendData, 'sendData');
sendMerchantProductHttpRequest(sendData);
return false;
}
......@@ -371,12 +372,12 @@ const ServiceGoods = options => {
console.log('takeAway', takeAway);
// 外卖类型
if (Object.keys(takeAway).length) {
const { spuId = '', groupId = '' } = takeAway
const { spuId = '', groupId = '' } = takeAway;
if (spuId) {
querGetShopDetail(takeAway);
}
if (groupId) {
setGroupShopData(takeAway)
setGroupShopData(takeAway);
}
setProductType(5);
}
......@@ -487,9 +488,13 @@ const ServiceGoods = options => {
maskClosable={false}
keyboard={false}
footer={[
productType === 5 ? '' : <Button key="draft" type="primary" ghost loading={pageLoading} onClick={onSaveDraft}>
productType === 5 ? (
''
) : (
<Button key="draft" type="primary" ghost loading={pageLoading} onClick={onSaveDraft}>
保存草稿
</Button>,
</Button>
),
<Button key="submit" type="primary" loading={pageLoading} onClick={submitEvent}>
提交
</Button>,
......@@ -510,7 +515,11 @@ const ServiceGoods = options => {
)}
<ServiceContext.Provider value={providerValue}>
<Title title="商品类型" />
<TaskTypeSelect productType={productType} takeAway={takeAway} onChange={productChange} />
<TaskTypeSelect
productType={productType}
takeAway={takeAway}
onChange={productChange}
/>
<Title title="商品基本信息编辑" />
<FormInformationBasic
......@@ -589,7 +598,6 @@ const ServiceGoods = options => {
ref={takeawayRef}
takeAway={takeAway}
editData={takeawayEditData}
infoMation={editData.infoMation}
supplierIdList={supplierIdList}
onValuesChange={onValuesChange}
/>
......
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