Commit 0bca1fa9 authored by 武广's avatar 武广

feat: 添加草稿

parent 885f1aaa
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'yxm2'; const environment = 'xyqb';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`, kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`,
......
...@@ -8,6 +8,7 @@ import FormRuleSetting from './components/FormRuleSetting'; ...@@ -8,6 +8,7 @@ import FormRuleSetting from './components/FormRuleSetting';
import FormRuleVPictures from './components/FormRuleVPictures'; import FormRuleVPictures from './components/FormRuleVPictures';
import FormSettlementOthers from './components/FormSettlementOthers'; import FormSettlementOthers from './components/FormSettlementOthers';
import FormAttr from './components/FormAttr'; import FormAttr from './components/FormAttr';
import localStorage from '@/utils/localStorage';
import { import {
merchantBrandList, merchantBrandList,
merchantSpecList, merchantSpecList,
...@@ -152,6 +153,7 @@ const ServiceGoods = options => { ...@@ -152,6 +153,7 @@ const ServiceGoods = options => {
} }
}; };
// 保存商品
const submitEvent = async () => { const submitEvent = async () => {
const checkPromiseList = clearCurrent(checkFormList).map(({ current }) => current.onCheck()); const checkPromiseList = clearCurrent(checkFormList).map(({ current }) => current.onCheck());
const resuslt = await Promise.all(checkPromiseList); const resuslt = await Promise.all(checkPromiseList);
...@@ -244,9 +246,18 @@ const ServiceGoods = options => { ...@@ -244,9 +246,18 @@ const ServiceGoods = options => {
}); });
} }
}; };
// 切换类目
const onCategoryChange = e => { const onCategoryChange = e => {
setCategoryIds(e); setCategoryIds(e);
}; };
// 保存草稿
const onSaveDraft = () => {
const localkey = 'good-info-auto-save';
const info = localStorage.get(localkey);
if (info) {
localStorage.remove(localkey);
}
};
const providerValue = { const providerValue = {
pageId, pageId,
...@@ -273,6 +284,9 @@ const ServiceGoods = options => { ...@@ -273,6 +284,9 @@ const ServiceGoods = options => {
maskClosable={false} maskClosable={false}
keyboard={false} keyboard={false}
footer={[ footer={[
<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>,
......
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