|
@@ -5,12 +5,15 @@ import React, { useEffect, useState } from "react"
|
|
import { TextTypeList } from "../../const"
|
|
import { TextTypeList } from "../../const"
|
|
import { DeleteOutlined, PlusOutlined } from "@ant-design/icons"
|
|
import { DeleteOutlined, PlusOutlined } from "@ant-design/icons"
|
|
import AddTextS from "./addTextS"
|
|
import AddTextS from "./addTextS"
|
|
-
|
|
|
|
|
|
+import style from '../index.less'
|
|
|
|
+import styles from '../Material/index.less'
|
|
|
|
+import VideoNews from "@/pages/launchSystemNew/components/newsModal/videoNews"
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
textData: any,
|
|
textData: any,
|
|
dynamicMaterialDTos: any,
|
|
dynamicMaterialDTos: any,
|
|
mediaType: 0 | 1 | 2,
|
|
mediaType: 0 | 1 | 2,
|
|
|
|
+ deliveryMode?: string,
|
|
value?: any,
|
|
value?: any,
|
|
visible?: boolean
|
|
visible?: boolean
|
|
onClose?: () => void
|
|
onClose?: () => void
|
|
@@ -22,7 +25,7 @@ interface Props {
|
|
* @param param0
|
|
* @param param0
|
|
* @returns
|
|
* @returns
|
|
*/
|
|
*/
|
|
-const NewText: React.FC<Props> = ({ visible, onClose, onChange, value, textData, dynamicMaterialDTos, mediaType }) => {
|
|
|
|
|
|
+const NewText: React.FC<Props> = ({ visible, onClose, onChange, value, textData, dynamicMaterialDTos, mediaType, deliveryMode }) => {
|
|
|
|
|
|
/*************************************/
|
|
/*************************************/
|
|
const [form] = Form.useForm();
|
|
const [form] = Form.useForm();
|
|
@@ -74,6 +77,62 @@ const NewText: React.FC<Props> = ({ visible, onClose, onChange, value, textData,
|
|
}
|
|
}
|
|
}, [textData])
|
|
}, [textData])
|
|
|
|
|
|
|
|
+ // 一一对应显示素材
|
|
|
|
+ const showMaterial = (index: number) => {
|
|
|
|
+ const dynamicGroup = dynamicMaterialDTos?.dynamicGroup
|
|
|
|
+ if (dynamicGroup && Object.keys(dynamicGroup).length) {
|
|
|
|
+ let dynamic = dynamicGroup[index]
|
|
|
|
+ const keys = Object.keys(dynamic)
|
|
|
|
+ if (deliveryMode === "DELIVERY_MODE_CUSTOMIZE") {
|
|
|
|
+ console.log('--->', keys)
|
|
|
|
+ return <>
|
|
|
|
+ <div className={style.detail_body_m}>
|
|
|
|
+ {(keys.includes('video_id') || keys.includes('short_video1')) ? <>
|
|
|
|
+ <div className={style.video}>
|
|
|
|
+ <VideoNews src={dynamic?.video_id?.url || dynamic?.short_video1?.url} style={{ width: 40, height: 30 }} />
|
|
|
|
+ {dynamic?.cover_id && <div className={style.cover_image} style={{ marginLeft: 4, width: 40, height: 30, minWidth: 42 }}>
|
|
|
|
+ <img src={dynamic?.cover_id?.url} style={{ maxWidth: '96%', maxHeight: '96%' }}/>
|
|
|
|
+ </div>}
|
|
|
|
+ </div>
|
|
|
|
+ </> : keys.includes('image_id') ? <>
|
|
|
|
+ <div className={style.cover_image} style={{ width: 40, height: 30, minWidth: 42 }}>
|
|
|
|
+ <img src={dynamic?.image_id?.url} />
|
|
|
|
+ </div>
|
|
|
|
+ </> : (keys.includes('image_list') || keys.includes('element_story')) ? <>
|
|
|
|
+ {dynamic?.[keys.includes('image_list') ? 'image_list' : 'element_story']?.map((item: { url: string | undefined; }, index: undefined) => <div className={style.cover_image} key={index} style={{ width: 30, height: 24, minWidth: 32 }}>
|
|
|
|
+ <img src={item?.url} />
|
|
|
|
+ </div>)}
|
|
|
|
+ </> : null}
|
|
|
|
+ </div>
|
|
|
|
+ </>
|
|
|
|
+ } else {
|
|
|
|
+ return <div style={{ display: 'flex', gap: 5, flexWrap: 'wrap' }}>
|
|
|
|
+ {dynamic?.list?.map((item: any, index: number) => {
|
|
|
|
+ if (Array.isArray(item)) {
|
|
|
|
+ let length = item.length
|
|
|
|
+ return <div className={styles.boxList_body_item} key={index} style={{ width: 30, height: 30 }}>
|
|
|
|
+ <div className={styles.content} style={{ width: 30, height: 30 }}>
|
|
|
|
+ {item.map((l, i) => <img src={l?.url} key={i} style={{ width: length === 6 ? 9.999 : 14.999 }} />)}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ } else if (item?.url?.includes('mp4')) {
|
|
|
|
+ return <div className={styles.boxList_body_item} key={index} style={{ width: 30, height: 30 }}>
|
|
|
|
+ <div className={styles.content} style={{ width: 30, height: 30 }}>
|
|
|
|
+ <VideoNews src={item?.url} style={{ width: 30, height: 30 }} maskBodyStyle={{ backgroundColor: "rgba(242, 246, 254, 0.1)" }} />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ } else {
|
|
|
|
+ return <div className={styles.boxList_body_item} key={index} style={{ width: 30, height: 30 }}>
|
|
|
|
+ <div className={styles.content} style={{ width: 30, height: 30 }}><img src={item?.url} /></div>
|
|
|
|
+ </div>
|
|
|
|
+ }
|
|
|
|
+ })}
|
|
|
|
+ </div>
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return null
|
|
|
|
+ }
|
|
|
|
+
|
|
return <Modal
|
|
return <Modal
|
|
title={<Space>
|
|
title={<Space>
|
|
<strong style={{ fontSize: 20 }}>创意文案</strong>
|
|
<strong style={{ fontSize: 20 }}>创意文案</strong>
|
|
@@ -141,7 +200,10 @@ const NewText: React.FC<Props> = ({ visible, onClose, onChange, value, textData,
|
|
{(fields, { add, remove }) => (<>
|
|
{(fields, { add, remove }) => (<>
|
|
{fields.map(({ key, name, ...restField }, num) => (
|
|
{fields.map(({ key, name, ...restField }, num) => (
|
|
<Card
|
|
<Card
|
|
- title={type === 1 ? <strong style={{ fontSize: 14 }}>创意组{num + 1}</strong> : type === 0 ? null : <strong style={{ fontSize: 14 }}>文案组{num + 1}</strong>}
|
|
|
|
|
|
+ title={<div style={{ display: 'flex', gap: 5, alignItems: 'center' }}>
|
|
|
|
+ {type === 1 ? <strong style={{ fontSize: 14 }}>创意组{num + 1}</strong> : type === 0 ? null : <strong style={{ fontSize: 14 }}>文案组{num + 1}</strong>}
|
|
|
|
+ {type === 1 && showMaterial(num)}
|
|
|
|
+ </div>}
|
|
className="cardResetCss"
|
|
className="cardResetCss"
|
|
style={{ marginTop: 10, width: '100%' }}
|
|
style={{ marginTop: 10, width: '100%' }}
|
|
key={key}
|
|
key={key}
|