|
@@ -134,6 +134,7 @@ function CreativePup(props: Props) {
|
|
|
break;
|
|
|
case 'image_list'://图素材
|
|
|
newValues.adcreativeElements = {
|
|
|
+ ...newValues.adcreativeElements,
|
|
|
imageUrlList: imgMaterialConfig.list?.map(item => item.url),
|
|
|
description: newValues.description,
|
|
|
}
|
|
@@ -141,6 +142,7 @@ function CreativePup(props: Props) {
|
|
|
break;
|
|
|
case 'short_video1'://视频素材
|
|
|
newValues.adcreativeElements = {
|
|
|
+ ...newValues.adcreativeElements,
|
|
|
shortVideoStruct: {
|
|
|
shortVideo1Url: videoMaterialConfig?.list[0]?.url
|
|
|
},
|
|
@@ -173,12 +175,20 @@ function CreativePup(props: Props) {
|
|
|
brandImgUrl: newValues.brand.split('_')[1]
|
|
|
}
|
|
|
}
|
|
|
- // newValues.headClickSpec = {
|
|
|
- // headImageUrl: newValues.brand.split('_')[1],
|
|
|
- // profileName: newValues.brand.split('_')[0],
|
|
|
- // description: newValues.brand.split('_')[2]
|
|
|
- // }
|
|
|
break;
|
|
|
+ case 'profile':
|
|
|
+ newValues.adcreativeElements = {
|
|
|
+ ...newValues.adcreativeElements, brand: {
|
|
|
+ brandName: newValues.profile.split('_')[0],
|
|
|
+ brandImgUrl: newValues.profile.split('_')[1]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ newValues.profile = {
|
|
|
+ headImageUrl: newValues.profile.split('_')[1],
|
|
|
+ profileName: newValues.profile.split('_')[0],
|
|
|
+ description: newValues.profile.split('_')[2]
|
|
|
+ }
|
|
|
+ break
|
|
|
case 'pageUrl'://跳转落地页
|
|
|
newValues.linkPageSpec = {
|
|
|
...newValues.linkPageSpec,
|
|
@@ -381,7 +391,6 @@ function CreativePup(props: Props) {
|
|
|
newObj[item.name] = arr
|
|
|
})
|
|
|
setConversionList(newObj)
|
|
|
-
|
|
|
states = { ...states, sj_show: true }
|
|
|
if (newObj.conversion_data_type) {
|
|
|
values = { ...values, conversionDataType: newObj.conversion_data_type[0].value }
|
|
@@ -390,6 +399,7 @@ function CreativePup(props: Props) {
|
|
|
values = { ...values, conversionTargetType: newObj.conversion_target_type[0].value }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//行动按钮组件存在
|
|
|
if (states.xd_show) {
|
|
|
let linkNameList = (pageList?.filter((item: { pageType: any; }) => item.pageType === pageType)[0] as any)?.supportLinkNameType?.list
|
|
@@ -460,8 +470,8 @@ function CreativePup(props: Props) {
|
|
|
// 数据回填
|
|
|
useEffect(() => {
|
|
|
if (!infoSet && dataInfo && adcreative_template_list?.length > 0) {
|
|
|
- let { adcreativeName, adcreativeTemplateId, conversionDataType, conversionTargetType, linkNameType, linkPageType, pageType, promotedObjectType, siteSet, headClickSpec, adcreativeElements, overrideCanvasHeadOption, linkPageSpec } = dataInfo
|
|
|
- let { description, imageUrl, title, videoUrl, imageUrlList, endPage, shortVideoStruct, brand,buttonText } = adcreativeElements
|
|
|
+ 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 obj: any = {
|
|
|
adcreativeName,
|
|
|
siteSet,
|
|
@@ -470,7 +480,7 @@ function CreativePup(props: Props) {
|
|
|
}
|
|
|
getTemplate(adcreativeTemplateId, true)
|
|
|
console.log(2222,dataInfo)
|
|
|
- if ([720, 721, 618, 1708].some(n => n === adcreativeTemplateId)) {
|
|
|
+ if ([720, 721, 618, 1708, 722, 1529].some(n => n === adcreativeTemplateId)) {
|
|
|
obj = { ...obj, adcreativeElementsType: '视频' }
|
|
|
} else {
|
|
|
obj = { ...obj, adcreativeElementsType: '图片' }
|
|
@@ -511,6 +521,9 @@ function CreativePup(props: Props) {
|
|
|
if (brand && brand.brandImgUrl && brand.brandName) {
|
|
|
obj = { ...obj, brand: brand.brandName + '_' + brand.brandImgUrl }
|
|
|
}
|
|
|
+ if (profile && profile.headImageUrl && profile.profileName && profile.description) {
|
|
|
+ obj = { ...obj, profile: profile.profileName + '_' + profile.headImageUrl + '_' + profile.description}
|
|
|
+ }
|
|
|
if(buttonText){
|
|
|
obj = {...obj,buttonText}
|
|
|
}
|
|
@@ -656,13 +669,11 @@ function CreativePup(props: Props) {
|
|
|
{/* ============================================================创意内容============================================================= */}
|
|
|
<Divider orientation='center'>创意内容</Divider>
|
|
|
{/* =============================================================头像及昵称跳转页===================================================================== */}
|
|
|
- {queryForm.promotedObjectType === 'PROMOTED_OBJECT_TYPE_LEAD_AD' && <Form.Item label={<strong>头像及昵称跳转页</strong>} name='brand' rules={[{ required: true, message: '请选择一个头像及昵称跳转页,与广告创意一起展示' }]}>
|
|
|
+ {queryForm.promotedObjectType === 'PROMOTED_OBJECT_TYPE_LEAD_AD' ? adcreative_template?.adcreativeAttributes?.find(item => item.name === 'profile_id') ? <Form.Item label={<strong>头像及昵称跳转页</strong>} name='profile' rules={[{ required: true, message: '请选择一个头像及昵称跳转页,与广告创意一起展示' }]}>
|
|
|
<HeadNickJump />
|
|
|
- </Form.Item>}
|
|
|
- {/* =============================================================品牌形象===================================================================== */}
|
|
|
- {queryForm.promotedObjectType === 'PROMOTED_OBJECT_TYPE_LEAD_AD' && <Form.Item label={<strong>品牌形象</strong>} name='brand' rules={[{ required: true, message: '请选择一个头像及昵称跳转页,与广告创意一起展示' }]}>
|
|
|
+ </Form.Item> : <Form.Item label={<strong>品牌形象</strong>} name='brand' rules={[{ required: true, message: '请选择一个头像及昵称跳转页,与广告创意一起展示' }]}>
|
|
|
<BrandImage />
|
|
|
- </Form.Item>}
|
|
|
+ </Form.Item> : null}
|
|
|
{/* ============================================================素材============================================================= */}
|
|
|
{/* 优先展示视频或图片,朋友圈常规不勾选使用外部素材替换内部,隐藏此选项,后期自动将落地页顶部素材添加进入 */}
|
|
|
{((overrideCanvasHeadOption !== 'OPTION_CANVAS_OVERRIDE_CREATIVE') || siteSet.every((name: string) => name !== 'SITE_SET_MOMENTS')) && <div style={{ display: 'flex', flexFlow: 'column' }}>
|
|
@@ -728,8 +739,7 @@ function CreativePup(props: Props) {
|
|
|
{imgMaterialConfig?.list[0] ? <img src={imgMaterialConfig?.list[0].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>
|