wjx 1 ano atrás
pai
commit
b285ac4cdd

+ 1 - 1
src/pages/launchSystemNew/launchManage/createAd/creativeCL/index.tsx

@@ -126,7 +126,7 @@ const CreativeCL: React.FC<Props> = (props) => {
             </div>
             {!(queryForm?.materialData && queryForm?.materialData?.length > 0) && <div className={style.noMaterial}>无需配置素材</div>}
         </Col>
-        <Col className={style.conRightBorder} style={{ maxWidth: '25%' }}>
+        <Col className={style.conRightBorder} style={{/* maxWidth: '25%' */}}>
             <div className={style.top}>
                 <strong style={{ fontSize: 15 }}>创意文案</strong>
                 <span>已选:{queryForm?.texts?.length || 0}</span>

+ 22 - 6
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, ExclamationCircleFilled, SearchOutlined } from "@ant-design/icons"
+import { CheckOutlined, CloseOutlined, ExclamationCircleFilled, QuestionCircleOutlined, SearchOutlined } from "@ant-design/icons"
 import { Button, Card, Col, Empty, Row, Select, Space, Spin, Tooltip, Image, message, Tabs, notification, Divider, Checkbox, Modal, Tag } from "antd"
 import React, { useCallback, useEffect, useState } from "react"
 import { useModel } from "umi"
@@ -32,6 +32,7 @@ import { getAccountListApi, getGroupListApi } from "@/services/launchAdq/subgrou
 import TacticsS from "./tacticsS"
 import UserTactics from "./tacticsS/userTactics"
 import VideoNews from "../../components/newsModal/videoNews"
+import { putPromotedObjectSync } from "@/services/launchAdq/adq"
 
 const CreateAd: React.FC = () => {
     /*************************/
@@ -82,6 +83,7 @@ const CreateAd: React.FC = () => {
     const getTaskDetails = useAjax((params) => getTaskDetailsApi(params))
     const getAdcreativeTemplate = useAjax((params) => get_adcreative_template(params))
     const getGroupList = useAjax(() => getGroupListApi())
+    const syncAjax = useAjax((adAccountId) => putPromotedObjectSync(adAccountId))
     /*************************/
     useEffect(() => {
         getGroupList.run()
@@ -931,11 +933,17 @@ const CreateAd: React.FC = () => {
         }
     }
 
+    const synTgmb = () => {
+        syncAjax.run({ accountIdList: accountCreateLogs.map(item => item.id) }).then(res => {
+            res ? message.success('同步成功!') : message.error('同步失败!')
+        })
+    }
+
     return <Space direction="vertical" style={{ width: '100%' }}>
+        <h3 style={{ textAlign: 'center', color: 'red', marginBottom: 0 }}>请注意:除了普通模式选择创意模板,叉乘模式和顺序模式都属于新建创意,腾讯规定每个广告账户每天新建创意限制20条。</h3>
         <Card
             title={
                 <div>
-                    <h3 style={{textAlign:'center',color:'red'}}>请注意:除了普通模式选择创意模板,叉乘模式和顺序模式都属于新建创意,腾讯规定每个广告账户每天新建创意限制20条。</h3>
                     <Space>
                         <div className={style.cardTitle}>配置区</div>
                         <Select
@@ -972,7 +980,15 @@ const CreateAd: React.FC = () => {
             }
             className={style.createAd}
             hoverable
-            extra={<UserTactics setQueryForm={setQueryForm} setAccountCreateLogs={setAccountCreateLogs} setLaunchMode={setLaunchMode} />}
+            extra={<Space>
+                {accountCreateLogs?.length > 0 && <Button loading={syncAjax.loading} onClick={synTgmb}>
+                    同步推广目标
+                    <Tooltip title="近期账号更改推广目标(比如以前推广公众,现在投企微),选择媒体账号后同步">
+                        <QuestionCircleOutlined />
+                    </Tooltip>
+                </Button>}
+                <UserTactics setQueryForm={setQueryForm} setAccountCreateLogs={setAccountCreateLogs} setLaunchMode={setLaunchMode} />
+            </Space>}
         >
             <Space wrap>
                 <Selector label="媒体账户组">
@@ -1260,8 +1276,8 @@ const CreateAd: React.FC = () => {
                         <Row className={style.items}>
                             {/* 创意 */}
                             <CreativeCL queryForm={queryForm} setQueryForm={setQueryForm} clearData={clearData} getSysAdcreative={getSysAdcreative} targetKey={targetKey} />
-                            {/* 落地页 */}
-                            <Col className={style.conRightBorder} style={{ maxWidth: '25%', border: 'none' }}>
+                            {/* 落地页 maxWidth: '25%', */}
+                            <Col className={style.conRightBorder} style={{ border: 'none' }}>
                                 <div className={style.top}>
                                     落地页
                                     {(queryForm?.taskMediaMaps && queryForm?.taskMediaMaps[targetKey]?.cropUserGroupMap?.length > 0) && <CustomerServiceModal data={queryForm?.taskMediaMaps[targetKey]?.cropUserGroupMap} onChange={(data) => {
@@ -1340,7 +1356,7 @@ const CreateAd: React.FC = () => {
 
                 </Row>
                 {/* =============广告底部按钮=========== */}
-                <Space className={style.bts}>
+                <Space className={style.bts} wrap>
                     <TacticsS queryForm={queryForm} accountCreateLogs={accountCreateLogs} launchMode={launchMode} />
                     <Button type='primary' onClick={severBd}>存为预设</Button>
                     <Button type='primary' onClick={preview}><SearchOutlined /> 批量预览广告</Button>