Browse Source

Merge branch 'wangjianxin' of http://git.zanxiangnet.com/wjx/ad-manage into develop

wjx 2 years ago
parent
commit
5cc87ffc98

+ 2 - 2
src/components/FileBoxAD/index.less

@@ -396,8 +396,8 @@
 .wxSelect {
   position: absolute;
   top: 0;
-  right: 20px;
-  width: 200px;
+  right: 0;
+  // width: 200px;
 
   >div {
     margin-top: 0 !important;

+ 3 - 4
src/components/FileBoxAD/index.tsx

@@ -59,7 +59,6 @@ function FlieBox(props: Props) {
     const [moveId, setMoveId] = useState<any>('')//移动的素材ID
     const [treeEl, item, folderId, setActionId, setHoverId] = TreeBox({ data: get_folder_tree.data, belongUser })
     const [listData, setListData] = useState<any>({})
-    const [imgVisible, setImgVisible] = useState<boolean>(false)
 
     // 获取数据
     useEffect(() => {
@@ -184,7 +183,7 @@ function FlieBox(props: Props) {
             },
         }
     }, [folderId, moveId, mediaType])
-    
+
 
     return <div style={{ display: 'flex', flexFlow: 'row' }}>
         {get_folder_tree?.data?.length > 0 && <div style={{ flexShrink: 0 }}>
@@ -194,7 +193,7 @@ function FlieBox(props: Props) {
             <div className={style.files} onContextMenu={rightMenu} style={height ? { height } : {}}>
                 {/* 关联公众号筛选 */}
                 <div className={style.wxSelect}>
-
+                    
                 </div>
                 {/* 层级路径 */}
                 <div className={style.path} >
@@ -296,7 +295,7 @@ function FlieBox(props: Props) {
                                             topName = "顶部视频"
                                             El = <div className={style.pageVideo}>
                                                 <span className={style.pagePreview} onClick={(e) => { e.stopPropagation(); setPage && setPage(1, item.id) }}><EyeOutlined /> 预览</span>
-                                                <video src={topPageElements?.topVideoSpec?.videoUrl} style={{ width: 130, height: 100 }} controls/>
+                                                <video src={topPageElements?.topVideoSpec?.videoUrl} style={{ width: 130, height: 100 }} controls />
                                             </div>
                                             break
                                     }

+ 1 - 2
src/pages/launchSystemNew/components/lookLanding/index.tsx

@@ -1,8 +1,7 @@
 import { Carousel, Drawer, Spin } from "antd";
-import React, { useEffect, useMemo, useReducer, useState } from "react"
+import React, { useEffect, useMemo, useState } from "react"
 import { ReactComponent as Topimg } from '@/assets/topimg.svg'
 import { ReactComponent as Img } from '@/assets/img.svg'
-import { ReactComponent as SliderImgSvg } from '@/assets/sliderImgSvg.svg'
 
 import style from './index.less'
 import '../addLandingPage/index1.less'

+ 1 - 1
src/pages/launchSystemNew/components/pageModal/tableConfig.tsx

@@ -16,7 +16,7 @@ let columns = () => [
         title: '落地页名称',
         dataIndex: 'pageName',
         key: 'pageName',
-        align: 'center',
+        ellipsis: true
     },
     {
         title: '落地页类型',

+ 11 - 4
src/pages/launchSystemNew/components/selectCloud/index.tsx

@@ -1,8 +1,8 @@
-import { Image, message, Modal, Space, Tabs } from "antd"
-import React, { useEffect, useState } from "react"
+import { Button, Image, message, Modal, Space, Tabs, Tooltip } from "antd"
+import React, { useEffect } from "react"
 import { useModel } from "umi"
 import FileBoxAD from "@/components/FileBoxAD"
-import { CloseCircleFilled } from "@ant-design/icons"
+import { CloseCircleFilled, QuestionCircleFilled } from "@ant-design/icons"
 import style from './index.less'
 
 interface Props {
@@ -85,7 +85,14 @@ const SelectCloud: React.FC<Props> = (props) => {
         maskClosable={false}
         bodyStyle={{ padding: 0 }}
     >
-        <Tabs onChange={(activeKey: any) => { set({ belongUser: activeKey }) }} activeKey={belongUser} style={{ margin: '0 24px' }}>
+        <Tabs onChange={(activeKey: any) => { set({ belongUser: activeKey }) }} activeKey={belongUser} style={{ margin: '0 24px' }} tabBarExtraContent={<Space>
+            {
+                mediaType === 'PAGE' ? null : <Button size='small' type="primary" onClick={() => { set({ imgVisrible: true }) }}>新建素材</Button>
+            }
+            <Tooltip title="功能都在下方内容区右键" placement="left">
+                <QuestionCircleFilled />
+            </Tooltip>
+        </Space>}>
             <Tabs.TabPane tab={'个人本地'} key={1} />
             <Tabs.TabPane tab={'公共本地'} key={0} />
         </Tabs>

+ 10 - 8
src/pages/launchSystemNew/launchManage/createAd/index.tsx

@@ -214,9 +214,11 @@ const CreateAd: React.FC = () => {
             message.error('请设置创意的基本信息')
             return
         }
-        if (!queryForm.sysPageId) {
-            message.error('请选择落地页')
-            return
+        if (!accountCreateLogs?.every((item: any) => item.pageList?.length > 0)) { // 所有都选云端
+            if (!queryForm.sysPageId) {
+                message.error('请选择落地页')
+                return
+            }
         }
         let data = accountCreateLogs.map((item: any, index) => {
             return { ...item, ...queryForm, sysAdGroupData: getSysAdgroups?.data, targetingData: getsysTargeting?.data, sysAdcreativeData: { ...getSysAdcreative?.data }, pageData: get?.data }
@@ -304,9 +306,9 @@ const CreateAd: React.FC = () => {
                         maxTagCount={1}
                         allowClear
                         bordered={false}
-                        filterOption={(input: any, option: any) =>
-                            (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
-                        }
+                        filterOption={(input: any, option: any) => {
+                            return option!.children?.toString().toLowerCase().includes(input.toLowerCase())
+                        }}
                         value={accountCreateLogs?.map((item: { id: number }) => item?.id)}
                         onChange={(e, option) => {
                             setAccountCreateLogs(option?.map((item: any) => ({ adAccountId: item?.children, id: item?.value })))
@@ -344,7 +346,7 @@ const CreateAd: React.FC = () => {
                                 <div className={style.center}>
                                     <Spin spinning={getSysAdgroups.loading}>
                                         <div className={style.centerContent}>
-                                            {getSysAdgroups?.data ? <AdgroupsCol data={getSysAdgroups?.data} /> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />}
+                                            {(getSysAdgroups?.data && queryForm?.sysAdgroupId) ? <AdgroupsCol data={getSysAdgroups?.data} /> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />}
                                         </div>
                                     </Spin>
                                 </div>
@@ -518,7 +520,7 @@ const CreateAd: React.FC = () => {
                                 <div className={style.center}>
                                     <Spin spinning={get.loading}>
                                         <div className={style.centerContent}>
-                                            {(queryForm?.sysPageId || accountCreateLogs?.some((item: any) => item.pageList?.length > 0) && !Object.keys(get?.data)?.includes('fail')) ? <>
+                                            {accountCreateLogs?.some((item: any) => item.pageList?.length > 0 || (queryForm?.sysPageId && (get?.data && !Object.keys(get?.data)?.includes('fail'))))  ? <>
                                                 {(queryForm?.sysPageId && !accountCreateLogs?.every((item: any) => item.pageList?.length > 0)) && <>
                                                     <div>落地页名称:{get?.data?.pageName || ''}</div>
                                                     <div>分享名称:{get?.data?.shareContentSpec?.shareTitle || ''}</div>

+ 13 - 4
src/pages/launchSystemNew/material/cloud/index.tsx

@@ -1,6 +1,7 @@
 import FlieBox from '@/components/FileBoxAD'
 import HocError from '@/Hoc/HocError'
-import { Tabs } from 'antd'
+import { QuestionCircleFilled } from '@ant-design/icons'
+import { Button, Space, Tabs, Tooltip } from 'antd'
 import React, { useEffect, useRef, useState } from 'react'
 import { useModel } from 'umi'
 import AddLandingPage from '../../components/addLandingPage'
@@ -38,10 +39,18 @@ function Cloud() {
             className={style.card}
             activeKey={mediaType}
         >
+
             {
                 ['IMG', 'VIDEO', 'PAGE'].map((key: any) => {
                     return <TabPane tab={typeEnum[key]} key={key} style={{ backgroundColor: '#fff', padding: '0 15px' }} >
-                        <Tabs onChange={(activeKey: any) => { set({ belongUser: activeKey }) }} activeKey={belongUser}>
+                        <Tabs onChange={(activeKey: any) => { set({ belongUser: activeKey }) }} activeKey={belongUser} tabBarExtraContent={<Space>
+                            {
+                                mediaType === 'PAGE' ? <Button type="primary" size='small' onClick={() => { setVisible(true) }}>新建素材</Button> : <Button size='small' type="primary" onClick={() => { set({ imgVisrible: true }) }}>新建素材</Button>
+                            }
+                            <Tooltip title="功能都在下方内容区右键" placement="left">
+                                <QuestionCircleFilled />
+                            </Tooltip>
+                        </Space>}>
                             <TabPane tab={'个人本地'} key={1} />
                             <TabPane tab={'公共本地'} key={0} />
                         </Tabs>
@@ -60,11 +69,11 @@ function Cloud() {
             }
         </Tabs>
         {/* 落地页新增 复制 */}
-        {visible && <AddLandingPage visible={visible} hideModal={() => setVisible(false)} ajax={list} id={id}/>}
+        {visible && <AddLandingPage visible={visible} hideModal={() => setVisible(false)} ajax={list} id={id} />}
         {/* 查看落地页 */}
         {lookVisible && <LookLanding visible={lookVisible} onClose={() => setLookVisible(false)} id={id} />}
         {/* 批量复制 */}
-        {copyVisible && <BathLauCopy visible={copyVisible} onClose={() => setCopyVisible(false)} id={id} ajaxHome={list}/>}
+        {copyVisible && <BathLauCopy visible={copyVisible} onClose={() => setCopyVisible(false)} id={id} ajaxHome={list} />}
     </div>
 
 }