wjx преди 8 месеца
родител
ревизия
0868c701c2

+ 5 - 1
src/pages/launchSystemV3/components/ConversionSelect/index.tsx

@@ -53,7 +53,11 @@ const ConversionSelect: React.FC<Props> = (props) => {
     }
 
     const handleOk = () => {
-        onChange && onChange(data)
+        if (data.every(item => item?.newConversionList?.length)) {
+            onChange && onChange(data)
+        } else {
+            message.error('请完善所有账号转化归因')
+        }
     }
 
     /** 设置选中广告主 */

+ 5 - 1
src/pages/launchSystemV3/components/GoodsModal/index.tsx

@@ -58,7 +58,11 @@ const GoodsModal: React.FC<Props> = (props) => {
     }
 
     const handleOk = () => {
-        onChange && onChange(data)
+        if (data.every(item => item?.productList?.length)) {
+            onChange && onChange(data)
+        } else {
+            message.error('请完善所有账号产品')
+        }
     }
 
     // 同步小说

+ 5 - 1
src/pages/launchSystemV3/components/VideoChannel/index.tsx

@@ -45,7 +45,11 @@ const VideoChannel: React.FC<Props> = (props) => {
     }
 
     const handleOk = () => {
-        onChange && onChange(data)
+        if (data.every(item => item?.videoChannelList?.length)) {
+            onChange && onChange(data)
+        } else {
+            message.error('请完善所有账号视频号')
+        }
     }
 
     /** 设置选中广告主 */

+ 5 - 1
src/pages/launchSystemV3/components/WechatAccount/index.tsx

@@ -45,7 +45,11 @@ const WechatAccount: React.FC<Props> = (props) => {
     }
 
     const handleOk = () => {
-        onChange && onChange(data)
+        if (data.every(item => item?.wechatChannelList?.length)) {
+            onChange && onChange(data)
+        } else {
+            message.error('请完善所有账号公众号')
+        }
     }
 
     /** 设置选中广告主 */

+ 6 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/Dynamic/creativeTemplateContent.tsx

@@ -18,6 +18,7 @@ const CreativeTemplateContent: React.FC<{ automaticSiteEnabled: boolean }> = ({
     const pageType = Form.useWatch(['jumpInfo', 'pageType'], form)
     const pageSpec = Form.useWatch('pageSpec', form)
     const deliveryMode = Form.useWatch('deliveryMode', form)
+    const creativeTemplateId = Form.useWatch('creativeTemplateId', form)
     const linkNameTypeOld = Form.useWatch(['textLink', 'value', 'linkNameType'], form)
     const buttonTextOld = Form.useWatch(['actionButton', 'value', 'buttonText'], form)
     /******************************************/
@@ -43,6 +44,10 @@ const CreativeTemplateContent: React.FC<{ automaticSiteEnabled: boolean }> = ({
                     break
             }
         })
+        
+        if (!pageTypeList.some(item => item.value === "PAGE_TYPE_OFFICIAL") && creativeTemplateId !== 910) {
+            pageTypeList.push({ label: "灵鹊落地页", value: "PAGE_TYPE_OFFICIAL", disabled: false })
+        }
 
         return <>
             {brand && <Form.Item style={{ marginBottom: 0 }}>
@@ -160,7 +165,7 @@ const CreativeTemplateContent: React.FC<{ automaticSiteEnabled: boolean }> = ({
 
 
         </>
-    }, [creativeComponents, pageType, pageSpec, siteSet])
+    }, [creativeComponents, pageType, pageSpec, siteSet, creativeTemplateId])
 
     return <Card
         title={<strong style={{ fontSize: 18 }}>创意内容</strong>}

+ 0 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/Dynamic/index.tsx

@@ -7,7 +7,6 @@ import NewDynamic from "./newDynamic"
 import { AD_STATUS_ENUM, CONVERSION_DATA_ENUM, CONVERSION_TARGET_ENUM, DELIVERY_MODE_ENUM, FLOATING_ZONE_TYPE_ENUM, PAGE_TYPE_ENUM, TEXT_LINK_TYPE_ENUM } from "../../const"
 import { getProfilesApi } from "@/services/adqV3/global"
 import { useAjax } from "@/Hook/useAjax"
-import { arraysHaveSameValues } from "@/utils/utils"
 
 /**
  * 创意

+ 0 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/Dynamic/newDynamic.tsx

@@ -445,7 +445,6 @@ const NewDynamic: React.FC<Props> = ({ value: newValue, visible, onClose, onChan
         if (!isJustEntered) {
             return
         }
-        console.log('1111')
         setIsJustEntered(() => false)
         // if (value && Object.keys(value).length > 0 && adcreativeTemplateList?.length > 0 && ((value.deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' && oldCreativeTemplateStyle) || value.deliveryMode === 'DELIVERY_MODE_COMPONENT')) {
         if (value && Object.keys(value).length > 0 && ((value.deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' && oldCreativeTemplateStyle) || value.deliveryMode === 'DELIVERY_MODE_COMPONENT')) {

+ 56 - 3
src/pages/launchSystemV3/tencentAdPutIn/create/addDynamic.tsx

@@ -9,12 +9,13 @@ import PageList from "./PageList";
 import { DispatchAddelivery } from ".";
 import { CheckOutlined, SearchOutlined } from "@ant-design/icons";
 import WechatAccount from "../../components/WechatAccount";
-import { cartesianProduct, distributeArray, splitArrayIntoRandomChunks } from "@/utils/utils";
+import { cartesianProduct, distributeArray, processData, splitArrayIntoRandomChunks } from "@/utils/utils";
 import { columnsAddDynamic } from "./tableConfig";
 import { useAjax } from "@/Hook/useAjax";
 import { createDynamicTaskApi } from "@/services/adqV3";
 import TacticsS from "./TacticsS";
 import VideoChannel from "../../components/VideoChannel";
+import { getCreativeDetailsApi } from "@/services/adqV3/global";
 const { Text, Title } = Typography;
 
 /**
@@ -26,6 +27,8 @@ const AddDynamic: React.FC<PULLIN.NewAddDynamic> = ({ visible, onChange, onClose
     /****************************************/
     const [addelivery, setAddelivery] = useState<PULLIN.AddeliveryProps>({ adgroups: {}, targeting: [], dynamic: {}, dynamicMaterialDTos: {}, dynamicCreativesTextDTOS: {}, mediaType: 0 })
     const { adgroups, dynamic } = addelivery
+    const { marketingAssetOuterSpec, marketingCarrierType, marketingGoal, siteSet, automaticSiteEnabled, sceneSpec } = addelivery.adgroups
+    const { deliveryMode, creativeTemplateId } = addelivery.dynamic
     const [wechatVisible, setWechatVisible] = useState<boolean>(false) // 选择微信公众号弹窗控制
     const [channelsProfileVisible, setChannelsProfileVisible] = useState<boolean>(false) // 选择微信公众号弹窗控制
     const [materialData, setMaterialData] = useState<any>({}) // 素材数据
@@ -36,9 +39,56 @@ const AddDynamic: React.FC<PULLIN.NewAddDynamic> = ({ visible, onChange, onClose
     const [dynamicCount, setDynamicCount] = useState<number>(0)
     const [adData, setAdData] = useState<any[]>(selectData)
     const [adDataGroup, setAdDataGroup] = useState<{ [x: number]: any[] }>({})
+    const [creativeTemplateAppellation, setCreativeTemplateAppellation] = useState<string>()
+    const [creativeTemplateStyle, setCreativeTemplateStyle] = useState<string>()
+    const getCreativeDetails = useAjax((params) => getCreativeDetailsApi(params))
 
     const createDynamicTask = useAjax((params) => createDynamicTaskApi(params))
     /****************************************/
+    
+    useEffect(() => {
+        if (creativeTemplateId) {
+            let params: any = {
+                marketingGoal,
+                marketingTargetType: marketingAssetOuterSpec.marketingTargetType,
+                marketingCarrierType,
+                deliveryMode,
+                creativeTemplateId,
+                wechatSceneSpecPosition: sceneSpec?.wechatPosition,
+                dynamicCreativeType: deliveryMode === 'DELIVERY_MODE_COMPONENT' ? 'DYNAMIC_CREATIVE_TYPE_PROGRAM' : 'DYNAMIC_CREATIVE_TYPE_COMMON'
+            }
+            if (automaticSiteEnabled) {
+                params.automaticSiteEnabled = automaticSiteEnabled
+            } else {
+                params.siteSet = siteSet
+            }
+            getCreativeDetails.run(params).then(res => {
+                if (res?.adcreativeTemplateStructAdpermits?.length > 0) {
+                    let adcreativeTemplateStructAdpermits = res?.adcreativeTemplateStructAdpermits[0]
+                    setCreativeTemplateAppellation(adcreativeTemplateStructAdpermits.creativeTemplateAppellation)
+                    setCreativeTemplateStyle(adcreativeTemplateStructAdpermits.creativeTemplateStyle)
+
+                    let creativeComponents = adcreativeTemplateStructAdpermits?.creativeComponents || []
+                    let result = processData(creativeComponents);
+
+                    let newMaterialData: any = {};
+                    let newTextData: any = {};
+
+                    Object.keys(result).forEach(key => {
+                        let data = result[key]
+                        if ((key === 'image_list' || key === 'short_video' || key === 'video' || key === 'image' || key === 'element_story') && data.required) {
+                            newMaterialData[key] = data
+                        } else if (key === 'title' || (data.required && key === 'description')) {
+                            newTextData[key] = data
+                        }
+                    })
+
+                    setMaterialData(newMaterialData)
+                    setTextData(newTextData)
+                }
+            })
+        }
+    }, [creativeTemplateId, deliveryMode, marketingGoal, marketingAssetOuterSpec, marketingCarrierType, siteSet, sceneSpec?.wechatPosition, automaticSiteEnabled])
 
     useEffect(() => {
         if (adData && adData.length) {
@@ -465,7 +515,7 @@ const AddDynamic: React.FC<PULLIN.NewAddDynamic> = ({ visible, onChange, onClose
             if (wechatChannelList && (['MARKETING_TARGET_TYPE_WECHAT_OFFICIAL_ACCOUNT'].includes(adgroups?.marketingAssetOuterSpec?.marketingTargetType) || adgroups?.marketingCarrierType === 'MARKETING_CARRIER_TYPE_WECHAT_OFFICIAL_ACCOUNT')) {
                 map.wechatChannelId = wechatChannelList?.[0]?.wechatOfficialAccountId
             }
-            
+
             if (videoChannelList && dynamic?.creativeComponents?.brand?.[0]?.value?.jumpInfo?.pageType === 'PAGE_TYPE_WECHAT_CHANNELS_PROFILE') {
                 map.videoChannelId = videoChannelList?.[0]?.wechatChannelsAccountId
             }
@@ -553,7 +603,10 @@ const AddDynamic: React.FC<PULLIN.NewAddDynamic> = ({ visible, onChange, onClose
                                         </div>
                                     </div>
                                     {/* 创意 */}
-                                    <Dynamic />
+                                    <Dynamic 
+                                        creativeTemplateAppellation={creativeTemplateAppellation}
+                                        creativeTemplateStyle={creativeTemplateStyle}
+                                    />
                                     {/* 创意素材 */}
                                     <Material adData={adData} />
                                 </div>

+ 1 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/index.tsx

@@ -870,7 +870,7 @@ const Create: React.FC = () => {
                         {(marketingAssetOuterSpec?.marketingTargetType === 'MARKETING_TARGET_TYPE_WECHAT_OFFICIAL_ACCOUNT' || marketingCarrierType === 'MARKETING_CARRIER_TYPE_WECHAT_OFFICIAL_ACCOUNT' || creativeComponents?.brand?.[0]?.value?.jumpInfo?.pageType === 'PAGE_TYPE_WECHAT_OFFICIAL_ACCOUNT_DETAIL') && <Button type="primary" danger={!accountCreateLogs?.some(item => item?.wechatChannelList?.length)} onClick={() => { setWechatVisible(true) }}>{accountCreateLogs?.some(item => item?.wechatChannelList?.length) ? <>重新选择公众号 <CheckOutlined style={{ color: '#FFFFFF' }} /></> : '请选择公众号'}</Button>}
                         {creativeComponents?.brand?.[0]?.value?.jumpInfo?.pageType === 'PAGE_TYPE_WECHAT_CHANNELS_PROFILE' && <Button type="primary" danger={!accountCreateLogs?.some(item => item?.videoChannelList?.length)} onClick={() => { setChannelsProfileVisible(true) }}>{accountCreateLogs?.some(item => item?.videoChannelList?.length) ? <>重新选择视频号 <CheckOutlined style={{ color: '#FFFFFF' }} /></> : '请选择视频号'}</Button>}
                         {!isConversion ?
-                            <Button onClick={() => { setSourceVisible(true) }}>精准匹配归因(选填){accountCreateLogs?.some(item => item?.userActionSetsList?.length) && <CheckOutlined style={{ color: '#1890ff' }} />}</Button>
+                            <Button onClick={() => { setSourceVisible(true) }}>精准匹配归因(选填){accountCreateLogs?.some(item => item?.userActionSetsList?.length) && <CheckOutlined style={{ color: accountCreateLogs?.every(item => item?.userActionSetsList?.length) ? '#1890ff' : '#52C41A' }} />}</Button>
                             :
                             <Button type="primary" danger={!accountCreateLogs?.some(item => item?.newConversionList?.length)} onClick={() => { setConversionVisible(true) }}>{accountCreateLogs?.some(item => item?.newConversionList?.length) ? <>重新选择转化归因<CheckOutlined style={{ color: '#FFF' }} /></> : '请选择转化归因'}</Button>
                         }