shenwu 2 anos atrás
pai
commit
910a9921e8

+ 11 - 4
src/pages/launchSystemNew/adq/creative/tableConfig.tsx

@@ -1,4 +1,4 @@
-import { LinkPageTypeEnum, PromotedObjectType } from '@/services/launchAdq/enum'
+import { AdcreativeTemplateEnum, LinkPageNameTypeEnum, LinkPageTypeEnum, PromotedObjectType } from '@/services/launchAdq/enum'
 import React from 'react'
 function tableConfig(tableIdClick: (props: {
     activeKey: string,
@@ -73,7 +73,7 @@ function tableConfig(tableIdClick: (props: {
             title: '创意名称',
             dataIndex: 'adcreativeName',
             key: 'adcreativeName',
-            width: 250,
+            width: 350,
             align: 'center',
         },
         // {
@@ -224,10 +224,13 @@ function tableConfig(tableIdClick: (props: {
         //     align: 'center'
         // },
         {
-            title: '创意形式ID',
+            title: '创意形式',
             dataIndex: 'adcreativeTemplateId',
             key: 'adcreativeTemplateId',
             align: 'center',
+            render:(a: string | number)=>{
+                return AdcreativeTemplateEnum[a]
+            }
         },
         // {
         //     title: '是否开启自动版位功能',
@@ -253,7 +256,10 @@ function tableConfig(tableIdClick: (props: {
             key: 'linkNameType',
             align: 'center',
             render: (a: any, b: any) => {
-                return b.linkNameType || b.linkPageType ? '开' : '关'
+                return b.linkNameType || b.linkPageType ? <div>
+                    {b.linkNameType && <div><span style={{ color: "#5a5a5a" }}>{LinkPageNameTypeEnum[b.linkNameType]}</span></div>}
+                    {b.linkPageType && <div><span style={{ color: "#5a5a5a" }}>{LinkPageTypeEnum[b.linkPageType]}</span></div>}
+                </div> : '关'
             }
         },
         // {
@@ -297,6 +303,7 @@ function tableConfig(tableIdClick: (props: {
             dataIndex: 'createdTime',
             key: 'createdTime',
             align: 'center',
+            width:150
         },
     ]
 }

+ 29 - 16
src/pages/launchSystemNew/launchManage/createAd/ad/modal/leadAd.tsx

@@ -95,9 +95,9 @@ function LeadAdModal(props: Props) {
             delete newValues['dateType']
             delete newValues['date']
             newValues['timeSeries'] = Array(336).fill(1).join('')
-            newValues['promotedObjectType'] =  queryForm.promotedObjectType
+            newValues['promotedObjectType'] = queryForm.promotedObjectType
             console.log(newValues)
-            newValues['isTemplate']=template_checked
+            newValues['isTemplate'] = template_checked
             // 开启存为模板开关执行
             // if (template_checked && type==='add') {
             //     createSysAdgroup.run(newValues).then(res => {
@@ -106,10 +106,10 @@ function LeadAdModal(props: Props) {
             //         }
             //     })
             // } else {
-                callback(newValues)
+            callback(newValues)
             // }
         })
-    }, [form, template_checked,queryForm,type])
+    }, [form, template_checked, queryForm, type])
     // 场景定向
     useEffect(() => {
         sceneTagsList.run({ typeList: ['WECHAT_POSITION', 'OFFICIAL_ACCOUNT_MEDIA_CATEGORY', 'MINI_PROGRAM_AND_MINI_GAME', 'PAY_SCENE'] })
@@ -137,14 +137,27 @@ function LeadAdModal(props: Props) {
                 officialAccountMediaCategory: dataInfo?.sceneSpec?.wechatScene?.officialAccountMediaCategory,//公众号媒体类型
                 miniProgramAndMiniGame: dataInfo?.sceneSpec?.wechatScene?.miniProgramAndMiniGame,//小程序小游戏流量类型
                 payScene: dataInfo?.sceneSpec?.wechatScene?.payScene,//订单详情页消费场景
-                firstDayBeginTime:dataInfo?.firstDayBeginTime?moment(`${dataInfo?.beginDate} ${dataInfo?.firstDayBeginTime}`) : undefined,//首日开始时间
-                configuredStatus:dataInfo?.configuredStatus || 'AD_STATUS_SUSPEND',//广告启停
+                firstDayBeginTime: dataInfo?.firstDayBeginTime ? moment(`${dataInfo?.beginDate} ${dataInfo?.firstDayBeginTime}`) : undefined,//首日开始时间
+                configuredStatus: dataInfo?.configuredStatus || 'AD_STATUS_SUSPEND',//广告启停
             })
-            if(dataInfo?.firstDayBeginTime){//存在首日开始时间,选中开关
-                setState({...state,isShowTime:['1']})
+            if (dataInfo?.firstDayBeginTime) {//存在首日开始时间,选中开关
+                setState({ ...state, isShowTime: ['1'] })
             }
         }
     }, [dataInfo])
+    // 出价方式改变清空某些数据
+    const bidModeChange=useCallback((props)=>{
+        form.setFieldsValue({
+            ...props,
+            optimizationGoal:null,
+            smartBidType:null,
+            // bidAmount:null,
+            bidStrategy:null,
+            autoAcquisitionEnabled:false,
+            autoAcquisitionBudget:null,
+            dailyBudget:null,
+        })
+    },[])
     return <Modal
         visible={visible}
         title={type === 'add' ? '新建广告' : type === 'look' ? '广告详情' : '编辑广告'}
@@ -180,7 +193,7 @@ function LeadAdModal(props: Props) {
                     wechatSceneType: '0',
                     wechatPositionType: '0',
                     optimizationGoal: 'OPTIMIZATIONGOAL_ECOMMERCE_ORDER',
-                    configuredStatus:'AD_STATUS_SUSPEND'
+                    configuredStatus: 'AD_STATUS_SUSPEND'
                 }
             }
         >
@@ -197,7 +210,7 @@ function LeadAdModal(props: Props) {
                     </Radio.Group>
                 </Form.Item>
                 {!automaticSiteEnabled && <Form.Item name='siteSet' noStyle rules={[{ required: true, message: '请输入选择广告版位!' }]}>
-                    <Checkbox.Group style={{ width: '100%' }}>
+                    <Checkbox.Group style={{ width: '100%' }} onChange={()=>{bidModeChange({bidMode:'BID_MODE_OCPM'})}}>
                         <Row>
                             <Col span={4}>
                                 <Checkbox value="SITE_SET_MOMENTS">微信朋友圈</Checkbox>
@@ -287,10 +300,10 @@ function LeadAdModal(props: Props) {
                     <TimePicker />
                 </Form.Item>}
             </Form.Item>
-            <Form.Item label={<strong>出价方式<Tooltip title='出价方式不同将影响自定义人群,行为兴趣意向等某些功能无法使用'><ExclamationCircleOutlined style={{ color: '#e91e63', marginLeft: 5 }} /></Tooltip></strong>} name='bidMode'>
-                <Radio.Group >
+            <Form.Item label={<strong>出价方式<Tooltip title='出价方式不同将影响自定义人群,行为兴趣意向等某些功能无法使用'><ExclamationCircleOutlined style={{ color: '#e91e63', marginLeft: 5 }} /></Tooltip></strong>} name='bidMode' rules={[{required:true,message:'请选择出价方式'}]}>
+                <Radio.Group onChange={bidModeChange}>
                     {
-                        Object.keys(BidModeEnum).map(key => {
+                        Object.keys(BidModeEnum).filter(key => { if (siteSet?.some((name: string) => name === "SITE_SET_MOMENTS")) { return key === 'BID_MODE_OCPM' || key === 'BID_MODE_CPM' } else { return true } })?.map(key => {
                             return <Radio.Button value={key} key={key} >{BidModeEnum[key]}</Radio.Button>
                         })
                     }
@@ -311,13 +324,13 @@ function LeadAdModal(props: Props) {
                             }
                         </Select>
                     </Form.Item>
-                    <Form.Item label={<strong>出价类型</strong>} name='smartBidType'>
+                    <Form.Item label={<strong>出价类型</strong>} name='smartBidType' rules={[{ required: true, message: '请选择出价类型' }]}>
                         <Radio.Group >
                             <Radio.Button value="SMART_BID_TYPE_CUSTOM">手动出价</Radio.Button>
                             <Radio.Button value="SMART_BID_TYPE_SYSTEMATIC">自动出价</Radio.Button>
                         </Radio.Group>
                     </Form.Item>
-                    <Form.Item label={<strong>出价策略</strong>} name='bidStrategy'>
+                    <Form.Item label={<strong>出价策略</strong>} name='bidStrategy' rules={[{ required: true, message: '请选择出价策略' }]}>
                         <Radio.Group >
                             {
                                 Object.keys(BidStrategyEnum).map(key => {
@@ -351,7 +364,7 @@ function LeadAdModal(props: Props) {
                 <Input placeholder='不填默认为不限' style={{ width: 300 }} />
             </Form.Item>
             <Form.Item label={<strong>广告状态</strong>} name="configuredStatus" rules={[{ required: true, message: '请选择广告状态' }]}>
-                <Select placeholder="选择广告状态" style={{width:300}}>
+                <Select placeholder="选择广告状态" style={{ width: 300 }}>
                     {Object.keys(AdStatus).map(key => {
                         return <Select.Option value={key} key={key}>{AdStatus[key]}</Select.Option>
                     })}

+ 30 - 18
src/pages/launchSystemNew/launchManage/createAd/ad/modal/wechat.tsx

@@ -96,7 +96,7 @@ function WeChatAdModal(props: Props) {
             delete newValues['date']
             newValues['timeSeries'] = Array(336).fill(1).join('')
             newValues['promotedObjectType'] = queryForm.promotedObjectType
-            newValues['isTemplate']=template_checked
+            newValues['isTemplate'] = template_checked
             console.log(newValues)
             // 开启存为模板开关执行
             // if (template_checked && type === 'add') {
@@ -106,10 +106,10 @@ function WeChatAdModal(props: Props) {
             //         }
             //     })
             // } else {
-                callback(newValues)
+            callback(newValues)
             // }
         })
-    }, [form, template_checked, queryForm,type])
+    }, [form, template_checked, queryForm, type])
     // 场景定向
     useEffect(() => {
         sceneTagsList.run({ typeList: ['WECHAT_POSITION', 'OFFICIAL_ACCOUNT_MEDIA_CATEGORY', 'MINI_PROGRAM_AND_MINI_GAME', 'PAY_SCENE'] })
@@ -137,14 +137,27 @@ function WeChatAdModal(props: Props) {
                 officialAccountMediaCategory: dataInfo?.sceneSpec?.wechatScene?.officialAccountMediaCategory,//公众号媒体类型
                 miniProgramAndMiniGame: dataInfo?.sceneSpec?.wechatScene?.miniProgramAndMiniGame,//小程序小游戏流量类型
                 payScene: dataInfo?.sceneSpec?.wechatScene?.payScene,//订单详情页消费场景
-                firstDayBeginTime:dataInfo?.firstDayBeginTime?moment(`${dataInfo?.beginDate} ${dataInfo?.firstDayBeginTime}`) : undefined,//首日开始时间
-                configuredStatus:dataInfo?.configuredStatus || 'AD_STATUS_SUSPEND',//广告启停
+                firstDayBeginTime: dataInfo?.firstDayBeginTime ? moment(`${dataInfo?.beginDate} ${dataInfo?.firstDayBeginTime}`) : undefined,//首日开始时间
+                configuredStatus: dataInfo?.configuredStatus || 'AD_STATUS_SUSPEND',//广告启停
             })
-            if(dataInfo?.firstDayBeginTime){//存在首日开始时间,选中开关
-                setState({...state,isShowTime:['1']})
+            if (dataInfo?.firstDayBeginTime) {//存在首日开始时间,选中开关
+                setState({ ...state, isShowTime: ['1'] })
             }
         }
     }, [dataInfo])
+    // 出价方式改变清空某些数据
+    const bidModeChange = useCallback((props) => {
+        form.setFieldsValue({
+            ...props,
+            optimizationGoal: null,
+            smartBidType: null,
+            // bidAmount:null,
+            bidStrategy: null,
+            autoAcquisitionEnabled: false,
+            autoAcquisitionBudget: null,
+            dailyBudget: null,
+        })
+    }, [])
     return <Modal
         visible={visible}
         title={type === 'add' ? '新建广告' : type === 'look' ? '广告详情' : '编辑广告'}
@@ -154,7 +167,7 @@ function WeChatAdModal(props: Props) {
         footer={<Space>
             <Button onClick={() => { PupFn({ visible: false, dataInfo: null, type: 'add' }) }}>取消</Button>
             <Button type='primary' onClick={handleOk}>确定</Button>
-            { <Checkbox checked={template_checked} onChange={(e) => {
+            {<Checkbox checked={template_checked} onChange={(e) => {
                 let checked = e.target.checked
                 settemplate_checked(checked)
             }}>存为模板</Checkbox>}
@@ -179,7 +192,7 @@ function WeChatAdModal(props: Props) {
                     wechatSceneType: '0',
                     wechatPositionType: '0',
                     optimizationGoal: 'OPTIMIZATIONGOAL_ECOMMERCE_ORDER',
-                    configuredStatus:'AD_STATUS_SUSPEND'
+                    configuredStatus: 'AD_STATUS_SUSPEND'
                 }
             }
         >
@@ -196,7 +209,7 @@ function WeChatAdModal(props: Props) {
                     </Radio.Group>
                 </Form.Item>
                 {!automaticSiteEnabled && <Form.Item name='siteSet' noStyle rules={[{ required: true, message: '请输入选择广告版位!' }]}>
-                    <Checkbox.Group style={{ width: '100%' }}>
+                    <Checkbox.Group style={{ width: '100%' }} onChange={() => { bidModeChange({ bidMode: 'BID_MODE_OCPM' }) }}>
                         <Row>
                             <Col span={5}>
                                 <Checkbox value="SITE_SET_MOMENTS">微信朋友圈</Checkbox>
@@ -271,14 +284,13 @@ function WeChatAdModal(props: Props) {
                     <TimePicker />
                 </Form.Item>}
             </Form.Item>
-            <Form.Item label={<strong>出价方式<Tooltip title='oCPC/oCPM出价,或开启自动扩量/智能扩量时不支持二方人群'><ExclamationCircleOutlined style={{ color: '#e91e63', marginLeft: 5 }} /></Tooltip></strong>} name='bidMode'>
-                <Radio.Group >
+            <Form.Item label={<strong>出价方式<Tooltip title='oCPC/oCPM出价,或开启自动扩量/智能扩量时不支持二方人群'><ExclamationCircleOutlined style={{ color: '#e91e63', marginLeft: 5 }} /></Tooltip></strong>} name='bidMode' rules={[{ required: true, message: '请选择出价方式' }]}>
+                <Radio.Group onChange={bidModeChange}>
                     {
-                        Object.keys(BidModeEnum).map(key => {
-                            return <Radio.Button value={key} key={key} disabled={!key.includes('CPM')}>{BidModeEnum[key]}</Radio.Button>
+                        Object.keys(BidModeEnum).filter(key => { if (siteSet?.some((name: string) => name === "SITE_SET_MOMENTS")) { return key === 'BID_MODE_OCPM' || key === 'BID_MODE_CPM' } else { return true } })?.map(key => {
+                            return <Radio.Button value={key} key={key} >{BidModeEnum[key]}</Radio.Button>
                         })
                     }
-
                 </Radio.Group>
             </Form.Item>
             {/* 出价方式为OCPM才展示 */}
@@ -295,13 +307,13 @@ function WeChatAdModal(props: Props) {
                             }
                         </Select>
                     </Form.Item>
-                    <Form.Item label={<strong>出价类型</strong>} name='smartBidType'>
+                    <Form.Item label={<strong>出价类型</strong>} name='smartBidType' rules={[{ required: true, message: '请选择出价类型' }]}>
                         <Radio.Group >
                             <Radio.Button value="SMART_BID_TYPE_CUSTOM">手动出价</Radio.Button>
                             <Radio.Button value="SMART_BID_TYPE_SYSTEMATIC">自动出价</Radio.Button>
                         </Radio.Group>
                     </Form.Item>
-                    <Form.Item label={<strong>出价策略</strong>} name='bidStrategy'>
+                    <Form.Item label={<strong>出价策略</strong>} name='bidStrategy' rules={[{ required: true, message: '请选择出价策略' }]}>
                         <Radio.Group >
                             {
                                 Object.keys(BidStrategyEnum).map(key => {
@@ -335,7 +347,7 @@ function WeChatAdModal(props: Props) {
                 <Input placeholder='不填默认为不限' style={{ width: 300 }} />
             </Form.Item>
             <Form.Item label={<strong>广告状态</strong>} name="configuredStatus" rules={[{ required: true, message: '请选择广告状态' }]}>
-                <Select placeholder="选择广告状态"  style={{ width: 300 }}>
+                <Select placeholder="选择广告状态" style={{ width: 300 }}>
                     {Object.keys(AdStatus).map(key => {
                         return <Select.Option value={key} key={key}>{AdStatus[key]}</Select.Option>
                     })}

+ 17 - 11
src/pages/launchSystemNew/launchManage/createAd/adcreativeCol.tsx

@@ -1,4 +1,4 @@
-import { LinkPageNameTypeEnum, LinkPageTypeEnum, PromotedObjectType, SiteSetEnum } from "@/services/launchAdq/enum"
+import { EndPageTypeEnum, LinkPageNameTypeEnum, LinkPageTypeEnum, PromotedObjectType, SiteSetEnum } from "@/services/launchAdq/enum"
 import React from "react"
 import { Image, Space } from "antd"
 import { overrideCanvasHeadOptionEnum } from "./creative/modal/config"
@@ -37,25 +37,31 @@ const AdcreativeCol: React.FC<Props> = (props) => {
 
     /***************************/
     const { data } = props
-    const { adcreativeName, promotedObjectType, siteSet, adcreativeTemplateId, adcreativeElements, overrideCanvasHeadOption, linkNameType, linkPageType } = data
+    const { adcreativeName, promotedObjectType, siteSet, adcreativeTemplateId, adcreativeElements, overrideCanvasHeadOption, linkNameType, linkPageType,linkPageSpec} = data
     /***************************/
 
     return <>
-        <div><strong>创意名称:</strong><span style={{color:"#5a5a5a"}}>{adcreativeName}</span></div>
-        <div><strong>推广目标:</strong> <span style={{color:"#5a5a5a"}}>{PromotedObjectType[promotedObjectType]}</span></div>
-        <div><strong>广告版位:</strong> <span style={{color:"#5a5a5a"}}>{siteSet?.map((item: string) => SiteSetEnum[item]).toString()}</span></div>
-        <div><strong>创意形式: </strong><span style={{color:"#5a5a5a"}}>{adcreativeTemplate?.find((item: any) => item?.adcreativeTemplateId === adcreativeTemplateId)?.adcreativeTemplateAppellation || ''}</span></div>
-        {adcreativeElements?.description && <div><strong>创意文案:</strong> <span style={{color:"#5a5a5a"}}>{adcreativeElements?.description}</span></div>}
-        {adcreativeElements?.title && <div><strong>文案:</strong> <span style={{color:"#5a5a5a"}}>{adcreativeElements?.title}</span></div>}
-        {linkNameType && <div><strong>按钮文案:</strong> <span style={{color:"#5a5a5a"}}>{LinkPageNameTypeEnum[linkNameType]}</span></div>}
-        {linkPageType && <div><strong>跳转落地页:</strong> <span style={{color:"#5a5a5a"}}>{LinkPageTypeEnum[linkPageType]}</span></div>}
+        <div><strong>创意名称:</strong><span style={{ color: "#5a5a5a" }}>{adcreativeName}</span></div>
+        <div><strong>推广目标:</strong> <span style={{ color: "#5a5a5a" }}>{PromotedObjectType[promotedObjectType]}</span></div>
+        <div><strong>广告版位:</strong> <span style={{ color: "#5a5a5a" }}>{siteSet?.map((item: string) => SiteSetEnum[item]).toString()}</span></div>
+        <div><strong>创意形式: </strong><span style={{ color: "#5a5a5a" }}>{adcreativeTemplate?.find((item: any) => item?.adcreativeTemplateId === adcreativeTemplateId)?.adcreativeTemplateAppellation || ''}</span></div>
+        {adcreativeElements?.brand && <div><strong>品牌形象:</strong> <span style={{ color: "#5a5a5a" }}><img src={adcreativeElements?.brand?.brandImg} style={{ width: 20,marginRight:5 }} />{adcreativeElements?.brand?.brandName}</span></div>}
+        {adcreativeElements?.description && <div><strong>创意文案:</strong> <span style={{ color: "#5a5a5a" }}>{adcreativeElements?.description}</span></div>}
+        {adcreativeElements?.title && <div><strong>文案:</strong> <span style={{ color: "#5a5a5a" }}>{adcreativeElements?.title}</span></div>}
+        {linkNameType && <div><strong>按钮文案:</strong> <span style={{ color: "#5a5a5a" }}>{LinkPageNameTypeEnum[linkNameType]}</span></div>}
+        {linkPageType && <div><strong>跳转落地页:</strong> <span style={{ color: "#5a5a5a" }}>{LinkPageTypeEnum[linkPageType]}</span></div>}
+        {linkPageSpec?.pageUrl && <div><strong>落地页地址:</strong> <span style={{ color: "#5a5a5a" }}>{linkPageSpec?.pageUrl}</span></div>}
+        {linkPageSpec?.miniProgramSpec && linkPageSpec?.miniProgramSpec?.miniProgramId && <div><strong>小程序ID:</strong> <span style={{ color: "#5a5a5a" }}>{linkPageSpec?.miniProgramSpec?.miniProgramId}</span></div>}
+        {linkPageSpec?.miniProgramSpec && linkPageSpec?.miniProgramSpec?.miniProgramPath  && <div><strong>小程序地址:</strong> <span style={{ color: "#5a5a5a" }}>{linkPageSpec?.miniProgramSpec?.miniProgramPath}</span></div>}
+        {adcreativeElements?.endPage && <div><strong>视频结束页类型:</strong> <span style={{ color: "#5a5a5a" }}>{EndPageTypeEnum[adcreativeElements?.endPage?.endPageType]}</span></div>}
+        {adcreativeElements?.endPage && <div><strong>视频结束页文案:</strong> <span style={{ color: "#5a5a5a" }}>{adcreativeElements?.endPage?.endPageDesc}</span></div>}
         {adcreativeElements?.imageUrl && <div style={{ display: 'flex', alignItems: 'flex-start', marginBottom: 4 }}><strong>创意素材:</strong> <Image width={80} src={adcreativeElements?.imageUrl} style={{ borderRadius: 8, overflow: 'hidden', marginLeft: 5 }} /></div>}
         {adcreativeElements?.imageUrlList && <div style={{ display: 'flex', alignItems: 'flex-start', flexWrap: 'wrap' }}><span style={{ marginRight: 4 }}><strong>创意素材:</strong></span> <Image.PreviewGroup>
             <Space wrap>
                 {adcreativeElements?.imageUrlList?.map((url: string, index: number) => <Image width={50} src={url} style={{ borderRadius: 4 }} key={'TOP_SLIDER' + index} />)}
             </Space>
         </Image.PreviewGroup></div>}
-        {overrideCanvasHeadOption && <div><strong>素材选项:</strong> <span style={{color:"#5a5a5a"}}>{overrideCanvasHeadOptionEnum[overrideCanvasHeadOption]}</span></div>}
+        {overrideCanvasHeadOption && <div><strong>素材选项:</strong> <span style={{ color: "#5a5a5a" }}>{overrideCanvasHeadOptionEnum[overrideCanvasHeadOption]}</span></div>}
         {adcreativeElements?.shortVideoStruct?.shortVideo1Url && <div style={{ display: 'flex', alignItems: 'flex-start' }}><span style={{ marginRight: 4 }}><strong>创意素材:</strong></span> <video src={adcreativeElements?.shortVideoStruct?.shortVideo1Url} width={130} controls></video></div>}
         {adcreativeElements?.videoUrl && <div style={{ display: 'flex', alignItems: 'flex-start' }}><span style={{ marginRight: 4 }}><strong>创意素材:</strong></span> <video src={adcreativeElements?.videoUrl} width={130} controls></video></div>}
     </>

+ 123 - 71
src/pages/launchSystemNew/launchManage/createAd/creative/modal/index.tsx

@@ -245,6 +245,24 @@ function CreativePup(props: Props) {
                             }
                         }
                         break;
+                    case 'pageUrl'://跳转落地页
+                        newValues.linkPageSpec = {
+                            ...newValues.linkPageSpec,
+                            pageUrl: newValues.pageUrl
+                        }
+                        delete newValues.pageUrl
+                        break;
+                    case 'miniProgramId':
+                        newValues.linkPageSpec = {
+                            ...newValues.linkPageSpec,
+                            miniProgramSpec: {
+                                miniProgramId: newValues.miniProgramId,
+                                miniProgramPath: newValues.miniProgramPath
+                            }
+                        }
+                        delete newValues.miniProgramId
+                        delete newValues.miniProgramPath
+                        break;
                 }
             }
             if (!newValues.adcreativeElements) {
@@ -448,7 +466,9 @@ function CreativePup(props: Props) {
             // 视频结束页 end_page
             if (adcreative_template.adcreativeElements.some((item: { name: string }) => item.name === 'end_page')) {
                 // let endPageType =adcreative_template?.adcreativeElements?.filter(item=>item.name === 'end_page_type')[0]?.enumProperty?.enumeration
-                values = { ...values, endPageType: 'END_PAGE_AVATAR_NICKNAME_HIGHLIGHT' }
+                if(!ok){
+                    values = { ...values, endPageType: 'END_PAGE_AVATAR_NICKNAME_HIGHLIGHT' }
+                }
                 states = { ...states, sp_show: true }
             }
             setPupState(states)
@@ -495,8 +515,8 @@ function CreativePup(props: Props) {
     // 数据回填
     useEffect(() => {
         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 { adcreativeName, adcreativeTemplateId, conversionDataType, conversionTargetType, linkNameType, linkPageType, pageType, promotedObjectType, siteSet, adcreativeElements, overrideCanvasHeadOption, linkPageSpec } = dataInfo
+            let { description, imageUrl, title, videoUrl, imageUrlList, endPage, shortVideoStruct,brand } = adcreativeElements
             let obj: any = {
                 adcreativeName,
                 siteSet,
@@ -537,6 +557,15 @@ function CreativePup(props: Props) {
             if (overrideCanvasHeadOption) {
                 obj = { ...obj, overrideCanvasHeadOption }
             }
+            if (linkPageSpec?.pageUrl) {
+                obj = { ...obj, pageUrl:linkPageSpec?.pageUrl }
+            }
+            if (linkPageSpec?.miniProgramSpec && linkPageSpec?.miniProgramSpec?.miniProgramPath) {
+                obj = { ...obj, miniProgramPath:linkPageSpec?.miniProgramSpec?.miniProgramPath, miniProgramId:linkPageSpec?.miniProgramSpec?.miniProgramId }
+            }
+            if(brand && brand.brandImg && brand.brandName){
+                obj={...obj,brand:brand.brandName+'_'+brand.brandImg,}
+            }
             if (videoUrl) {
                 setVideoMaterialConfig({
                     cloudSize: [],
@@ -601,7 +630,6 @@ function CreativePup(props: Props) {
             message.warning('请先选择视频文件!!!')
         }
     }, [videoMaterialConfig.list])
-    console.log('linkPageList===>', linkPageList, linkPageType)
     return <Modal
         visible={visible}
         title={type === 'add' ? '新建创意' : type === 'look' ? '创意详情' : '编辑创意'}
@@ -708,86 +736,110 @@ function CreativePup(props: Props) {
                         {((overrideCanvasHeadOption !== 'OPTION_CANVAS_OVERRIDE_CREATIVE') || siteSet.every((name: string) => name !== 'SITE_SET_MOMENTS')) && <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 } : {}}>
+                                    return <Form.Item
+                                        label={<strong>{item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? '视频封面图' : item.description}</strong>}
+                                        key={item.name}
+                                    >
                                         {/* 视频 */}
                                         {
-                                            (item.name === 'short_video1' || item.name === 'video') && <div className={`${styles.box} ${styles.video}`} onClick={() => {
-                                                init({ mediaType: 'VIDEO', cloudSize: adcreativeTemplateId === 1708 ? [[{ relation: '=', width: 1280, height: 720 }]] : [[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]], maxSize: item.restriction.videoRestriction.fileSize * 1024 })
-                                                setTimeout(() => {
-                                                    set_selectVideoVisible(true)
-                                                    setVideoMaterialConfig({
-                                                        ...videoMaterialConfig,
-                                                        type: item.name,
-                                                        max: 1,
-                                                        adcreativeTemplateId
-                                                    })
-                                                }, 100)
-                                            }}>
-                                                <p>
-                                                    {
-                                                        videoMaterialConfig?.list[0] ? <video src={videoMaterialConfig?.list[0].url} controls /> : <>
-                                                            <span>{`推荐尺寸(${adcreativeTemplateId === 1708 ? 1280 : item.restriction.videoRestriction.minWidth} x ${adcreativeTemplateId === 1708 ? 720 : item.restriction.videoRestriction.minHeight})`}</span>
-                                                            <span>{`${item.restriction.videoRestriction.fileFormat?.map(str => str?.replace('MEDIA_TYPE_', ''))};< ${item.restriction.videoRestriction.fileSize / 1024}M;时长 ≥ ${item.restriction.videoRestriction.minDuration}s,≤ ${item.restriction.videoRestriction.maxDuration}s,必须带有声音`}</span>
-                                                        </>
-                                                    }
-                                                </p>
-                                            </div>
+                                            (item.name === 'short_video1' || item.name === 'video') && <Form.Item
+                                                noStyle
+                                                rules={[{ required: true, message: '请选择素材!' }]}
+                                                name={item.name}
+                                                style={item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? { order: 2 } : {}}
+                                            >
+                                                <div className={`${styles.box} ${styles.video}`} onClick={() => {
+                                                    init({ mediaType: 'VIDEO', cloudSize: adcreativeTemplateId === 1708 ? [[{ relation: '=', width: 1280, height: 720 }]] : [[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]], maxSize: item.restriction.videoRestriction.fileSize * 1024 })
+                                                    setTimeout(() => {
+                                                        set_selectVideoVisible(true)
+                                                        setVideoMaterialConfig({
+                                                            ...videoMaterialConfig,
+                                                            type: item.name,
+                                                            max: 1,
+                                                            adcreativeTemplateId
+                                                        })
+                                                    }, 100)
+                                                }}>
+                                                    <p>
+                                                        {
+                                                            videoMaterialConfig?.list[0] ? <video src={videoMaterialConfig?.list[0].url} controls /> : <>
+                                                                <span>{`推荐尺寸(${adcreativeTemplateId === 1708 ? 1280 : item.restriction.videoRestriction.minWidth} x ${adcreativeTemplateId === 1708 ? 720 : item.restriction.videoRestriction.minHeight})`}</span>
+                                                                <span>{`${item.restriction.videoRestriction.fileFormat?.map(str => str?.replace('MEDIA_TYPE_', ''))};< ${item.restriction.videoRestriction.fileSize / 1024}M;时长 ≥ ${item.restriction.videoRestriction.minDuration}s,≤ ${item.restriction.videoRestriction.maxDuration}s,必须带有声音`}</span>
+                                                            </>
+                                                        }
+                                                    </p>
+                                                </div>
+                                            </Form.Item>
                                         }
                                         {/* 单图 */}
                                         {
-                                            item.name === 'image' && <div className={`${styles.box} ${styles.image}`} onClick={() => {
-                                                init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]], maxSize: item.restriction.imageRestriction.fileSize * 1024 })
-                                                setTimeout(() => {
-                                                    set_selectImgVisible(true)
-                                                    setImgMaterialConfig({
-                                                        ...imgMaterialConfig,
-                                                        type: item.name,
-                                                        max: 1,
-                                                        adcreativeTemplateId
-                                                    })
-                                                }, 100)
+                                            item.name === 'image' && <Form.Item
+                                                noStyle
+                                                rules={[{ required: true, message: '请选择素材!' }]}
+                                                name={item.name}
+                                                style={item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? { order: 2 } : {}}
+                                            >
+                                                <div className={`${styles.box} ${styles.image}`} onClick={() => {
+                                                    init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]], maxSize: item.restriction.imageRestriction.fileSize * 1024 })
+                                                    setTimeout(() => {
+                                                        set_selectImgVisible(true)
+                                                        setImgMaterialConfig({
+                                                            ...imgMaterialConfig,
+                                                            type: item.name,
+                                                            max: 1,
+                                                            adcreativeTemplateId
+                                                        })
+                                                    }, 100)
 
-                                            }}>
-                                                <p>
-                                                    {imgMaterialConfig?.list[0] ? <img src={imgMaterialConfig?.list[0].url} /> : <>
-                                                        <span>{`推荐尺寸(${item.restriction.imageRestriction.width} x ${item.restriction.imageRestriction.height})`}</span>
-                                                        <span>{`${item.restriction.imageRestriction.fileFormat?.map(str => str?.replace('IMAGE_TYPE_', ''))};小于 ${item.restriction.imageRestriction.fileSize}KB`}</span>
-                                                    </>
-                                                    }
-                                                </p>
-                                            </div>
+                                                }}>
+                                                    <p>
+                                                        {imgMaterialConfig?.list[0] ? <img src={imgMaterialConfig?.list[0].url} /> : <>
+                                                            <span>{`推荐尺寸(${item.restriction.imageRestriction.width} x ${item.restriction.imageRestriction.height})`}</span>
+                                                            <span>{`${item.restriction.imageRestriction.fileFormat?.map(str => str?.replace('IMAGE_TYPE_', ''))};小于 ${item.restriction.imageRestriction.fileSize}KB`}</span>
+                                                        </>
+                                                        }
+                                                    </p>
+                                                </div>
+                                            </Form.Item>
                                         }
                                         {
                                             item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') && <Button onClick={videoToImgs} size='small' type='primary' disabled={!videoMaterialConfig.list[0]}>从视频生成封面图</Button>
                                         }
                                         {/* 多图 */}
                                         {
-                                            item.name === 'image_list' && <div className={`${styles.box} ${item.arrayProperty.maxNumber >= 3 ? styles.image_list : styles.image}`} onClick={() => {
-                                                init({ mediaType: 'IMG', num: item.arrayProperty.maxNumber, cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]], maxSize: item.restriction.imageRestriction.fileSize * 1024 })
-                                                setTimeout(() => {
-                                                    set_selectImgVisible(true)
-                                                    setImgMaterialConfig({
-                                                        ...imgMaterialConfig,
-                                                        type: item.name,
-                                                        max: item.arrayProperty.maxNumber,
-                                                        adcreativeTemplateId
-                                                    })
-                                                }, 100)
-                                            }}>
-                                                {
-                                                    Array(item.arrayProperty.maxNumber).fill('').map((arr, index) => {
-                                                        return <p key={index}>
-                                                            {
-                                                                imgMaterialConfig?.list[index] ? <img src={imgMaterialConfig?.list[index].url} /> : <>
-                                                                    <span>{`推荐尺寸(${item.restriction.imageRestriction.width} x ${item.restriction.imageRestriction.height})`}</span>
-                                                                    <span>{`${item.restriction.imageRestriction.fileFormat?.map(str => str?.replace('IMAGE_TYPE_', ''))};小于 ${item.restriction.imageRestriction.fileSize}KB`}</span>
-                                                                </>
-                                                            }
+                                            item.name === 'image_list' && <Form.Item
+                                                noStyle
+                                                rules={[{ required: true, message: '请选择素材!' }]}
+                                                name={item.name}
+                                                style={item.description === '图片' && adcreative_template?.adcreativeElements?.some(item => item.name === 'video') ? { order: 2 } : {}}
+                                            >
+                                                <div className={`${styles.box} ${item.arrayProperty.maxNumber >= 3 ? styles.image_list : styles.image}`} onClick={() => {
+                                                    init({ mediaType: 'IMG', num: item.arrayProperty.maxNumber, cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]], maxSize: item.restriction.imageRestriction.fileSize * 1024 })
+                                                    setTimeout(() => {
+                                                        set_selectImgVisible(true)
+                                                        setImgMaterialConfig({
+                                                            ...imgMaterialConfig,
+                                                            type: item.name,
+                                                            max: item.arrayProperty.maxNumber,
+                                                            adcreativeTemplateId
+                                                        })
+                                                    }, 100)
+                                                }}>
+                                                    {
+                                                        Array(item.arrayProperty.maxNumber).fill('').map((arr, index) => {
+                                                            return <p key={index}>
+                                                                {
+                                                                    imgMaterialConfig?.list[index] ? <img src={imgMaterialConfig?.list[index].url} /> : <>
+                                                                        <span>{`推荐尺寸(${item.restriction.imageRestriction.width} x ${item.restriction.imageRestriction.height})`}</span>
+                                                                        <span>{`${item.restriction.imageRestriction.fileFormat?.map(str => str?.replace('IMAGE_TYPE_', ''))};小于 ${item.restriction.imageRestriction.fileSize}KB`}</span>
+                                                                    </>
+                                                                }
 
-                                                        </p>
-                                                    })
-                                                }
-                                            </div>
+                                                            </p>
+                                                        })
+                                                    }
+                                                </div>
+                                            </Form.Item>
                                         }
                                     </Form.Item>
                                 })

+ 24 - 15
src/services/launchAdq/enum.ts

@@ -310,6 +310,9 @@ export enum PageTypeEnum {
 export enum LinkPageTypeEnum {
   LINK_PAGE_TYPE_CANVAS_WECHAT = '微信原生页',
   LINK_PAGE_TYPE_WECHAT_OFFICIAL_ACCOUNT_DETAIL = '微信公众号详情页',
+  LINK_PAGE_TYPE_DEFAULT = '默认落地页',
+  LINK_PAGE_TYPE_MINI_PROGRAM_WECHAT = '微信小程序',
+  LINK_PAGE_TYPE_NOT_USED='不开启文字链'
 }
 /**链接名称类型*/
 export enum LinkPageNameTypeEnum {
@@ -477,19 +480,25 @@ export const AdcreativeTemplateEnum = {
   '1529': '闪屏视频',
   '618': '常规视频',
   '1708': '卡片横版视频',
-  '711':'横版大图',
-  '714':'横版小图',
-  '718':'横版三小图',
-  '727':'卡卷广告',
-  '951':'PC横版大图',
-  '965':'PC横版通栏',
-  '712':'竖版大图',
-  '713':'通栏大图',
-  '910':'激励广告',
-  '925':'Banner图片',
-  '311':'常规大图',
-  '641':'常规三图',
-  '642':'常规四图',
-  '643':'常规六图',
-  '1707':'卡片横版大图'
+  '711': '横版大图',
+  '714': '横版小图',
+  '718': '横版三小图',
+  '727': '卡卷广告',
+  '951': 'PC横版大图',
+  '965': 'PC横版通栏',
+  '712': '竖版大图',
+  '713': '通栏大图',
+  '910': '激励广告',
+  '925': 'Banner图片',
+  '311': '常规大图',
+  '641': '常规三图',
+  '642': '常规四图',
+  '643': '常规六图',
+  '1707': '卡片横版大图',
 };
+
+/**视频结束页类型*/
+export enum EndPageTypeEnum {
+  END_PAGE_AVATAR_NICKNAME_HIGHLIGHT = '突出头像及昵称',
+  END_PAGE_DESCRIPTION_HIGHLIGHT = '突出文案',
+}