shenwu 2 år sedan
förälder
incheckning
c9388d2540
24 ändrade filer med 175 tillägg och 78 borttagningar
  1. 2 2
      config/config.prod.ts
  2. 1 1
      src/pages/launchSystem/launchManage/components/authLogin/index.tsx
  3. 1 1
      src/pages/launchSystem/launchManage/weChat/components/createPlan/components/AdOriginality/components/ClerkAide/index.tsx
  4. 1 1
      src/pages/launchSystem/launchManageNew/weChatNew/components/createPlan/components/AdOriginality/components/ClerkAide/index.tsx
  5. 1 1
      src/pages/launchSystem/materialManage/adMaterial/components/addCom/index.tsx
  6. 1 1
      src/pages/launchSystem/materialManage/adMaterial/index.tsx
  7. 1 1
      src/pages/launchSystem/materialManage/adOriginality/components/addOriginality/index.tsx
  8. 1 1
      src/pages/launchSystem/materialManage/adOriginality/index.tsx
  9. 1 1
      src/pages/launchSystem/materialManage/adTitle/components/addTitle/index.tsx
  10. 1 1
      src/pages/launchSystem/materialManage/adTitle/index.tsx
  11. 1 1
      src/pages/launchSystem/materialManage/tagManage/index.tsx
  12. 1 1
      src/pages/launchSystem/materialManageBd/adMaterial/components/addCom/index.tsx
  13. 1 1
      src/pages/launchSystem/materialManageBd/adMaterial/index.tsx
  14. 1 1
      src/pages/launchSystem/materialManageBd/adOriginality/components/addOriginality/index.tsx
  15. 1 1
      src/pages/launchSystem/materialManageBd/adOriginality/index.tsx
  16. 1 1
      src/pages/launchSystem/materialManageBd/adTitle/components/addTitle/index.tsx
  17. 1 1
      src/pages/launchSystem/materialManageBd/adTitle/index.tsx
  18. 1 1
      src/pages/launchSystem/materialManageBd/tagManage/index.tsx
  19. 5 2
      src/pages/launchSystemNew/launchManage/createAd/creative/index.tsx
  20. 105 47
      src/pages/launchSystemNew/launchManage/createAd/creative/modal/index.tsx
  21. 41 5
      src/pages/launchSystemNew/launchManage/createAd/index.tsx
  22. 1 1
      src/pages/launchSystemNew/launchManage/localAd/creative/modal.tsx
  23. 2 2
      src/pages/launchSystemNew/launchManage/taskList/logTableConfig.tsx
  24. 2 2
      src/services/api.ts

+ 2 - 2
config/config.prod.ts

@@ -4,6 +4,8 @@ const assetDir = "static"
 export default defineConfig({
   history: { type: 'hash' }, // 默认是 browse
   // devtool: 'source-map',//正式坏境查看报错使用,假如正式版稳定请关闭
+   // map关闭
+   devtool: false,
   //新增
   nodeModulesTransform: {
     type: 'none',
@@ -116,8 +118,6 @@ export default defineConfig({
       drop_console: true,
     },
   },
-  // map关闭
-  devtool: false,
   //替换压缩器为 esbuild
   esbuild: {},
   // 不打包组件使用cdn

+ 1 - 1
src/pages/launchSystem/launchManage/components/authLogin/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from "@/.umi/plugin-model/useModel";
+import { useModel } from "umi";
 import { setCookie } from "@/utils/cry";
 import { Modal, Image, message } from "antd";
 import React, { useCallback, useEffect, useState } from "react";

+ 1 - 1
src/pages/launchSystem/launchManage/weChat/components/createPlan/components/AdOriginality/components/ClerkAide/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from "@/.umi/plugin-model/useModel";
+import { useModel } from "umi";
 import Tables from "@/components/Tables";
 import columns from './tableConfig'
 import { DatePicker, Input, Modal, Select, Space } from "antd";

+ 1 - 1
src/pages/launchSystem/launchManageNew/weChatNew/components/createPlan/components/AdOriginality/components/ClerkAide/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from "@/.umi/plugin-model/useModel";
+import { useModel } from "umi";
 import Tables from "@/components/Tables";
 import columns from './tableConfig'
 import { DatePicker, Input, Modal, Select, Space } from "antd";

+ 1 - 1
src/pages/launchSystem/materialManage/adMaterial/components/addCom/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { Modal, Button, Form, Select, message, Space, Image as AntImg, Upload } from 'antd'
 import { SelectValue } from 'antd/es/select'
 import Cropprt from '@/components/Cropper'

+ 1 - 1
src/pages/launchSystem/materialManage/adMaterial/index.tsx

@@ -5,7 +5,7 @@ import './index1.less'
 import moment from 'moment'
 import AddCom from './components/addCom'
 import { SelectValue } from 'antd/es/select'
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { CheckboxValueType } from 'antd/es/checkbox/Group'
 import { CheckboxChangeEvent } from 'antd/es/checkbox'
 import ImgPreview from '@/components/ImgPreview'

+ 1 - 1
src/pages/launchSystem/materialManage/adOriginality/components/addOriginality/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { Modal, Button, Form, Select, message, Space, Image as AntImg, Row, Col, Upload, Input } from 'antd'
 import { SelectValue } from 'antd/es/select'
 import Cropprt from '@/components/Cropper'

+ 1 - 1
src/pages/launchSystem/materialManage/adOriginality/index.tsx

@@ -6,7 +6,7 @@ import moment from 'moment'
 import AddCom from './components/addOriginality'
 import Details from './components/details'
 import { SelectValue } from 'antd/es/select'
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { CheckboxValueType } from 'antd/es/checkbox/Group'
 import { CheckboxChangeEvent } from 'antd/es/checkbox'
 import ImgPreview from '@/components/ImgPreview'

+ 1 - 1
src/pages/launchSystem/materialManage/adTitle/components/addTitle/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { Modal, Button, Form, Select, message, Space } from 'antd'
 import { SelectValue } from 'antd/es/select'
 import React, { useCallback, useEffect, useState } from "react"

+ 1 - 1
src/pages/launchSystem/materialManage/adTitle/index.tsx

@@ -5,7 +5,7 @@ import React, { useCallback, useEffect, useReducer, useState } from 'react'
 import AddTitle from './components/addTitle'
 import Tables from '@/components/Tables'
 import columns from './tableConfig'
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 const { Option } = Select
 const { Search } = Input
 const { TabPane } = Tabs

+ 1 - 1
src/pages/launchSystem/materialManage/tagManage/index.tsx

@@ -3,7 +3,7 @@ import React, {  useCallback, useEffect, useMemo, useState } from 'react'
 import style from './index.less'
 import './index.less'
 import Checkbox from 'antd/lib/checkbox/Checkbox';
-import { useModel } from '@/.umi/plugin-model/useModel';
+import { useModel } from 'umi';
 const { CheckableTag } = Tag;
 
 /**标签管理*/

+ 1 - 1
src/pages/launchSystem/materialManageBd/adMaterial/components/addCom/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { Modal, Button, Form, Select, message, Space, Image as AntImg, Upload, } from 'antd'
 import { SelectValue } from 'antd/es/select'
 import Cropprt from '@/components/Cropper'

+ 1 - 1
src/pages/launchSystem/materialManageBd/adMaterial/index.tsx

@@ -5,7 +5,7 @@ import './index1.less'
 import AddCom from './components/addCom'
 import BatchAddLabel from '@/components/BatchAddLabel'
 import { SelectValue } from 'antd/es/select'
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { CheckboxValueType } from 'antd/es/checkbox/Group'
 import { CheckboxChangeEvent } from 'antd/es/checkbox'
 import ImgPreview from '@/components/ImgPreview'

+ 1 - 1
src/pages/launchSystem/materialManageBd/adOriginality/components/addOriginality/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { Modal, Button, Form, Select, message, Space, Image as AntImg, Row, Col, Upload, Input } from 'antd'
 import { SelectValue } from 'antd/es/select'
 import Cropprt from '@/components/Cropper'

+ 1 - 1
src/pages/launchSystem/materialManageBd/adOriginality/index.tsx

@@ -6,7 +6,7 @@ import moment from 'moment'
 import AddCom from './components/addOriginality'
 import Details from './components/details'
 import { SelectValue } from 'antd/es/select'
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { CheckboxValueType } from 'antd/es/checkbox/Group'
 import { CheckboxChangeEvent } from 'antd/es/checkbox'
 import ImgPreview from '@/components/ImgPreview'

+ 1 - 1
src/pages/launchSystem/materialManageBd/adTitle/components/addTitle/index.tsx

@@ -1,4 +1,4 @@
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { Modal, Button, Form, Select, message, Space } from 'antd'
 import { SelectValue } from 'antd/es/select'
 import TextArea from 'antd/lib/input/TextArea'

+ 1 - 1
src/pages/launchSystem/materialManageBd/adTitle/index.tsx

@@ -6,7 +6,7 @@ import AddTitle from './components/addTitle'
 import Tables from '@/components/Tables'
 import columns from './tableConfig'
 import BatchAddLabel from '@/components/BatchAddLabel'
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 const { Option } = Select
 const { Search } = Input
 const { TabPane } = Tabs

+ 1 - 1
src/pages/launchSystem/materialManageBd/tagManage/index.tsx

@@ -3,7 +3,7 @@ import React, {  useCallback, useEffect, useMemo, useState } from 'react'
 import style from './index.less'
 import './index.less'
 import Checkbox from 'antd/lib/checkbox/Checkbox';
-import { useModel } from '@/.umi/plugin-model/useModel';
+import { useModel } from 'umi';
 const { CheckableTag } = Tag;
 
 /**标签管理*/

+ 5 - 2
src/pages/launchSystemNew/launchManage/createAd/creative/index.tsx

@@ -35,7 +35,9 @@ function Creative(props: Props) {
     const getInfo = useCallback((sysAdcreativeId) => {
         getSysAdcreative.run(sysAdcreativeId).then(res => {
             let arr = queryForm.taskMediaMaps || []
-            arr[targetKey] = { sysAdcreative: { ...res, isTemplate: false } }
+            let {createTime,...params} = res
+            console.log('res=>',params)
+            arr[targetKey] = { sysAdcreative: { ...params, isTemplate: false } }
             setQueryForm({ ...queryForm, sysAdcreativeId, taskMediaMaps: arr });
             setCreativeVisible(false);
             clearData()
@@ -83,7 +85,7 @@ function Creative(props: Props) {
                         return <Tabs.TabPane key={index} tab={'创意' + (index + 1)}>
                             <Spin spinning={getSysAdcreative.loading}>
                                 <div className={style.centerContent}>
-                                    {(item.sysAdcreative && queryForm?.sysAdcreativeId) && <AdcreativeCol data={item.sysAdcreative} />}
+                                    {item.sysAdcreative && <AdcreativeCol data={item.sysAdcreative} />}
                                 </div>
                             </Spin>
                         </Tabs.TabPane >
@@ -112,6 +114,7 @@ function Creative(props: Props) {
         {adModalConfig.visible && <CreativePup visible={adModalConfig.visible} type={adModalConfig.type} PupFn={handleAdModalConfig} callback={(values: any) => {
             let arr = queryForm.taskMediaMaps || []
             arr[targetKey] = { sysAdcreative: values }
+            console.log('values===>',values)
             setQueryForm({ ...queryForm, taskMediaMaps: arr }); setCreativeVisible(false); clearData();
             handleAdModalConfig({ visible: false, dataInfo: null, type: 'add' })
         }} dataInfo={queryForm?.taskMediaMaps && queryForm?.taskMediaMaps[targetKey]?.sysAdcreative} queryForm={queryForm} />}

+ 105 - 47
src/pages/launchSystemNew/launchManage/createAd/creative/modal/index.tsx

@@ -1,13 +1,12 @@
 import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import { Modal, Form, Input, Divider, Select, Radio, Switch, Spin, List, Checkbox, Space, Button, message, Image } from 'antd'
-import { SiteSetEnum, PromotedObjectType } from '@/services/launchAdq/enum'
 import styles from './index.less'
 import { useAjax } from '@/Hook/useAjax'
 import { getText, get_adcreative_template, get_adcreative_template_list, get_tools_video_capture } from '@/services/launchAdq/global'
 import { AdcreativeTemplate, AdcreativeTemplateList } from '@/services/launchAdq'
 import { mySet } from '@/utils/arrFn'
 import SelectCloud from '@/pages/launchSystemNew/components/selectCloud'
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 import { ModalConfig } from '../../ad';
 import { outAdcreativeTemplateIdFun } from '../../../localAd/adenum'
 import { CreateAdProps } from '@/services/launchAdq/createAd'
@@ -22,6 +21,7 @@ interface Props {
     type?: 'add' | 'look' | 'edit',//新增,查看,编辑
     dataInfo?: any
 }
+const changgui = [311, 641, 642, 643, 618, 1465, 1064, 1480, 721]
 /**创意模板*/
 function CreativePup(props: Props) {
     let { visible, confirmLoading, PupFn, callback, type, dataInfo, queryForm } = props
@@ -44,6 +44,8 @@ function CreativePup(props: Props) {
     const [videoImgsVisbile, set_videoImgsVisbile] = useState(false)
     const [descriptionShow, setdescriptionshow] = useState(false)
     const [endPageDescShow, setendPageDescnshow] = useState(false)
+    const [isShowSc, set_isShowSc] = useState(false)//是否展示素材选项
+    const [infoSet, set_infoSet] = useState(false)//回填设置已完成
     const [videoImgs, set_videoImgs] = useState<{//视频封面图设置
         activeUrl: string,//选中的视频封面图地址
         preview: boolean,//是否开启图片点击预览
@@ -96,7 +98,7 @@ function CreativePup(props: Props) {
     let adcreativeTemplateId = Form.useWatch('adcreativeTemplateId', form)
     let actionBtn = Form.useWatch('actionBtn', form)
     // let siteSet = Form.useWatch('siteSet', form)
-    // let promotedObjectType = Form.useWatch('promotedObjectType', form)
+    let overrideCanvasHeadOption = Form.useWatch('overrideCanvasHeadOption', form)
     let adcreativeElementsType = Form.useWatch('adcreativeElementsType', form)
     let dataShow = Form.useWatch('dataShow', form)
     let conversionDataType = Form.useWatch('conversionDataType', form)
@@ -104,6 +106,7 @@ function CreativePup(props: Props) {
     let description = Form.useWatch('description', form)
     let videoOver = Form.useWatch('videoOver', form)
     let endPageDesc = Form.useWatch('endPageDesc', form)
+    let linkPageType = Form.useWatch('linkPageType', form)
 
     // 确定事件
     const handleOk = useCallback(() => {
@@ -115,14 +118,14 @@ function CreativePup(props: Props) {
                     case 'image'://图素材
                         newValues.adcreativeElements = {
                             ...newValues.adcreativeElements,
-                            imageUrl: imgMaterialConfig.list[0].url,
+                            imageUrl: imgMaterialConfig?.list[0]?.url,
                         }
                         delete newValues[key]
                         break;
                     case 'video'://视频素材
                         newValues.adcreativeElements = {
                             ...newValues.adcreativeElements,
-                            videoUrl: videoMaterialConfig.list[0].url,
+                            videoUrl: videoMaterialConfig?.list[0]?.url,
                         }
                         delete newValues[key]
                         break;
@@ -136,7 +139,7 @@ function CreativePup(props: Props) {
                     case 'short_video1'://视频素材
                         newValues.adcreativeElements = {
                             shortVideoStruct: {
-                                shortVideo1Url: videoMaterialConfig.list[0].url
+                                shortVideo1Url: videoMaterialConfig?.list[0]?.url
                             },
                             description: newValues.description,
                         }
@@ -158,21 +161,19 @@ function CreativePup(props: Props) {
                         break;
                 }
             }
-            delete newValues.description //删除外层文案
-            delete newValues.title //删除外层文案
-            delete newValues.adcreativeElementsType //删除创意形式
-            delete newValues.dataShow //删除数据开关
-            delete newValues.actionBtn //删除行动开关
-            console.log('newValues=>2', newValues)
             if (!newValues.adcreativeElements) {
                 newValues.adcreativeElements = {}
             }
-            if (newValues?.overrideCanvasHeadOption?.length === 0 || !newValues?.overrideCanvasHeadOption) {
-                newValues.overrideCanvasHeadOption = 'OPTION_KEEP_DIFFERENT'
+            if ((newValues?.overrideCanvasHeadOption?.length === 0 || !newValues?.overrideCanvasHeadOption) && isShowSc) {//假如不存在选择素材替换,并且当前创意形式支持,那就传入默认
+                console.log('==============================')
+                newValues.overrideCanvasHeadOption = changgui?.some(i => i === newValues.adcreativeTemplateId) ? 'OPTION_CANVAS_OVERRIDE_CREATIVE' : 'OPTION_KEEP_DIFFERENT'
             }
-            if (newValues?.overrideCanvasHeadOption?.length === 1 && newValues?.overrideCanvasHeadOption[0] === 'OPTION_CREATIVE_OVERRIDE_CANVAS') {
+            if (newValues?.overrideCanvasHeadOption?.length === 1 && newValues?.overrideCanvasHeadOption[0] === 'OPTION_CREATIVE_OVERRIDE_CANVAS' && isShowSc) {//假如存在并手动勾选替换素材
                 newValues.overrideCanvasHeadOption = 'OPTION_CREATIVE_OVERRIDE_CANVAS'
             }
+            if(Array.isArray(newValues?.overrideCanvasHeadOption)){//假如是数组,去除数组
+                newValues.overrideCanvasHeadOption  = newValues.overrideCanvasHeadOption[0]
+            }
             //假如不存在promotedObjectType
             if (!newValues?.promotedObjectType) {
                 newValues['promotedObjectType'] = queryForm.promotedObjectType
@@ -181,20 +182,52 @@ function CreativePup(props: Props) {
             if (!newValues?.siteSet) {
                 newValues['siteSet'] = queryForm.sysAdgroup.siteSet
             }
+            delete newValues.description //删除外层文案
+            delete newValues.title //删除外层文案
+            delete newValues.adcreativeElementsType //删除创意形式
+            delete newValues.dataShow //删除数据开关
+            delete newValues.actionBtn //删除行动开关
+            console.log('newValues.overrideCanvasHeadOption ====>',newValues.overrideCanvasHeadOption )
+            // 假如使用了落地页顶部素材替换外部素材
+            if (newValues.overrideCanvasHeadOption === 'OPTION_CANVAS_OVERRIDE_CREATIVE') {
+                console.log(adcreative_template?.adcreativeElements)
+                adcreative_template?.adcreativeElements?.filter(item => item.required && item.name === 'image_list' || item.name === 'short_video1' || item.name === 'video' || item.name === 'image').forEach(item => {
+                    switch (item.name) {
+                        case 'image'://图素材
+                            newValues.adcreativeElements = {
+                                ...newValues.adcreativeElements,
+                                imageUrl: '',
+                            }
+                            break;
+                        case 'video'://视频素材
+                            newValues.adcreativeElements = {
+                                ...newValues.adcreativeElements,
+                                videoUrl: '',
+                            }
+                            break;
+                        case 'image_list'://图素材
+                            newValues.adcreativeElements = {
+                                ...newValues.adcreativeElements,
+                                imageUrlList: [],
+                            }
+                            break;
+                        case 'short_video1'://视频素材
+                            newValues.adcreativeElements = {
+                                ...newValues.adcreativeElements,
+                                shortVideoStruct: {
+                                    shortVideo1Url: ''
+                                },
+                            }
+                            break;
+                    }
+                })
+            }
+            console.log('newValues=>2', newValues)
             newValues['isTemplate'] = template_checked
             // // 开启存为模板开关执行
-            // if (template_checked && type === 'add') {
-            //     addSysAdgroup.run(newValues).then(res => {
-            //         if (res) {
-            //             callback(newValues)
-            //         }
-            //     })
-            // } else {
             callback(newValues)
-            // }
         })
-        // PupFn({ visible: false })
-    }, [form, imgMaterialConfig, videoMaterialConfig, queryForm, template_checked])
+    }, [form, imgMaterialConfig, videoMaterialConfig, queryForm, template_checked, adcreative_template, isShowSc])
     // 获取创意形式列表
     useEffect(() => {
         if (siteSet?.length > 0 && promotedObjectType) {
@@ -208,10 +241,11 @@ function CreativePup(props: Props) {
                 if (!res) {
                     return
                 }
+                // 
                 Object.values(res)?.forEach((arr: any) => {
                     Array.isArray(arr) && arr?.forEach((item: any) => {
-                        if (newArr.length > 0) {
-                            if (outAdcreativeTemplateIdFun(item.adcreativeTemplateId) && newArr.every((i: { adcreativeTemplateId: any }) => i.adcreativeTemplateId !== item.adcreativeTemplateId)) {
+                        if (newArr.length > 0) {//假如已存在ID,需要过滤相同
+                            if (outAdcreativeTemplateIdFun(item.adcreativeTemplateId) && newArr.every((i: { adcreativeTemplateId: any }) => i.adcreativeTemplateId !== item.adcreativeTemplateId)) {//不重复的添加
                                 newArr.push(item)
                             } else {
                                 // 找出通用创意
@@ -222,7 +256,7 @@ function CreativePup(props: Props) {
                                     return arr
                                 })
                             }
-                        } else {
+                        } else {//不存在ID直接过滤掉即将下线的
                             if (outAdcreativeTemplateIdFun(item.adcreativeTemplateId)) {
                                 newArr.push(item)
                             }
@@ -235,6 +269,7 @@ function CreativePup(props: Props) {
     }, [siteSet, promotedObjectType, form])
     // 获取创意形式详情
     useEffect(() => {
+        console.log('获取创意形式详情=====>', { siteSet, promotedObjectType, adcreativeTemplateId })
         // CAMPAIGN_TYPE_NORMAL
         if (siteSet?.length > 0 && promotedObjectType && adcreativeTemplateId) {
             if (adcreativeTemplateId) {
@@ -245,6 +280,13 @@ function CreativePup(props: Props) {
                 }).then(res => {
                     if (res?.length > 0) {
                         set_adcreative_template(res[0])
+                        if (siteSet?.some((name: string) => name === 'SITE_SET_MOMENTS')) {
+                            if (res[0].unsupportSitesetDetailSpec?.length > 0) {
+                                set_isShowSc(!res[0].unsupportSitesetDetailSpec[0].siteSet?.some((name: string) => name === "SITE_SET_MOMENTS"))
+                            } else {
+                                set_isShowSc(true)
+                            }
+                        }
                     }
                 })
             }
@@ -276,14 +318,19 @@ function CreativePup(props: Props) {
         return null
     }, [pageType, pageTypeList])
     // 切换创意形式默认选中第一个
-    useEffect(() => {
-        // 设置默认选中第一个
+    //   useEffect(() => {
+    //     // 设置默认选中第一个
+    //     if (adcreativeElementsType && adcreative_template_list?.length > 0 ) {
+    //         let adcreativeTemplateIdArr = adcreative_template_list?.filter(item => item.adcreativeTemplateStyle === adcreativeElementsType)
+    //         form.setFieldsValue({ adcreativeTemplateId: adcreativeTemplateIdArr[0].adcreativeTemplateId })
+    //     }
+    // }, [adcreativeElementsType, adcreative_template_list])
+    const typeChange = useCallback((adcreativeElementsType) => {
         if (adcreativeElementsType && adcreative_template_list?.length > 0) {
             let adcreativeTemplateIdArr = adcreative_template_list?.filter(item => item.adcreativeTemplateStyle === adcreativeElementsType)
             form.setFieldsValue({ adcreativeTemplateId: adcreativeTemplateIdArr[0].adcreativeTemplateId })
         }
-    }, [adcreativeElementsType, adcreative_template_list])
-
+    }, [adcreative_template_list])
 
     //每次选中创意设置该展示的界面
     useEffect(() => {
@@ -320,10 +367,11 @@ function CreativePup(props: Props) {
             if (states.xd_show) {
                 let linkNameList = (pageList?.filter((item: { pageType: any; }) => item.pageType === pageType)[0] as any)?.supportLinkNameType?.list
                 let linkPageList = (pageList?.filter((item: { pageType: any; }) => item.pageType === pageType)[0] as any)?.supportLinkPageType?.list
-                if (linkNameList) {
+                if (linkNameList && !linkPageType) {
                     let linkNameType = linkNameList[0]?.linkNameType
                     let linkPageType = linkPageList[0]?.linkPageType
-                    values = { ...values, linkNameType, linkPageType }
+                    values = { ...values, linkNameType, linkPageType, actionBtn: true }
+
                 } else {
                     states = { ...states, xd_show: false }
                 }
@@ -377,8 +425,8 @@ function CreativePup(props: Props) {
     }, [])
     // 数据回填
     useEffect(() => {
-        if (dataInfo && adcreative_template_list?.length > 0 && adcreative_template) {
-            let { adcreativeName, adcreativeTemplateId, conversionDataType, conversionTargetType, linkNameType, linkPageType, pageType, promotedObjectType, siteSet, adcreativeElements } = dataInfo
+        if (!infoSet && dataInfo && adcreative_template_list?.length > 0) {
+            let { adcreativeName, adcreativeTemplateId, conversionDataType, conversionTargetType, linkNameType, linkPageType, pageType, promotedObjectType, siteSet, adcreativeElements, overrideCanvasHeadOption } = dataInfo
             let { description, imageUrl, title, videoUrl, imageUrlList, endPage, shortVideoStruct } = adcreativeElements
             let obj: any = {
                 adcreativeName,
@@ -415,6 +463,9 @@ function CreativePup(props: Props) {
             if (endPage) {
                 obj = { ...obj, videoOver: true, ...endPage }
             }
+            if (overrideCanvasHeadOption) {
+                obj = { ...obj, overrideCanvasHeadOption: [overrideCanvasHeadOption] }
+            }
             if (videoUrl) {
                 setVideoMaterialConfig({
                     cloudSize: [],
@@ -455,12 +506,13 @@ function CreativePup(props: Props) {
                 })
                 obj = { ...obj, short_video1: shortVideoStruct.shortVideo1Url }
             }
+            console.log('数据回填====>', obj)
             form.setFieldsValue(obj)
+            set_infoSet(true)
         }
-    }, [dataInfo, adcreative_template_list, adcreative_template])
+    }, [dataInfo, adcreative_template_list, adcreative_template, infoSet])
     // 生成视频封面图
     const videoToImgs = useCallback(() => {
-
         if (videoMaterialConfig.list[0]) {
             set_videoImgsVisbile(true)
             // let url = videoMaterialConfig.list[0].url
@@ -506,7 +558,7 @@ function CreativePup(props: Props) {
                     adcreativeElementsType: '视频',
                     // promotedObjectType:queryForm?.promotedObjectType,
                     // siteSet:queryForm?.sysAdgroup?.siteSet,
-                    // overrideCanvasHeadOption:['OPTION_KEEP_DIFFERENT'],//默认'自定义广告创意素材,和原生推广页顶部素材保持两者不同,(仅支持朋友圈非常规创意形式)'
+                    overrideCanvasHeadOption: [],//默认'自定义广告创意素材,和原生推广页顶部素材保持两者不同,(仅支持朋友圈非常规创意形式)'
                     // actionBtn: false,//行动按钮
                     // dataShow: false,//数据展示
                 }
@@ -544,7 +596,10 @@ function CreativePup(props: Props) {
             <Divider orientation='center'>创意形式</Divider>
             {/* ============================================================创意形式============================================================= */}
             <Form.Item label={<strong>创意形式</strong>} name='adcreativeElementsType'>
-                <Radio.Group >
+                <Radio.Group onChange={(e) => {
+                    let value = e.target.value
+                    typeChange(value)
+                }}>
                     <Radio.Button value="视频">视频</Radio.Button>
                     <Radio.Button value="图片">图片</Radio.Button>
                 </Radio.Group>
@@ -572,8 +627,8 @@ function CreativePup(props: Props) {
                         {/* ============================================================创意内容============================================================= */}
                         <Divider orientation='center'>创意内容</Divider>
                         {/* ============================================================素材============================================================= */}
-                        {/* 优先展示视频或图片 */}
-                        <div style={{ display: 'flex', flexFlow: 'column' }}>
+                        {/* 优先展示视频或图片,朋友圈常规不勾选使用外部素材替换内部,隐藏此选项,后期自动将落地页顶部素材添加进入 */}
+                        {((Array.isArray(overrideCanvasHeadOption) && overrideCanvasHeadOption[0] === 'OPTION_CREATIVE_OVERRIDE_CANVAS') || !changgui.some(i => i === adcreative_template?.adcreativeTemplateId)) && <div style={{ display: 'flex', flexFlow: 'column' }}>
                             {
                                 adcreative_template?.adcreativeElements?.filter(item => item.required && item.name === 'image_list' || item.name === 'short_video1' || item.name === 'video' || item.name === 'image').map(item => {
                                     return <Form.Item label={<strong>{item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? '视频封面图' : item.description}</strong>} rules={[{ required: true, message: '请选择素材!' }]} key={item.name} name={item.name} style={item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? { order: 2 } : {}}>
@@ -660,7 +715,7 @@ function CreativePup(props: Props) {
                                     </Form.Item>
                                 })
                             }
-                        </div>
+                        </div>}
 
                         {/* 标题 */}
                         {
@@ -749,7 +804,8 @@ function CreativePup(props: Props) {
                             </Radio.Group>
                         </Form.Item>
                         {
-                            pageType === 'PAGE_TYPE_CANVAS_WECHAT' && <Form.Item label={<strong>素材选项</strong>} name='overrideCanvasHeadOption'>
+                            pageType === 'PAGE_TYPE_CANVAS_WECHAT' && isShowSc && <Form.Item label={<strong>素材选项</strong>} name='overrideCanvasHeadOption'>
+                                {/* disabled={changgui?.some((i: any) => i == adcreative_template?.adcreativeTemplateId)} */}
                                 <Checkbox.Group options={[{ label: '使用外层创意素材替换原生推广页顶部素材', value: 'OPTION_CREATIVE_OVERRIDE_CANVAS' }]} />
                             </Form.Item>
                         }
@@ -778,10 +834,10 @@ function CreativePup(props: Props) {
                                 <div style={{ display: 'flex' }}>
                                     <p style={{ marginBottom: 5, marginLeft: 177 }}><strong style={{ marginRight: 20 }}>跳转落地页</strong></p>
                                     <Form.Item name='linkPageType'>
-                                        <Radio.Group>
+                                        <Radio.Group style={{ display: 'flex' }}>
                                             {
                                                 linkPageList?.map((item: { linkPageType: string; description: string; }, index: number) => {
-                                                    return <Radio.Button value={item.linkPageType} key={item.linkPageType}>{item.description}</Radio.Button>
+                                                    return <Radio.Button value={item.linkPageType} key={item.linkPageType} >{item.description}</Radio.Button>
                                                 })
                                             }
                                         </Radio.Group>
@@ -882,7 +938,9 @@ function CreativePup(props: Props) {
         {
             selectImgVisible && <SelectCloud
                 visible={selectImgVisible}
-                onClose={() => set_selectImgVisible(false)}
+                onClose={() => {
+                    set_selectImgVisible(false)
+                }}
                 sliderImgContent={imgMaterialConfig.list}
                 onChange={(content) => {
                     if (content.length > 0) {

+ 41 - 5
src/pages/launchSystemNew/launchManage/createAd/index.tsx

@@ -105,7 +105,7 @@ const CreateAd: React.FC = () => {
     // 获取账户列表
     useEffect(() => {
         getAdAccount.run()
-        init({ mediaType: 'PAGE' })
+        // init({ mediaType: 'PAGE' })
     }, [])
 
     /** 获取广告详情 */
@@ -275,17 +275,49 @@ const CreateAd: React.FC = () => {
     }
     /** 设置落地页 */
     const setPage = (e: any) => {
+        console.log('设置落地页=>', e[0].pageSpecsList[0].pageElementsSpecList[0])
         let arr: any = queryForm.taskMediaMaps || []
+        function setUrl(item: { sysAdcreative: { overrideCanvasHeadOption: string, adcreativeElements: any } }) {
+            console.log('item====>', item)
+            if (item?.sysAdcreative?.overrideCanvasHeadOption && item?.sysAdcreative?.overrideCanvasHeadOption === "OPTION_CANVAS_OVERRIDE_CREATIVE") {
+                let adcreativeElementsNew = { ...item.sysAdcreative.adcreativeElements }
+                let obj = e[0].pageSpecsList[0].pageElementsSpecList[0]
+                let { topImageSpec, topVideoSpec, topSliderSpec } = obj
+                console.log(adcreativeElementsNew)
+                Object.keys(adcreativeElementsNew).forEach(key => {
+                    switch (key) {
+                        case 'imageUrl'://图素材
+                            adcreativeElementsNew[key] = topImageSpec?.imageUrl
+                            break;
+                        case 'videoUrl'://视频素材
+                            adcreativeElementsNew[key] = topVideoSpec?.videoUrl
+                            break;
+                        case 'imageUrlList'://图素材
+                            adcreativeElementsNew[key] = topSliderSpec?.imageUrlList || [topImageSpec?.imageUrl]
+                            break;
+                        case 'shortVideoStruct'://视频素材
+                            adcreativeElementsNew[key] = { shortVideo1Url: topVideoSpec?.videoUrl }
+                            break;
+                    }
+                })
+                return { ...item, sysPageId: e[0]?.id, pageId: '', pageAccountId: '', sysAdcreative: { ...item.sysAdcreative, adcreativeElements: adcreativeElementsNew } }
+            }
+            return { ...item, sysPageId: e[0]?.id, pageId: '', pageAccountId: '', }
+        }
         if (page_checked) {
-            arr = queryForm.taskMediaMaps?.map(item => ({ ...item, sysPageId: e[0]?.id, pageId: '', pageAccountId: '' }))
+            console.log('queryForm.taskMediaMaps', queryForm.taskMediaMaps)
+            arr = queryForm.taskMediaMaps?.map(item => {
+                return setUrl(item)
+            })
         } else {
-            arr[targetKey as string] = { ...arr[targetKey as string], sysPageId: e[0]?.id, pageId: '', pageAccountId: '' }
+            arr[targetKey as string] = setUrl(arr[targetKey as string])
         }
         getPageInfo(arr)
         setSelectImgVisible(false)
     }
     /** 获取落地页详情 */
     const getPageInfo = useCallback((arrList) => {
+        console.log('arrList====>', arrList)
         if (arrList && arrList[targetKey]?.sysPageId) {
             get.run({ mediaType: 'PAGE', sysMediaId: arrList[targetKey]?.sysPageId }).then(res => {
                 if (!Object.keys(res)?.includes('fail')) {
@@ -336,6 +368,7 @@ const CreateAd: React.FC = () => {
             }
         }
     }, [queryForm, targetKey])
+    console.log('queryForm====>', queryForm)
     return <Space direction="vertical" style={{ width: '100%' }}>
         <Card title={<div className={style.cardTitle}>配置区</div>} className={style.createAd} hoverable>
             <Space>
@@ -530,9 +563,12 @@ const CreateAd: React.FC = () => {
                                     </Tabs>
                                 </div>
                                 <div className={style.bottom}>{
-                                    queryForm?.sysAdcreativeId ? <>
+                                    queryForm?.taskMediaMaps ? <>
                                         {queryForm?.taskMediaMaps && queryForm?.taskMediaMaps[targetKey]?.sysPageId && <Button type="link" onClick={() => { setLookVisible(true) }}>查看</Button>}
-                                        <Button type="link" onClick={() => { setSelectImgVisible(true) }}>{queryForm?.taskMediaMaps && queryForm?.taskMediaMaps[targetKey]?.sysPageId ? '修改' : '选择落地页'}</Button>
+                                        <Button type="link" onClick={() => {
+                                            setSelectImgVisible(true)
+                                            init({ mediaType: 'PAGE', cloudSize: null })
+                                        }}>{queryForm?.taskMediaMaps && queryForm?.taskMediaMaps[targetKey]?.sysPageId ? '修改' : '选择落地页'}</Button>
                                         {accountCreateLogs?.length > 0 ? <Button type="link" onClick={() => { setPageVisible(true) }}>云端落地页</Button> : <Tooltip title="请先选择媒体账户">
                                             <Button type="link">云端落地页</Button>
                                         </Tooltip>}

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

@@ -9,7 +9,7 @@ import { getText, get_adcreative_template, get_adcreative_template_list } from '
 import { AdcreativeTemplate, AdcreativeTemplateList } from '@/services/launchAdq'
 import { mySet } from '@/utils/arrFn'
 import SelectCloud from '@/pages/launchSystemNew/components/selectCloud'
-import { useModel } from '@/.umi/plugin-model/useModel'
+import { useModel } from 'umi'
 interface Props {
     title?: string,
     visible: boolean,

+ 2 - 2
src/pages/launchSystemNew/launchManage/taskList/logTableConfig.tsx

@@ -65,8 +65,8 @@ function tableConfig(): any {
         },
         {
             title: <span style={{ padding: '0 8px' }}>失败原因</span>,
-            dataIndex: 'failMsg',
-            key: 'failMsg',
+            dataIndex: 'failMsgs',
+            key: 'failMsgs',
             align: 'left',
             ellipsis: true,
             render: (a: any, b: any) => {

+ 2 - 2
src/services/api.ts

@@ -1,5 +1,5 @@
-// export let api: any = process.env.NODE_ENV === 'development' ? 'api' : 'http://47.97.38.17/api'
-export let api: any = process.env.NODE_ENV === 'development' ? 'api' : 'http://api.zanxiangwl.com'
+export let api: any = process.env.NODE_ENV === 'development' ? 'api' : 'http://47.97.38.17/api'
+// export let api: any = process.env.NODE_ENV === 'development' ? 'api' : 'http://api.zanxiangwl.com'
 export let dataApi: any = process.env.NODE_ENV === 'development' ? 'dapi' : `http://data.zanxiangnet.com`
 export let wxApi: any = process.env.NODE_ENV === 'development' ? 'wxapi' : `https://report.zanxiangwl.com`
 export let launchApi: any = `http://192.168.7.175:8018`