Commit 28cf37c8 authored by baxibaba's avatar baxibaba

feat: 修改商品逻辑

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