diff --git a/src/core/DynamicEngine.tsx b/src/core/DynamicEngine.tsx index d514fdaa..d3845140 100644 --- a/src/core/DynamicEngine.tsx +++ b/src/core/DynamicEngine.tsx @@ -3,7 +3,7 @@ import Loading from '../components/LoadingCp'; import { useMemo, memo, FC } from 'react'; import React from 'react'; -export type componentsType = 'media' | 'base' | 'visible'; +export type componentsType = 'media' | 'base' | 'visible' | 'shop'; const DynamicFunc = (type: string, componentsType: string) => { return dynamic({ diff --git a/src/materials/schema.ts b/src/materials/schema.ts index c8da183e..78ce106a 100644 --- a/src/materials/schema.ts +++ b/src/materials/schema.ts @@ -1,13 +1,13 @@ import BasicSchema from './base/schema'; import MediaSchema from './media/schema'; import VisualSchema from './visual/schema'; -import shopSchema from './ShopComponents/schema'; +import ShopSchema from './shop/schema'; const schema = { ...BasicSchema, ...MediaSchema, ...VisualSchema, - ...shopSchema, + ...ShopSchema, }; export default schema; diff --git a/src/materials/ShopComponents/CardLabel/index.less b/src/materials/shop/CardLabel/index.less similarity index 100% rename from src/materials/ShopComponents/CardLabel/index.less rename to src/materials/shop/CardLabel/index.less diff --git a/src/materials/ShopComponents/CardLabel/index.tsx b/src/materials/shop/CardLabel/index.tsx similarity index 100% rename from src/materials/ShopComponents/CardLabel/index.tsx rename to src/materials/shop/CardLabel/index.tsx diff --git a/src/materials/ShopComponents/CardLabel/schema.ts b/src/materials/shop/CardLabel/schema.ts similarity index 100% rename from src/materials/ShopComponents/CardLabel/schema.ts rename to src/materials/shop/CardLabel/schema.ts diff --git a/src/materials/ShopComponents/CardLabel/template.ts b/src/materials/shop/CardLabel/template.ts similarity index 100% rename from src/materials/ShopComponents/CardLabel/template.ts rename to src/materials/shop/CardLabel/template.ts diff --git a/src/materials/ShopComponents/Coupons/index.less b/src/materials/shop/Coupons/index.less similarity index 100% rename from src/materials/ShopComponents/Coupons/index.less rename to src/materials/shop/Coupons/index.less diff --git a/src/materials/ShopComponents/Coupons/index.tsx b/src/materials/shop/Coupons/index.tsx similarity index 100% rename from src/materials/ShopComponents/Coupons/index.tsx rename to src/materials/shop/Coupons/index.tsx diff --git a/src/materials/ShopComponents/Coupons/schema.ts b/src/materials/shop/Coupons/schema.ts similarity index 100% rename from src/materials/ShopComponents/Coupons/schema.ts rename to src/materials/shop/Coupons/schema.ts diff --git a/src/materials/ShopComponents/Coupons/template.ts b/src/materials/shop/Coupons/template.ts similarity index 100% rename from src/materials/ShopComponents/Coupons/template.ts rename to src/materials/shop/Coupons/template.ts diff --git a/src/materials/ShopComponents/List/index.less b/src/materials/shop/List/index.less similarity index 100% rename from src/materials/ShopComponents/List/index.less rename to src/materials/shop/List/index.less diff --git a/src/materials/ShopComponents/List/index.tsx b/src/materials/shop/List/index.tsx similarity index 100% rename from src/materials/ShopComponents/List/index.tsx rename to src/materials/shop/List/index.tsx diff --git a/src/materials/ShopComponents/List/schema.ts b/src/materials/shop/List/schema.ts similarity index 100% rename from src/materials/ShopComponents/List/schema.ts rename to src/materials/shop/List/schema.ts diff --git a/src/materials/ShopComponents/List/template.ts b/src/materials/shop/List/template.ts similarity index 100% rename from src/materials/ShopComponents/List/template.ts rename to src/materials/shop/List/template.ts diff --git a/src/materials/ShopComponents/Tab/index.less b/src/materials/shop/Tab/index.less similarity index 100% rename from src/materials/ShopComponents/Tab/index.less rename to src/materials/shop/Tab/index.less diff --git a/src/materials/ShopComponents/Tab/index.tsx b/src/materials/shop/Tab/index.tsx similarity index 100% rename from src/materials/ShopComponents/Tab/index.tsx rename to src/materials/shop/Tab/index.tsx diff --git a/src/materials/ShopComponents/Tab/schema.ts b/src/materials/shop/Tab/schema.ts similarity index 100% rename from src/materials/ShopComponents/Tab/schema.ts rename to src/materials/shop/Tab/schema.ts diff --git a/src/materials/ShopComponents/Tab/template.ts b/src/materials/shop/Tab/template.ts similarity index 100% rename from src/materials/ShopComponents/Tab/template.ts rename to src/materials/shop/Tab/template.ts diff --git a/src/materials/ShopComponents/ZhuanLan/index.less b/src/materials/shop/ZhuanLan/index.less similarity index 100% rename from src/materials/ShopComponents/ZhuanLan/index.less rename to src/materials/shop/ZhuanLan/index.less diff --git a/src/materials/ShopComponents/ZhuanLan/index.tsx b/src/materials/shop/ZhuanLan/index.tsx similarity index 100% rename from src/materials/ShopComponents/ZhuanLan/index.tsx rename to src/materials/shop/ZhuanLan/index.tsx diff --git a/src/materials/ShopComponents/ZhuanLan/schema.ts b/src/materials/shop/ZhuanLan/schema.ts similarity index 100% rename from src/materials/ShopComponents/ZhuanLan/schema.ts rename to src/materials/shop/ZhuanLan/schema.ts diff --git a/src/materials/ShopComponents/ZhuanLan/template.ts b/src/materials/shop/ZhuanLan/template.ts similarity index 100% rename from src/materials/ShopComponents/ZhuanLan/template.ts rename to src/materials/shop/ZhuanLan/template.ts diff --git a/src/materials/ShopComponents/schema.ts b/src/materials/shop/schema.ts similarity index 100% rename from src/materials/ShopComponents/schema.ts rename to src/materials/shop/schema.ts diff --git a/src/materials/ShopComponents/template.ts b/src/materials/shop/template.ts similarity index 100% rename from src/materials/ShopComponents/template.ts rename to src/materials/shop/template.ts diff --git a/src/pages/editor/Container.tsx b/src/pages/editor/Container.tsx index 05c5a858..aa1da5a0 100644 --- a/src/pages/editor/Container.tsx +++ b/src/pages/editor/Container.tsx @@ -6,6 +6,7 @@ import { HighlightOutlined, DoubleRightOutlined, DoubleLeftOutlined, + AppstoreOutlined, } from '@ant-design/icons'; import { connect } from 'dva'; import HeaderComponent from './components/Header'; @@ -19,6 +20,7 @@ import { FormRender } from '@/core'; import template from '@/materials/base/template'; import mediaTpl from '@/materials/media/template'; import graphTpl from '@/materials/visual/template'; +import shopTpl from '@/materials/shop/template'; import schemaH5 from '@/materials/schema'; import { ActionCreators, StateWithHistory } from 'redux-undo'; @@ -66,6 +68,7 @@ const Container = (props: { base: , media: , visible: , + shop: , }; const generateHeader = useMemo(() => { @@ -154,8 +157,11 @@ const Container = (props: { graphTpl.forEach(v => { arr.push(v.type); }); + shopTpl.forEach(v => { + arr.push(v.type); + }); return arr; - }, [graphTpl, mediaTpl, template]); + }, [graphTpl, mediaTpl, template, shopTpl]); const [dragstate, setDragState] = useState({ x: 0, y: 0 }); @@ -198,6 +204,7 @@ const Container = (props: { + ); } else { @@ -244,10 +251,23 @@ const Container = (props: { ))} + +
营销组件
+ {shopTpl.map((value, i) => ( + + + + ))} +
); } - }, [canvasId, collapsed, generateHeader, graphTpl, mediaTpl, schemaH5, template]); + }, [canvasId, collapsed, generateHeader, graphTpl, mediaTpl, schemaH5, template, shopTpl]); const containerRef = useRef(null); const [diffmove, setDiffMove] = useState({