|
@@ -1,5 +1,5 @@
|
|
|
import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons"
|
|
|
-import { Button, Card, Form, Modal, Popconfirm, Space, message } from "antd"
|
|
|
+import { Button, Card, Dropdown, Form, Menu, Modal, Popconfirm, Space, message } from "antd"
|
|
|
import React, { useEffect, useState } from "react"
|
|
|
import styles from './index.less'
|
|
|
import VideoNews from "@/pages/launchSystemNew/components/newsModal/videoNews"
|
|
@@ -11,13 +11,14 @@ import VideoFrameSelect from "@/pages/launchSystemV3/components/VideoFrameSelect
|
|
|
interface Props {
|
|
|
creativeTemplateId: number
|
|
|
materialData: any
|
|
|
+ deliveryMode: string,
|
|
|
value?: any,
|
|
|
visible?: boolean
|
|
|
onClose?: () => void
|
|
|
onChange?: (value: any) => void
|
|
|
}
|
|
|
|
|
|
-const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, visible, value, onChange, onClose }) => {
|
|
|
+const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, deliveryMode, visible, value, onChange, onClose }) => {
|
|
|
|
|
|
/*********************************/
|
|
|
const { init } = useModel('useLaunchAdq.useBdMediaPup')
|
|
@@ -177,13 +178,61 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, visibl
|
|
|
<Form.List name="dynamicGroup">
|
|
|
{(fields, { add, remove }) => (<>
|
|
|
{fields.map((field, num) => (<Card
|
|
|
- title={<strong style={{ fontSize: 18 }}>创意组{num + 1}</strong>}
|
|
|
+ title={<Space>
|
|
|
+ <strong style={{ fontSize: 18 }}>创意组{num + 1}</strong>
|
|
|
+ {deliveryMode === 'DELIVERY_MODE_COMPONENT' && <>
|
|
|
+ <Dropdown
|
|
|
+ overlay={<Menu>
|
|
|
+ <Menu.Item onClick={() => { console.log('添加9:16视频') }}>添加9:16视频</Menu.Item>
|
|
|
+ <Menu.Item onClick={() => { console.log('添加16:9视频') }}>添加16:9视频</Menu.Item>
|
|
|
+ <Menu.Item onClick={() => { console.log('添加9:16(720*1280)图片') }}>添加9:16(720*1280)图片</Menu.Item>
|
|
|
+ <Menu.Item onClick={() => { console.log('添加16:9(1280*720)图片') }}>添加16:9(1280*720)图片</Menu.Item>
|
|
|
+ <Menu.Item onClick={() => { console.log('添加1:1(800*800)图片') }}>添加1:1(800*800)图片</Menu.Item>
|
|
|
+ <Menu.Item onClick={() => { console.log('添加20:7(960*334)图片') }}>添加20:7(960*334)图片</Menu.Item>
|
|
|
+ <Menu.Item onClick={() => {
|
|
|
+ init({ mediaType: 'IMG', num: 15, cloudSize: [[
|
|
|
+ { relation: '=', width: 800, height: 800 },
|
|
|
+ { relation: '=', width: 1280, height: 720 },
|
|
|
+ { relation: '=', width: 720, height: 1280 },
|
|
|
+ { relation: '=', width: 960, height: 334 },
|
|
|
+ { relation: '=', width: 480, height: 320 },
|
|
|
+ ]], maxSize: 400 * 1024 })
|
|
|
+ setMaterialConfig({
|
|
|
+ ...materialConfig,
|
|
|
+ type: 'image',
|
|
|
+ max: 15,
|
|
|
+ index: 99999,
|
|
|
+ adcreativeTemplateId: creativeTemplateId
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ setSelectVideoVisible(true)
|
|
|
+ }, 100)
|
|
|
+ }}>添加3:2(480*320)图片</Menu.Item>
|
|
|
+ </Menu>}
|
|
|
+ placement="bottomLeft"
|
|
|
+ arrow
|
|
|
+ >
|
|
|
+ <Button type="primary">添加图片/视频</Button>
|
|
|
+ </Dropdown>
|
|
|
+ <Dropdown
|
|
|
+ overlay={<Menu>
|
|
|
+ <Menu.Item onClick={() => { console.log('1:1 六图') }}>1:1 六图</Menu.Item>
|
|
|
+ <Menu.Item onClick={() => { console.log('1:1 三图') }}>1:1 三图</Menu.Item>
|
|
|
+ <Menu.Item onClick={() => { console.log('1:1 四图') }}>1:1 四图</Menu.Item>
|
|
|
+ </Menu>}
|
|
|
+ placement="bottomLeft"
|
|
|
+ arrow
|
|
|
+ >
|
|
|
+ <Button type="primary">上传组图</Button>
|
|
|
+ </Dropdown>
|
|
|
+ </>}
|
|
|
+ </Space>}
|
|
|
className="cardResetCss"
|
|
|
key={field.key}
|
|
|
style={{ marginTop: 10, marginBottom: 10 }}
|
|
|
>
|
|
|
<Space size={30} style={{ width: '100%' }} className={styles.space}>
|
|
|
- {Object.keys(materialData)?.map(key => {
|
|
|
+ {deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' ? Object.keys(materialData)?.map(key => {
|
|
|
let m = materialData[key]
|
|
|
let children = m.children
|
|
|
|
|
@@ -302,7 +351,9 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, visibl
|
|
|
|
|
|
return null
|
|
|
})
|
|
|
- })}
|
|
|
+ }) : <div>
|
|
|
+ 11111111111111
|
|
|
+ </div>}
|
|
|
{fields?.length > 1 && <MinusCircleOutlined className={styles.clear} onClick={() => remove(field.name)} style={{ marginBottom: 24, color: 'red' }} />}
|
|
|
</Space>
|
|
|
</Card>))}
|