|
@@ -94,8 +94,8 @@ function CreativeModal(props: Props) {
|
|
|
break;
|
|
|
case 'short_video1'://视频素材
|
|
|
newValues.adcreativeElements = {
|
|
|
- shortVideoStruct:{
|
|
|
- shortVideo1Url:materialConfig.list[0].url
|
|
|
+ shortVideoStruct: {
|
|
|
+ shortVideo1Url: materialConfig.list[0].url
|
|
|
},
|
|
|
description: newValues.description,
|
|
|
}
|
|
@@ -108,11 +108,11 @@ function CreativeModal(props: Props) {
|
|
|
newValues.adcreativeElements = { ...newValues.adcreativeElements, title: newValues.title }
|
|
|
break;
|
|
|
case 'endPageType'://视频结束l类型
|
|
|
- newValues.adcreativeElements = { ...newValues.adcreativeElements, endPage: {...newValues.adcreativeElements.endPage,endPageType:newValues.endPageType} }
|
|
|
+ newValues.adcreativeElements = { ...newValues.adcreativeElements, endPage: { ...newValues.adcreativeElements.endPage, endPageType: newValues.endPageType } }
|
|
|
delete newValues[key]
|
|
|
break;
|
|
|
case 'endPageDesc'://视频结束文案
|
|
|
- newValues.adcreativeElements = { ...newValues.adcreativeElements, endPage: {...newValues.adcreativeElements.endPage,endPageDesc:newValues.endPageDesc} }
|
|
|
+ newValues.adcreativeElements = { ...newValues.adcreativeElements, endPage: { ...newValues.adcreativeElements.endPage, endPageDesc: newValues.endPageDesc } }
|
|
|
delete newValues[key]
|
|
|
break;
|
|
|
}
|
|
@@ -123,6 +123,9 @@ function CreativeModal(props: Props) {
|
|
|
delete newValues.dataShow //删除数据开关
|
|
|
delete newValues.actionBtn //删除行动开关
|
|
|
console.log('newValues=>2', newValues)
|
|
|
+ if(!newValues.adcreativeElements){
|
|
|
+ newValues.adcreativeElements={}
|
|
|
+ }
|
|
|
callback(newValues)
|
|
|
})
|
|
|
// PupFn({ visible: false })
|
|
@@ -137,7 +140,7 @@ function CreativeModal(props: Props) {
|
|
|
}).then(res => {
|
|
|
let newArr: any = []
|
|
|
// 过滤掉相同的和即将下线的
|
|
|
- if(!res){
|
|
|
+ if (!res) {
|
|
|
return
|
|
|
}
|
|
|
Object.values(res)?.forEach((arr: any) => {
|
|
@@ -303,7 +306,7 @@ function CreativeModal(props: Props) {
|
|
|
useEffect(() => {
|
|
|
if (dataInfo && adcreative_template_list?.length > 0 && adcreative_template) {
|
|
|
let { adcreativeName, adcreativeTemplateId, conversionDataType, conversionTargetType, linkNameType, linkPageType, pageType, promotedObjectType, siteSet, adcreativeElements } = dataInfo
|
|
|
- let { description, imageUrl, title, videoUrl, imageUrlList,endPage,shortVideoStruct } = adcreativeElements
|
|
|
+ let { description, imageUrl, title, videoUrl, imageUrlList, endPage, shortVideoStruct } = adcreativeElements
|
|
|
let obj: any = {
|
|
|
adcreativeName,
|
|
|
siteSet,
|
|
@@ -336,8 +339,8 @@ function CreativeModal(props: Props) {
|
|
|
if (title) {
|
|
|
obj = { ...obj, title }
|
|
|
}
|
|
|
- if(endPage){
|
|
|
- obj = { ...obj, videoOver:true ,...endPage}
|
|
|
+ if (endPage) {
|
|
|
+ obj = { ...obj, videoOver: true, ...endPage }
|
|
|
}
|
|
|
if (videoUrl) {
|
|
|
setMaterialConfig({
|
|
@@ -366,7 +369,7 @@ function CreativeModal(props: Props) {
|
|
|
adcreativeTemplateId
|
|
|
})
|
|
|
}
|
|
|
- if(shortVideoStruct){
|
|
|
+ if (shortVideoStruct) {
|
|
|
setMaterialConfig({
|
|
|
cloudSize: [],
|
|
|
list: [{ url: shortVideoStruct.shortVideo1Url }],
|
|
@@ -469,7 +472,7 @@ function CreativeModal(props: Props) {
|
|
|
{/* 视频 */}
|
|
|
{
|
|
|
(item.name === 'short_video1' || item.name === 'video') && <div className={`${styles.box} ${styles.video}`} onClick={() => {
|
|
|
- init({ mediaType: 'VIDEO', cloudSize:adcreativeTemplateId === 1708 ? [[{ relation: '=', width: 1280, height: 720 }]]:[[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]],maxSize:item.restriction.videoRestriction.fileSize *1024})
|
|
|
+ init({ mediaType: 'VIDEO', cloudSize: adcreativeTemplateId === 1708 ? [[{ relation: '=', width: 1280, height: 720 }]] : [[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]], maxSize: item.restriction.videoRestriction.fileSize * 1024 })
|
|
|
setTimeout(() => {
|
|
|
set_selectImgVisible(true)
|
|
|
setMaterialConfig({
|
|
@@ -483,7 +486,7 @@ function CreativeModal(props: Props) {
|
|
|
<p>
|
|
|
{
|
|
|
materialConfig?.list[0] ? <video src={materialConfig?.list[0].url} controls /> : <>
|
|
|
- <span>{`推荐尺寸(${adcreativeTemplateId === 1708 ?1280 :item.restriction.videoRestriction.minWidth} x ${adcreativeTemplateId === 1708 ?720 :item.restriction.videoRestriction.minHeight})`}</span>
|
|
|
+ <span>{`推荐尺寸(${adcreativeTemplateId === 1708 ? 1280 : item.restriction.videoRestriction.minWidth} x ${adcreativeTemplateId === 1708 ? 720 : item.restriction.videoRestriction.minHeight})`}</span>
|
|
|
<span>{`${item.restriction.videoRestriction.fileFormat?.map(str => str?.replace('MEDIA_TYPE_', ''))};< ${item.restriction.videoRestriction.fileSize / 1024}M;时长 ≥ ${item.restriction.videoRestriction.minDuration}s,≤ ${item.restriction.videoRestriction.maxDuration}s,必须带有声音`}</span>
|
|
|
</>
|
|
|
}
|
|
@@ -493,7 +496,7 @@ function CreativeModal(props: Props) {
|
|
|
{/* 单图 */}
|
|
|
{
|
|
|
item.name === 'image' && <div className={`${styles.box} ${styles.image}`} onClick={() => {
|
|
|
- init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]],maxSize:item.restriction.imageRestriction.fileSize *1024 })
|
|
|
+ init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]], maxSize: item.restriction.imageRestriction.fileSize * 1024 })
|
|
|
setTimeout(() => {
|
|
|
set_selectImgVisible(true)
|
|
|
setMaterialConfig({
|
|
@@ -517,7 +520,7 @@ function CreativeModal(props: Props) {
|
|
|
{/* 多图 */}
|
|
|
{
|
|
|
item.name === 'image_list' && <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 })
|
|
|
+ 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)
|
|
|
setMaterialConfig({
|
|
@@ -586,7 +589,7 @@ function CreativeModal(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 ? 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 }]}>
|
|
@@ -595,16 +598,16 @@ function CreativeModal(props: Props) {
|
|
|
style={{ width: 500 }}
|
|
|
onFocus={() => {
|
|
|
setdescriptionshow(true)
|
|
|
- textList({ maxTextLength: item.restriction.textRestriction.maxLength })
|
|
|
+ textList({ maxTextLength: maxNum })
|
|
|
}}
|
|
|
onChange={(e) => {
|
|
|
let value = e.target.value
|
|
|
- textList({ maxTextLength: item.restriction.textRestriction.maxLength, keyword: value })
|
|
|
+ textList({ maxTextLength: maxNum, keyword: value })
|
|
|
}}
|
|
|
allowClear
|
|
|
/>
|
|
|
</Form.Item>
|
|
|
- <span>{`${description?.length ?? 0}/${item.restriction.textRestriction.maxLength}`}</span>
|
|
|
+ <span>{`${description?.length ?? 0}/${maxNum}`}</span>
|
|
|
{
|
|
|
descriptionShow && <List
|
|
|
loading={getTextLsit?.loading}
|