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

feat: 添加草稿

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