|
@@ -143,6 +143,14 @@ function CreativePup(props: Props) {
|
|
}
|
|
}
|
|
delete newValues[key]
|
|
delete newValues[key]
|
|
break;
|
|
break;
|
|
|
|
+ case 'element_story'://图素材
|
|
|
|
+ newValues.adcreativeElements = {
|
|
|
|
+ ...newValues.adcreativeElements,
|
|
|
|
+ elementStory: imgMaterialConfig.list?.map(item => ({ imageUrl: item.url })),
|
|
|
|
+ description: newValues.description,
|
|
|
|
+ }
|
|
|
|
+ delete newValues[key]
|
|
|
|
+ break;
|
|
case 'short_video1'://视频素材
|
|
case 'short_video1'://视频素材
|
|
newValues.adcreativeElements = {
|
|
newValues.adcreativeElements = {
|
|
...newValues.adcreativeElements,
|
|
...newValues.adcreativeElements,
|
|
@@ -327,6 +335,15 @@ function CreativePup(props: Props) {
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res?.length > 0) {
|
|
if (res?.length > 0) {
|
|
form.setFieldsValue({ adcreativeName: res[0]?.adcreativeTemplateAppellation + '_' + moment().format('YYYYMMDDhhmmss') + '_' + currentUser.userId })
|
|
form.setFieldsValue({ adcreativeName: res[0]?.adcreativeTemplateAppellation + '_' + moment().format('YYYYMMDDhhmmss') + '_' + currentUser.userId })
|
|
|
|
+ let adcreativeElements = res[0]?.adcreativeElements || []
|
|
|
|
+ let elementStoryData = adcreativeElements?.find((item: { name: string }) => item.name === 'element_story')
|
|
|
|
+ if (elementStoryData) {
|
|
|
|
+ let imgageData = adcreativeElements?.find((item: { name: string }) => item.name === 'image')
|
|
|
|
+ if (imgageData) {
|
|
|
|
+ elementStoryData.restriction = imgageData.restriction
|
|
|
|
+ adcreativeElements.splice(adcreativeElements?.findIndex((item: { name: string }) => item.name === 'image'), 1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
set_adcreative_template(res[0])
|
|
set_adcreative_template(res[0])
|
|
if (siteSet?.some((name: string) => name === 'SITE_SET_MOMENTS')) {
|
|
if (siteSet?.some((name: string) => name === 'SITE_SET_MOMENTS')) {
|
|
let id = res[0].adcreativeTemplateId
|
|
let id = res[0].adcreativeTemplateId
|
|
@@ -486,7 +503,7 @@ function CreativePup(props: Props) {
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (!infoSet && dataInfo && adcreative_template_list?.length > 0) {
|
|
if (!infoSet && dataInfo && adcreative_template_list?.length > 0) {
|
|
let { adcreativeName, adcreativeTemplateId, conversionDataType, conversionTargetType, linkNameType, linkPageType, pageType, promotedObjectType, siteSet, profile, adcreativeElements, overrideCanvasHeadOption, linkPageSpec } = dataInfo
|
|
let { adcreativeName, adcreativeTemplateId, conversionDataType, conversionTargetType, linkNameType, linkPageType, pageType, promotedObjectType, siteSet, profile, adcreativeElements, overrideCanvasHeadOption, linkPageSpec } = dataInfo
|
|
- let { description, imageUrl, title, videoUrl, imageUrlList, endPage, shortVideoStruct, brand, buttonText } = adcreativeElements
|
|
|
|
|
|
+ let { description, imageUrl, title, videoUrl, imageUrlList, endPage, shortVideoStruct, brand, buttonText, elementStory } = adcreativeElements
|
|
let obj: any = {
|
|
let obj: any = {
|
|
adcreativeName,
|
|
adcreativeName,
|
|
siteSet,
|
|
siteSet,
|
|
@@ -571,6 +588,16 @@ function CreativePup(props: Props) {
|
|
})
|
|
})
|
|
obj = { ...obj, image_list: imageUrlList }
|
|
obj = { ...obj, image_list: imageUrlList }
|
|
}
|
|
}
|
|
|
|
+ if (elementStory) {
|
|
|
|
+ setImgMaterialConfig({
|
|
|
|
+ cloudSize: [],
|
|
|
|
+ list: elementStory?.map((item: { imageUrl: string }) => ({ url: item.imageUrl })),
|
|
|
|
+ max: elementStory.length,
|
|
|
|
+ type: 'element_story',
|
|
|
|
+ adcreativeTemplateId
|
|
|
|
+ })
|
|
|
|
+ obj = { ...obj, element_story: imageUrlList }
|
|
|
|
+ }
|
|
if (shortVideoStruct) {
|
|
if (shortVideoStruct) {
|
|
setVideoMaterialConfig({
|
|
setVideoMaterialConfig({
|
|
cloudSize: [],
|
|
cloudSize: [],
|
|
@@ -684,7 +711,7 @@ function CreativePup(props: Props) {
|
|
{/* 优先展示视频或图片,朋友圈常规不勾选使用外部素材替换内部,隐藏此选项,后期自动将落地页顶部素材添加进入 */}
|
|
{/* 优先展示视频或图片,朋友圈常规不勾选使用外部素材替换内部,隐藏此选项,后期自动将落地页顶部素材添加进入 */}
|
|
{((overrideCanvasHeadOption !== 'OPTION_CANVAS_OVERRIDE_CREATIVE') || siteSet.every((name: string) => name !== 'SITE_SET_MOMENTS')) && <div style={{ display: 'flex', flexFlow: 'column' }}>
|
|
{((overrideCanvasHeadOption !== 'OPTION_CANVAS_OVERRIDE_CREATIVE') || siteSet.every((name: string) => name !== 'SITE_SET_MOMENTS')) && <div style={{ display: 'flex', flexFlow: 'column' }}>
|
|
{
|
|
{
|
|
- adcreative_template?.adcreativeElements?.filter(item => item.required && item.name === 'image_list' || item.name === 'short_video1' || item.name === 'video' || item.name === 'image').map(item => {
|
|
|
|
|
|
+ adcreative_template?.adcreativeElements?.filter(item => item.required && item.name === 'image_list' || item.name === 'short_video1' || item.name === 'video' || item.name === 'image' || item.name === 'element_story').map(item => {
|
|
return <Form.Item
|
|
return <Form.Item
|
|
label={<strong>{item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? '视频封面图' : item.description}</strong>}
|
|
label={<strong>{item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? '视频封面图' : item.description}</strong>}
|
|
key={item.name}
|
|
key={item.name}
|
|
@@ -789,6 +816,41 @@ function CreativePup(props: Props) {
|
|
</div>
|
|
</div>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
}
|
|
}
|
|
|
|
+ {
|
|
|
|
+ item.name === 'element_story' && <Form.Item
|
|
|
|
+ noStyle
|
|
|
|
+ rules={[{ required: true, message: '请选择素材!' }]}
|
|
|
|
+ name={item.name}
|
|
|
|
+ style={item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? { order: 2 } : {}}
|
|
|
|
+ >
|
|
|
|
+ <div className={`${styles.box} ${item.arrayProperty.maxNumber >= 3 ? styles.image_list : styles.image}`} onClick={() => {
|
|
|
|
+ init({ mediaType: 'IMG', num: item?.arrayProperty?.maxNumber, cloudSize: [[{ relation: '=', width: item?.restriction.imageRestriction?.width, height: item?.restriction.imageRestriction?.height }]], maxSize: item?.restriction?.imageRestriction?.fileSize * 1024 })
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ set_selectImgVisible(true)
|
|
|
|
+ setImgMaterialConfig({
|
|
|
|
+ ...imgMaterialConfig,
|
|
|
|
+ type: item.name,
|
|
|
|
+ max: item.arrayProperty.maxNumber,
|
|
|
|
+ adcreativeTemplateId
|
|
|
|
+ })
|
|
|
|
+ }, 100)
|
|
|
|
+ }}>
|
|
|
|
+ {
|
|
|
|
+ Array(item.arrayProperty.maxNumber).fill('').map((arr, index) => {
|
|
|
|
+ return <p key={index}>
|
|
|
|
+ {
|
|
|
|
+ imgMaterialConfig?.list[index] ? <img style={item?.restriction.imageRestriction?.width > item?.restriction.imageRestriction?.height ? { width: '100%', height: 'auto' } : {}} src={imgMaterialConfig?.list[index].url} /> : <>
|
|
|
|
+ <span>{`推荐尺寸(${item.restriction.imageRestriction.width} x ${item.restriction.imageRestriction.height})`}</span>
|
|
|
|
+ <span>{`${item.restriction.imageRestriction.fileFormat?.map(str => str?.replace('IMAGE_TYPE_', ''))};小于 ${item.restriction.imageRestriction.fileSize}KB`}</span>
|
|
|
|
+ </>
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ </p>
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ </div>
|
|
|
|
+ </Form.Item>
|
|
|
|
+ }
|
|
</Form.Item>
|
|
</Form.Item>
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -896,7 +958,7 @@ function CreativePup(props: Props) {
|
|
{/* ============================================================普通行动按钮============================================================= */}
|
|
{/* ============================================================普通行动按钮============================================================= */}
|
|
{
|
|
{
|
|
pupState.xd_show && <Form.Item hidden={isShowXd} label={<strong>行动按钮</strong>} name='actionBtn' valuePropName="checked">
|
|
pupState.xd_show && <Form.Item hidden={isShowXd} label={<strong>行动按钮</strong>} name='actionBtn' valuePropName="checked">
|
|
- <Switch checkedChildren="开启" unCheckedChildren="关闭" disabled={isShowXd}/>
|
|
|
|
|
|
+ <Switch checkedChildren="开启" unCheckedChildren="关闭" disabled={isShowXd} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
}
|
|
}
|
|
{
|
|
{
|