|
@@ -360,7 +360,7 @@ function CreativePup(props: Props) {
|
|
|
set_adcreative_template_list(newArr)
|
|
|
})
|
|
|
}
|
|
|
- }, [siteSet, promotedObjectType, form])
|
|
|
+ }, [siteSet, promotedObjectType])
|
|
|
// 获取创意形式详情
|
|
|
const getTemplate = useCallback((id: any, ok?: any) => {
|
|
|
// CAMPAIGN_TYPE_NORMAL
|
|
@@ -414,7 +414,10 @@ function CreativePup(props: Props) {
|
|
|
const typeChange = useCallback((adcreativeElementsType) => {
|
|
|
if (adcreativeElementsType && adcreative_template_list?.length > 0) {
|
|
|
let adcreativeTemplateIdArr = adcreative_template_list?.filter(item => item.adcreativeTemplateStyle === adcreativeElementsType)
|
|
|
+ console.log('typeChange====>', adcreativeTemplateIdArr[0].adcreativeTemplateId)
|
|
|
+ getTemplate(adcreativeTemplateIdArr[0].adcreativeTemplateId)
|
|
|
form.setFieldsValue({ adcreativeTemplateId: adcreativeTemplateIdArr[0].adcreativeTemplateId })
|
|
|
+
|
|
|
}
|
|
|
}, [adcreative_template_list])
|
|
|
|
|
@@ -466,7 +469,7 @@ function CreativePup(props: Props) {
|
|
|
// 视频结束页 end_page
|
|
|
if (adcreative_template.adcreativeElements.some((item: { name: string }) => item.name === 'end_page')) {
|
|
|
// let endPageType =adcreative_template?.adcreativeElements?.filter(item=>item.name === 'end_page_type')[0]?.enumProperty?.enumeration
|
|
|
- if(!ok){
|
|
|
+ if (!ok) {
|
|
|
values = { ...values, endPageType: 'END_PAGE_AVATAR_NICKNAME_HIGHLIGHT' }
|
|
|
}
|
|
|
states = { ...states, sp_show: true }
|
|
@@ -516,7 +519,7 @@ function CreativePup(props: Props) {
|
|
|
useEffect(() => {
|
|
|
if (!infoSet && dataInfo && adcreative_template_list?.length > 0) {
|
|
|
let { adcreativeName, adcreativeTemplateId, conversionDataType, conversionTargetType, linkNameType, linkPageType, pageType, promotedObjectType, siteSet, adcreativeElements, overrideCanvasHeadOption, linkPageSpec } = dataInfo
|
|
|
- let { description, imageUrl, title, videoUrl, imageUrlList, endPage, shortVideoStruct,brand } = adcreativeElements
|
|
|
+ let { description, imageUrl, title, videoUrl, imageUrlList, endPage, shortVideoStruct, brand } = adcreativeElements
|
|
|
let obj: any = {
|
|
|
adcreativeName,
|
|
|
siteSet,
|
|
@@ -558,13 +561,13 @@ function CreativePup(props: Props) {
|
|
|
obj = { ...obj, overrideCanvasHeadOption }
|
|
|
}
|
|
|
if (linkPageSpec?.pageUrl) {
|
|
|
- obj = { ...obj, pageUrl:linkPageSpec?.pageUrl }
|
|
|
+ obj = { ...obj, pageUrl: linkPageSpec?.pageUrl }
|
|
|
}
|
|
|
if (linkPageSpec?.miniProgramSpec && linkPageSpec?.miniProgramSpec?.miniProgramPath) {
|
|
|
- obj = { ...obj, miniProgramPath:linkPageSpec?.miniProgramSpec?.miniProgramPath, miniProgramId:linkPageSpec?.miniProgramSpec?.miniProgramId }
|
|
|
+ obj = { ...obj, miniProgramPath: linkPageSpec?.miniProgramSpec?.miniProgramPath, miniProgramId: linkPageSpec?.miniProgramSpec?.miniProgramId }
|
|
|
}
|
|
|
- if(brand && brand.brandImg && brand.brandName){
|
|
|
- obj={...obj,brand:brand.brandName+'_'+brand.brandImg,}
|
|
|
+ if (brand && brand.brandImg && brand.brandName) {
|
|
|
+ obj = { ...obj, brand: brand.brandName + '_' + brand.brandImg, }
|
|
|
}
|
|
|
if (videoUrl) {
|
|
|
setVideoMaterialConfig({
|
|
@@ -610,6 +613,11 @@ function CreativePup(props: Props) {
|
|
|
form.setFieldsValue(obj)
|
|
|
set_infoSet(true)
|
|
|
}
|
|
|
+ // 不是数据回填首次打开界面选中视频
|
|
|
+ if (!infoSet && !dataInfo && adcreative_template_list?.length > 0) {
|
|
|
+ typeChange('视频')
|
|
|
+ set_infoSet(true)
|
|
|
+ }
|
|
|
}, [dataInfo, adcreative_template_list, adcreative_template, infoSet])
|
|
|
// 生成视频封面图
|
|
|
const videoToImgs = useCallback(() => {
|
|
@@ -886,7 +894,7 @@ function CreativePup(props: Props) {
|
|
|
}
|
|
|
{//过滤了不必传和品牌名称,品牌标识图(外部传)短视频结构(组装使用)
|
|
|
adcreative_template?.adcreativeElements?.filter(item => item.required && item.name === 'description').map(item => {
|
|
|
- let maxNum = adcreativeTemplateId === 1708 ? pupState.xd_show ? 10 : item.restriction.textRestriction.maxLength : item.restriction.textRestriction.maxLength
|
|
|
+ let maxNum = adcreativeTemplateId === 1708 || adcreativeTemplateId === 1707 ? pupState.xd_show ? 10 : item.restriction.textRestriction.maxLength : item.restriction.textRestriction.maxLength
|
|
|
return <div key={item.fieldType}>
|
|
|
<Form.Item label={<strong>{item.description}</strong>} className={'my_description'}>
|
|
|
<Form.Item name={item.name} noStyle rules={[{ required: true, pattern: RegExp(item.restriction.textRestriction.textPattern?.replace(/\+/ig, `{1,${maxNum}}`)), message: '请输入正确的' + item.description }]}>
|