shenwu hace 2 años
padre
commit
8967e1ff07

+ 19 - 8
src/pages/launchSystemNew/launchManage/localAd/creative/modal.tsx

@@ -93,11 +93,13 @@ function CreativeModal(props: Props) {
                         delete newValues[key]
                         break;
                     case 'short_video1'://视频素材
-                        // newValues.adcreativeElements = {
-                        //     video: materialConfig.list[0].url,
-                        //     description: newValues.description,
-                        // }
-                        // delete newValues[key]
+                        newValues.adcreativeElements = {
+                            shortVideoStruct:{
+                                shortVideo1Url:materialConfig.list[0].url
+                            },
+                            description: newValues.description,
+                        }
+                        delete newValues[key]
                         break;
                     case 'description'://文案
                         newValues.adcreativeElements = { ...newValues.adcreativeElements, description: newValues.description }
@@ -298,7 +300,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 } = adcreativeElements
+            let { description, imageUrl, title, videoUrl, imageUrlList,endPage,shortVideoStruct } = adcreativeElements
             let obj: any = {
                 adcreativeName,
                 siteSet,
@@ -361,6 +363,15 @@ function CreativeModal(props: Props) {
                     adcreativeTemplateId
                 })
             }
+            if(shortVideoStruct){
+                setMaterialConfig({
+                    cloudSize: [],
+                    list: [{ url: shortVideoStruct.shortVideo1Url }],
+                    max: 1,
+                    type: 'short_video1',
+                    adcreativeTemplateId
+                })
+            }
             form.setFieldsValue(obj)
         }
     }, [dataInfo, adcreative_template_list, adcreative_template])
@@ -455,7 +466,7 @@ function CreativeModal(props: Props) {
                                     {/* 视频 */}
                                     {
                                         (item.name === 'short_video1' || item.name === 'video') && <div className={`${styles.box} ${styles.video}`} onClick={() => {
-                                            init({ mediaType: 'VIDEO', cloudSize: [[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]] })
+                                            init({ mediaType: 'VIDEO', cloudSize:adcreativeTemplateId === 1708 ?  [[{ relation: '=', width: 1280, height: 720 }]]:[[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]] })
                                             setTimeout(() => {
                                                 set_selectImgVisible(true)
                                                 setMaterialConfig({
@@ -469,7 +480,7 @@ function CreativeModal(props: Props) {
                                             <p>
                                                 {
                                                     materialConfig?.list[0] ? <video src={materialConfig?.list[0].url} controls /> : <>
-                                                        <span>{`推荐尺寸(${item.restriction.videoRestriction.minWidth} x ${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>
                                                     </>
                                                 }