|
@@ -8,9 +8,8 @@ import { QuestionCircleFilled } from "@ant-design/icons";
|
|
|
import { txtLength } from "@/utils/utils";
|
|
|
import TextAideInput from "@/pages/launchSystemV3/components/TextAideInput";
|
|
|
import styles from '../Material/index.less'
|
|
|
-import { useModel } from "umi";
|
|
|
-import SelectCloud from "@/pages/launchSystemNew/components/selectCloud";
|
|
|
import SelectLabel from "./SelectLable"
|
|
|
+import SelectCloudNew from "@/pages/launchSystemV3/material/cloudNew/selectCloudNew";
|
|
|
|
|
|
/**
|
|
|
* 营销组件
|
|
@@ -34,7 +33,6 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
const creativeTemplateId = Form.useWatch('creativeTemplateId', form)
|
|
|
const cardType: string[] = Form.useWatch('cardType', form)
|
|
|
const [cardData, setCardData] = useState<{ label: string, value: string, disabled?: boolean }[]>([])
|
|
|
- const { init } = useModel('useLaunchAdq.useBdMediaPup')
|
|
|
const [materialConfig, setMaterialConfig] = useState<{
|
|
|
adcreativeTemplateId?: number,
|
|
|
type: string,
|
|
@@ -52,6 +50,18 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
max: 1,//素材数量
|
|
|
sliderImgContent: undefined
|
|
|
})//图片素材配置
|
|
|
+ const [selectCloudData, setSelectCloudData] = useState<{
|
|
|
+ defaultParams: {
|
|
|
+ sizeQueries?: {
|
|
|
+ width: number,
|
|
|
+ height: number,
|
|
|
+ relation: string
|
|
|
+ }[],
|
|
|
+ materialType: 'image' | 'video'
|
|
|
+ fileSize: number
|
|
|
+ }
|
|
|
+ num: number
|
|
|
+ }>()
|
|
|
const [selectVideoVisible, setSelectVideoVisible] = useState(false)
|
|
|
/**************************************/
|
|
|
|
|
@@ -260,7 +270,7 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
const list = label.children.list
|
|
|
|
|
|
return <Form.Item name={'creativeLabelDTOS'} style={{ marginTop: 16, marginBottom: 0 }} label={<strong> 标签{label.required ? '' : '(选填)'}</strong>}>
|
|
|
- <SelectLabel arrayProperty={list.arrayProperty}/>
|
|
|
+ <SelectLabel arrayProperty={list.arrayProperty} />
|
|
|
</Form.Item>
|
|
|
}
|
|
|
return null
|
|
@@ -400,7 +410,7 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
name={['floatingZone', 'value', 'image']}
|
|
|
>
|
|
|
<div className={`${styles.box} ${styles.image}`} style={{ width: 300, height: 160 }} onClick={() => {
|
|
|
- init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: floating_zone_image_id.restriction.imageRestriction.width, height: floating_zone_image_id.restriction.imageRestriction.height }]], maxSize: floating_zone_image_id.restriction.imageRestriction.fileSize * 1024 })
|
|
|
+ setSelectCloudData({ defaultParams: { sizeQueries: [{ relation: '=', width: floating_zone_image_id.restriction.imageRestriction.width, height: floating_zone_image_id.restriction.imageRestriction.height }], fileSize: floating_zone_image_id.restriction.imageRestriction.fileSize * 1024, materialType: 'image' }, num: 1 })
|
|
|
setMaterialConfig({
|
|
|
...materialConfig,
|
|
|
type: 'floatingZoneImage',
|
|
@@ -441,7 +451,7 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
}]}
|
|
|
style={{ marginBottom: 0 }}
|
|
|
>
|
|
|
- <TextAideInput isShowAjax={false} placeholder={'请输入' + floating_zone_name.description} style={{ width: 480 }} maxTextLength={floating_zone_name.restriction.textRestriction.maxLength} />
|
|
|
+ <TextAideInput isShowAjax={false} isSelectEmoji={false} placeholder={'请输入' + floating_zone_name.description} style={{ width: 480 }} maxTextLength={floating_zone_name.restriction.textRestriction.maxLength} />
|
|
|
</Form.Item>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -464,7 +474,7 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
}]}
|
|
|
style={{ marginBottom: 0 }}
|
|
|
>
|
|
|
- <TextAideInput isShowAjax={false} placeholder={'请输入' + floating_zone_desc.description} style={{ width: 480 }} maxTextLength={floating_zone_desc.restriction.textRestriction.maxLength} />
|
|
|
+ <TextAideInput isShowAjax={false} isSelectEmoji={false} placeholder={'请输入' + floating_zone_desc.description} style={{ width: 480 }} maxTextLength={floating_zone_desc.restriction.textRestriction.maxLength} />
|
|
|
</Form.Item>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -498,7 +508,7 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
name={['floatingZone', 'value', 'image']}
|
|
|
>
|
|
|
<div className={`${styles.box} ${styles.image}`} style={{ width: 300, height: 160 }} onClick={() => {
|
|
|
- init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: floating_zone_single_image_id.restriction.imageRestriction.width, height: floating_zone_single_image_id.restriction.imageRestriction.height }]], maxSize: floating_zone_single_image_id.restriction.imageRestriction.fileSize * 1024 })
|
|
|
+ setSelectCloudData({ defaultParams: { sizeQueries: [{ relation: '=', width: floating_zone_single_image_id.restriction.imageRestriction.width, height: floating_zone_single_image_id.restriction.imageRestriction.height }], fileSize: floating_zone_single_image_id.restriction.imageRestriction.fileSize * 1024, materialType: 'image' }, num: 1 })
|
|
|
setMaterialConfig({
|
|
|
...materialConfig,
|
|
|
type: 'floatingZoneSingleImage',
|
|
@@ -604,10 +614,14 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
{floatingZoneContent}
|
|
|
|
|
|
{/* 选择视频素材 */}
|
|
|
- {selectVideoVisible && <SelectCloud
|
|
|
+ {(selectVideoVisible && selectCloudData) && <SelectCloudNew
|
|
|
+ {...selectCloudData}
|
|
|
visible={selectVideoVisible}
|
|
|
- onClose={() => setSelectVideoVisible(false)}
|
|
|
- sliderImgContent={materialConfig.type === 'floatingZoneSingleImage' ? image?.floatingZoneSingleImageUrl ? [{ url: image.floatingZoneSingleImageUrl }] : undefined : image?.floatingZoneImageUrl ? [{ url: image.floatingZoneImageUrl }] : undefined}
|
|
|
+ onClose={() => {
|
|
|
+ setSelectVideoVisible(false)
|
|
|
+ setSelectCloudData(undefined)
|
|
|
+ }}
|
|
|
+ sliderImgContent={materialConfig.type === 'floatingZoneSingleImage' ? image?.floatingZoneSingleImageUrl ? [{ oss_url: image.floatingZoneSingleImageUrl, id: image.floatingZoneSingleImageId }] : undefined : image?.floatingZoneImageUrl ? [{ oss_url: image.floatingZoneImageUrl, id: image.floatingZoneImageId }] : undefined}
|
|
|
onChange={(content: any) => {
|
|
|
if (content.length > 0) {
|
|
|
if (materialConfig.type === 'floatingZoneSingleImage') {
|
|
@@ -616,7 +630,7 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
...floatingZone,
|
|
|
value: {
|
|
|
...floatingZone?.value,
|
|
|
- image: { floatingZoneSingleImageId: content[0]?.id, floatingZoneSingleImageUrl: content[0]?.url, floatingZoneSingleImageMaterialType: 0 }
|
|
|
+ image: { floatingZoneSingleImageId: content[0]?.id, floatingZoneSingleImageUrl: content[0]?.oss_url, floatingZoneSingleImageMaterialType: 0 }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -626,7 +640,7 @@ const CreativeConversionAssistant: React.FC<{ automaticSiteEnabled?: boolean }>
|
|
|
...floatingZone,
|
|
|
value: {
|
|
|
...floatingZone?.value,
|
|
|
- image: { floatingZoneImageId: content[0]?.id, floatingZoneImageUrl: content[0]?.url, floatingZoneImageMaterialType: 0 }
|
|
|
+ image: { floatingZoneImageId: content[0]?.id, floatingZoneImageUrl: content[0]?.oss_url, floatingZoneImageMaterialType: 0 }
|
|
|
}
|
|
|
}
|
|
|
})
|