wjx преди 2 години
родител
ревизия
2db1adac17

+ 3 - 3
src/pages/launchSystemNew/components/addLandingPage/index.tsx

@@ -1387,7 +1387,7 @@ function AddLandingPage(props: Props) {
                                                                 <div className="adui-form-item" style={{ alignItems: 'flex-start' }}>
                                                                     <div className="adui-form-label" style={{ marginTop: 6 }}>标题</div>
                                                                     <div className="adui-form-control">
-                                                                        <Input.TextArea placeholder="请输入标题" onChange={(e) => { onShelfnewTxtCon(e.target.value?.replace(/\r|\n/ig, ""), 'title') }} value={imgTextData?.title} showCount maxLength={imageTextItemIndex === 1 ? 12 : 8} autoSize />
+                                                                        <Input.TextArea placeholder="请输入标题" onChange={(e) => { onShelfnewTxtCon(e.target.value?.replace(/\r|\n/ig, ""), 'title') }} value={imgTextData?.title} showCount maxLength={imageTextItemIndex === 1 ? 8 : 12} autoSize />
                                                                     </div>
                                                                 </div>
 
@@ -1399,7 +1399,7 @@ function AddLandingPage(props: Props) {
                                                                                 <Radio value="text">文字</Radio>
                                                                                 <Radio value="price" disabled>价格</Radio>
                                                                             </Radio.Group>
-                                                                            <Input.TextArea placeholder="请输入描述" onChange={(e) => { onShelfnewTxtCon(e.target.value?.replace(/\r|\n/ig, ""), 'desc') }} value={imgTextData?.desc} showCount maxLength={imageTextItemIndex === 1 ? 15 : 10} autoSize={{ minRows: 2, maxRows: 2 }} />
+                                                                            <Input.TextArea placeholder="请输入描述" onChange={(e) => { onShelfnewTxtCon(e.target.value?.replace(/\r|\n/ig, ""), 'desc') }} value={imgTextData?.desc} showCount maxLength={imageTextItemIndex === 1 ? 10 : 15} autoSize={{ minRows: 2, maxRows: 2 }} />
                                                                         </Space>
                                                                     </div>
                                                                 </div>
@@ -2035,7 +2035,7 @@ function AddLandingPage(props: Props) {
                         </div>
                         <div className={style.title}>营销组件</div>
                         <div className={style.assembly}>
-                            <div {...getDragPropsCon(`IMAGE_TEXT`)}> <ImgText /> <span className="my">图文复合组件</span> </div>
+                            {/* <div {...getDragPropsCon(`IMAGE_TEXT`)}> <ImgText /> <span className="my">图文复合组件</span> </div> */}
                             {componentItem?.some((item: { elementType: string }) => item.elementType === 'FLOAT_BUTTON') ?
                                 <div className={style.disabled}> <FloatbuttonSvg /> <span>悬浮组件</span></div> : <div {...getDragPropsCon(`FLOAT_BUTTON`)}> <FloatbuttonSvg /> <span className="my">悬浮组件</span></div>
                             }

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

@@ -119,6 +119,7 @@ const CreativeCL: React.FC<Props> = (props) => {
                     </Tooltip>}
                 </Space>
             </div>
+            {!(queryForm?.materialData && queryForm?.materialData?.length > 0) && <div className={style.noMaterial}>无需配置素材</div>}
         </Col>
         <Col className={style.conRightBorder} style={{ maxWidth: '25%' }}>
             <div className={style.top}>
@@ -159,6 +160,7 @@ const CreativeCL: React.FC<Props> = (props) => {
                     </Tooltip>}
                 </Space>
             </div>
+            {!(queryForm?.textData && queryForm.textData?.length > 0) && <div className={style.noMaterial}>无需配置文案</div>}
         </Col>
     </>
 }

+ 18 - 0
src/pages/launchSystemNew/launchManage/createAd/index.less

@@ -70,6 +70,7 @@
         box-sizing: border-box;
         display: flex;
         flex-direction: column;
+        position: relative;
 
         .top {
           height: 24px;
@@ -161,6 +162,7 @@
           line-height: 40px;
           display: flex;
           justify-content: center;
+          
 
           span {
             cursor: pointer;
@@ -171,6 +173,22 @@
             box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.08);
           }
         }
+
+        .noMaterial {
+          position: absolute;
+          background-color: rgba(0, 0, 0, .1);
+          top: 0;
+          left: 0;
+          right: 0;
+          bottom: 0;
+          width: 100%;
+          height: 100%;
+          display: flex;
+          justify-content: center;
+          align-items: center;
+          cursor: no-drop;
+          color: red;
+        }
       }
     }
   }

+ 20 - 7
src/pages/launchSystemNew/launchManage/createAd/index.tsx

@@ -273,7 +273,16 @@ const CreateAd: React.FC = () => {
 
     // 创意素材与文案叉乘处理
     const whatever = (...arrs: any[]) => {
-        return arrs.reduce((total, curr) => total.flatMap((e: any) => curr.map((e2: any) => ({ ...e2, ...e }))))
+        console.log('arrs---->', arrs);
+        if (arrs[0]?.length && arrs[1]?.length) {
+            return arrs.reduce((total, curr) => total.flatMap((e: any) => curr.map((e2: any) => ({ ...e2, ...e }))))
+        } else if (arrs[0]?.length) {
+            return arrs[0]
+        } else if (arrs[1]?.length) {
+            return arrs[1]
+        } else {
+            return ['']
+        }
     }
 
 
@@ -305,11 +314,11 @@ const CreateAd: React.FC = () => {
             return
         }
         if (launchMode === 2) {
-            if (!(newQueryForm?.materials && newQueryForm?.materials?.length > 0)) {
+            if ((queryForm?.materialData && queryForm?.materialData?.length > 0) && !(newQueryForm?.materials && newQueryForm?.materials?.length > 0)) {
                 message.error('请选择创意素材')
                 return
             }
-            if (!(newQueryForm?.texts && newQueryForm?.texts?.length > 0)) {
+            if ((queryForm?.textData && queryForm.textData?.length > 0) && !(newQueryForm?.texts && newQueryForm?.texts?.length > 0)) {
                 message.error('请选择创意文案')
                 return
             }
@@ -325,7 +334,7 @@ const CreateAd: React.FC = () => {
         }
         let data: any[] = []
         if (launchMode === 2) {
-            if (newQueryForm?.materials && Array.isArray(newQueryForm.materials) && newQueryForm?.texts && Array.isArray(newQueryForm?.texts)) {
+            if (Array.isArray(newQueryForm.materials) && Array.isArray(newQueryForm?.texts)) {
                 let taskMediaMap = JSON.parse(JSON.stringify(newQueryForm.taskMediaMaps[0]))
                 let adcreativeElements = taskMediaMap.sysAdcreative?.adcreativeElements || {}
                 let newTaskMediaMaps = whatever(newQueryForm.materials, newQueryForm.texts).map((item: any) => {
@@ -355,11 +364,15 @@ const CreateAd: React.FC = () => {
     const submit = (props: { campaignName: string, count?: number }) => {
         let newQueryForm = JSON.parse(JSON.stringify(queryForm))
         if (launchMode === 2) {
-            if (newQueryForm?.materials && Array.isArray(newQueryForm.materials) && newQueryForm?.texts && Array.isArray(newQueryForm?.texts)) {
+            if (Array.isArray(newQueryForm.materials) && Array.isArray(newQueryForm?.texts)) {
                 let taskMediaMap = JSON.parse(JSON.stringify(newQueryForm.taskMediaMaps[0]))
                 let adcreativeElements = taskMediaMap.sysAdcreative?.adcreativeElements || {}
                 let newTaskMediaMaps = whatever(newQueryForm.materials, newQueryForm.texts).map((item: any) => {
-                    taskMediaMap.sysAdcreative.adcreativeElements = { ...adcreativeElements, ...item }
+                    if (item) {
+                        taskMediaMap.sysAdcreative.adcreativeElements = { ...adcreativeElements, ...item }
+                    } else {
+                        taskMediaMap.sysAdcreative.adcreativeElements = { ...adcreativeElements }
+                    }
                     return JSON.parse(JSON.stringify(taskMediaMap))
                 })
                 newQueryForm.taskMediaMaps = newTaskMediaMaps
@@ -611,7 +624,7 @@ const CreateAd: React.FC = () => {
         set_targetKey('0')
     }
 
-    console.log('queryForm111111', queryForm, accountCreateLogs);
+    console.log('queryForm111111---->', queryForm, accountCreateLogs);
 
     return <Space direction="vertical" style={{ width: '100%' }}>
         <Card

+ 12 - 11
src/pages/launchSystemNew/launchManage/taskList/logTableConfig.tsx

@@ -170,12 +170,24 @@ function tableConfig(copyCreative: (data: any) => void, callback: (data: any) =>
                 }
             }
         },
+        {
+            title: '创建时间',
+            dataIndex: 'createTime',
+            key: 'createTime',
+            align: 'center',
+            width: 160,
+            ellipsis: true,
+            render: (a: any, b: any) => {
+                return <span style={{ fontSize: "12px" }}>{a || '--'}</span>
+            }
+        },
         {
             title: '创建状态',
             dataIndex: 'createStatus',
             key: 'createStatus',
             align: 'center',
             width: 90,
+            fixed: 'right',
             render: (a: any, b: any) => {
                 if (a) {
                     return a === 0 ? <Badge status="warning" text={<span style={{ fontSize: "12px" }}>创建中</span>} /> : a === 100 ? <Badge status="success" text={<span style={{ fontSize: "12px" }}>创建成功</span>} /> : <Badge status="error" text={<span style={{ fontSize: "12px" }}>创建失败</span>} />
@@ -184,17 +196,6 @@ function tableConfig(copyCreative: (data: any) => void, callback: (data: any) =>
                 }
             }
         },
-        {
-            title: '创建时间',
-            dataIndex: 'createTime',
-            key: 'createTime',
-            align: 'center',
-            width: 160,
-            ellipsis: true,
-            render: (a: any, b: any) => {
-                return <span style={{ fontSize: "12px" }}>{a || '--'}</span>
-            }
-        },
         {
             title: <span style={{ padding: '0 8px' }}>失败原因</span>,
             dataIndex: 'failMsgs',