wjx 1 anno fa
parent
commit
ab4473cace

+ 21 - 3
src/pages/launchSystemNew/launchManage/createAd/ad/modal/leadAd.tsx

@@ -197,6 +197,14 @@ function LeadAdModal(props: Props) {
     useEffect(() => {
         sceneTagsList.run({ typeList: ['WECHAT_POSITION', 'OFFICIAL_ACCOUNT_MEDIA_CATEGORY', 'MINI_PROGRAM_AND_MINI_GAME', 'PAY_SCENE'] })
     }, [])
+    useEffect(() => {
+        if (depthConversionEnabled) {
+            form.setFieldsValue({
+                optimizationMode: 'DEEP_CONVERSION_TARGET',
+                deepConversionType: behaviorList?.length > 0 ? 'DEEP_CONVERSION_BEHAVIOR' : worthList?.length > 0 ? 'DEEP_CONVERSION_WORTH' : ''
+            })
+        }
+    }, [depthConversionEnabled, behaviorList, worthList])
     // 数据回填
     useEffect(() => {
         if (dataInfo) {
@@ -603,9 +611,19 @@ function LeadAdModal(props: Props) {
             {
                 (bidMode === 'BID_MODE_OCPM' || bidMode === 'BID_MODE_OCPC') && <>
                     <Form.Item label={<strong>优化目标</strong>} name='optimizationGoal' rules={[{ required: true, message: '请选择优化目标' }]}>
-                        <Select style={{ width: 300 }} showSearch filterOption={(input, option) =>
-                            (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
-                        } allowClear>
+                        <Select
+                            style={{ width: 300 }}
+                            showSearch
+                            filterOption={(input, option) =>
+                                (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
+                            }
+                            onChange={(e) => {
+                                if (e === 'OPTIMIZATIONGOAL_PAGE_SCAN_CODE') {
+                                    form.setFieldsValue({ depthConversionEnabled: true })
+                                }
+                            }}
+                            allowClear
+                        >
                             {
                                 // Object.keys(OptimizationGoalEnum).map(key => {
                                 //     return <Select.Option value={key} key={key}>{OptimizationGoalEnum[key]}</Select.Option>

+ 23 - 8
src/pages/launchSystemNew/launchManage/createAd/ad/modal/wechat.tsx

@@ -177,6 +177,14 @@ function WeChatAdModal(props: Props) {
     useEffect(() => {
         sceneTagsList.run({ typeList: ['WECHAT_POSITION', 'OFFICIAL_ACCOUNT_MEDIA_CATEGORY', 'MINI_PROGRAM_AND_MINI_GAME', 'PAY_SCENE'] })
     }, [])
+    useEffect(() => {
+        if (depthConversionEnabled) {
+            form.setFieldsValue({
+                optimizationMode: 'DEEP_CONVERSION_TARGET',
+                deepConversionType: behaviorList?.length > 0 ? 'DEEP_CONVERSION_BEHAVIOR' : worthList?.length > 0 ? 'DEEP_CONVERSION_WORTH' : ''
+            })
+        }
+    }, [depthConversionEnabled, behaviorList, worthList])
     // 数据回填
     useEffect(() => {
         if (dataInfo) {
@@ -582,14 +590,21 @@ function WeChatAdModal(props: Props) {
             {
                 bidMode === 'BID_MODE_OCPM' && <>
                     <Form.Item label={<strong>优化目标</strong>} name='optimizationGoal' rules={[{ required: true, message: '请选择优化目标' }]}>
-                        <Select style={{ width: 300 }} showSearch filterOption={(input, option) =>
-                            (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
-                        } allowClear>
-                            {
-                                Object.keys(OptimizationGoalEnum).map(key => {
-                                    return <Select.Option value={key} key={key}>{OptimizationGoalEnum[key]}</Select.Option>
-                                })
-                            }
+                        <Select
+                            style={{ width: 300 }}
+                            onChange={(e) => {
+                                if (e === 'OPTIMIZATIONGOAL_FOLLOW') {
+                                    form.setFieldsValue({ depthConversionEnabled: true })
+                                }
+                            }}
+                            showSearch
+                            filterOption={(input, option) =>
+                                (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
+                            } allowClear
+                        >
+                            {Object.keys(OptimizationGoalEnum).map(key => {
+                                return <Select.Option value={key} key={key}>{OptimizationGoalEnum[key]}</Select.Option>
+                            })}
                         </Select>
                     </Form.Item>
                     <Form.Item label={<strong>出价类型</strong>} name='smartBidType' rules={[{ required: true, message: '请选择出价类型' }]}>

+ 18 - 4
src/pages/launchSystemNew/launchManage/createAd/index.tsx

@@ -6,7 +6,7 @@ import { PromotedObjectType } from "@/services/launchAdq/enum"
 import { getTagsList, get_adcreative_template } from "@/services/launchAdq/global"
 import { getSysAdgroupsInfo } from "@/services/launchAdq/localAd"
 import { getsysTargetingInfo } from "@/services/launchAdq/targeting"
-import { CheckOutlined, CloseOutlined, SearchOutlined } from "@ant-design/icons"
+import { CheckOutlined, CloseOutlined, ExclamationCircleFilled, SearchOutlined } from "@ant-design/icons"
 import { Button, Card, Col, Empty, Row, Select, Space, Spin, Tooltip, Image, message, Tabs, Popconfirm, notification, Divider, Checkbox, Modal, Tag } from "antd"
 import React, { useCallback, useEffect, useState } from "react"
 import { useModel } from "umi"
@@ -585,7 +585,21 @@ const CreateAd: React.FC = () => {
                 data.push(obj)
             })
         })
-        setTableData(data)
+        if (['OPTIMIZATIONGOAL_FOLLOW', 'OPTIMIZATIONGOAL_PAGE_SCAN_CODE'].includes(newQueryForm.sysAdgroup.optimizationGoal) && !newQueryForm.sysAdgroup.depthConversionEnabled) {
+            Modal.confirm({
+                title: '请注意',
+                icon: <ExclamationCircleFilled />,
+                content: '深度优化出价未开启,是否继续提交广告?',
+                onOk() {
+                    setTableData(data)
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
+        } else {
+            setTableData(data)
+        } 
     }
 
     const submit = (props: { campaignName: string, count?: number }) => {
@@ -977,7 +991,7 @@ const CreateAd: React.FC = () => {
                                             }
                                         }
                                         setQueryForm({ ...queryForm, adqPageList: [], pageList: [], taskMediaMaps: queryForm?.taskMediaMaps?.map((item: { sysPageId: number }) => ({ ...item, sysPageId: '', accountPageIdMap: {}, cropUserGroupMap: [] })) })
-                                        setAccountCreateLogs(data?.map((item: any) => ({ adAccountId: item?.accountId, id: item?.adAccountId })))
+                                        setAccountCreateLogs(data?.map((item: any) => ({ adAccountId: item?.accountId, id: item?.accountId })))
                                         clearData()
                                     }}>全选</Checkbox>
                                 </Space>
@@ -1217,7 +1231,7 @@ const CreateAd: React.FC = () => {
                                                                             {item?.topSliderSpec?.imageUrlList?.map((url: string, index: number) => <Image width={70} src={url} style={{ borderRadius: 8 }} key={'TOP_SLIDER' + index} />)}
                                                                         </Space>
                                                                     case 'TOP_VIDEO':
-                                                                        return <VideoNews src={item?.topVideoSpec?.videoUrl}/>
+                                                                        return <VideoNews src={item?.topVideoSpec?.videoUrl} />
                                                                 }
                                                             })}</div>
                                                         </div>