|
@@ -1,4 +1,4 @@
|
|
|
-import { Button, Card, Checkbox, Divider, Empty, Modal, Popconfirm, Select, Space, Spin, Table, Tabs, Tag, Tooltip, message, notification } from "antd"
|
|
|
+import { Button, Card, Checkbox, Divider, Empty, Modal, Popconfirm, Radio, Select, Space, Spin, Table, Tabs, Tag, Tooltip, message, notification } from "antd"
|
|
|
import React, { useEffect, useState } from "react"
|
|
|
import style from './index.less'
|
|
|
import '../index.less'
|
|
@@ -26,6 +26,7 @@ import { getCreativeDetailsApi } from "@/services/adqV3/global"
|
|
|
import ConversionSelect from "../../components/ConversionSelect"
|
|
|
import VideoChannel from "../../components/VideoChannel"
|
|
|
import Save from "./Save"
|
|
|
+import { useLocalStorageState } from "ahooks"
|
|
|
|
|
|
export const DispatchAddelivery = React.createContext<PULLIN.DispatchAddelivery | null>(null);
|
|
|
|
|
@@ -36,10 +37,11 @@ export const DispatchAddelivery = React.createContext<PULLIN.DispatchAddelivery
|
|
|
const Create: React.FC = () => {
|
|
|
|
|
|
/*******************************************/
|
|
|
+ const { initialState } = useModel('@@initialState');
|
|
|
const { getAllUserAccount } = useModel('useLaunchAdq.useAdAuthorize')
|
|
|
const { initTargeting } = useModel('useLaunchV3.useTargeting')
|
|
|
const [addelivery, setAddelivery] = useState<PULLIN.AddeliveryProps>({ adgroups: {}, targeting: [], dynamic: {}, dynamicMaterialDTos: {}, dynamicCreativesTextDTOS: {}, mediaType: 0 })
|
|
|
- const { marketingAssetOuterSpec, marketingCarrierType, marketingGoal, siteSet, automaticSiteEnabled, sceneSpec, isConversion } = addelivery.adgroups
|
|
|
+ const { marketingAssetOuterSpec, marketingCarrierType, marketingGoal, marketingSubGoal, siteSet, automaticSiteEnabled, sceneSpec, isConversion } = addelivery.adgroups
|
|
|
const { deliveryMode, creativeTemplateId, creativeComponents } = addelivery.dynamic
|
|
|
const [accSearch, setAccSearch] = useState<string>()
|
|
|
const [accountCreateLogs, setAccountCreateLogs] = useState<PULLIN.AccountCreateLogsProps[]>([]) // 账户
|
|
@@ -57,6 +59,8 @@ const Create: React.FC = () => {
|
|
|
const [dynamicCount, setDynamicCount] = useState<number>(0)
|
|
|
const [creativeTemplateAppellation, setCreativeTemplateAppellation] = useState<string>()
|
|
|
const [creativeTemplateStyle, setCreativeTemplateStyle] = useState<string>()
|
|
|
+ const [putInTypeList, setPutInTypeList] = useState<{ label: string, value: string }[]>([])
|
|
|
+ const [putInType, setPutInType] = useLocalStorageState<'NOVEL' | 'GAME'>('PUTINTYPE');
|
|
|
const [copyTask, setCopyTask] = useState<{ copyTaskId?: number, uuid?: string }>({})
|
|
|
|
|
|
const getGroupList = useAjax(() => getGroupListApi())
|
|
@@ -65,6 +69,26 @@ const Create: React.FC = () => {
|
|
|
const getCreativeDetails = useAjax((params) => getCreativeDetailsApi(params))
|
|
|
/*******************************************/
|
|
|
|
|
|
+ // 判断游戏还是小说短剧
|
|
|
+ useEffect(() => {
|
|
|
+ if (initialState?.menu?.data?.length) {
|
|
|
+ const menu = initialState?.menu?.data
|
|
|
+ const ADLAUNCH3 = menu.find((item: { path: string }) => item.path === "/launchSystemV3")
|
|
|
+ const ADLAUNCH2 = menu.find((item: { path: string }) => item.path === "/launchSystemNew")
|
|
|
+ const ACCOUNTLIST = ADLAUNCH3?.routes?.find((item: { path: string }) => item.path === "/launchSystemV3/account") || ADLAUNCH2?.routes?.find((item: { path: string }) => item.path === "/launchSystemNew/account")
|
|
|
+ let newputInTypeList: { label: string, value: string }[] = []
|
|
|
+ ACCOUNTLIST?.routes.forEach((item: { path: string }) => {
|
|
|
+ if (item.path.includes('novel')) {
|
|
|
+ newputInTypeList.push({ label: '小说/短剧投放', value: 'NOVEL' })
|
|
|
+ } else if (item.path.includes('game')) {
|
|
|
+ newputInTypeList.push({ label: '游戏投放', value: 'GAME' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setPutInTypeList(newputInTypeList);
|
|
|
+ newputInTypeList.length > 0 && setPutInType(type => (type && newputInTypeList.some(item => item.value === type) ? type : newputInTypeList[0].value) as 'NOVEL' | 'GAME');
|
|
|
+ }
|
|
|
+ }, [initialState?.menu])
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
// 获取账户组
|
|
|
getGroupList.run()
|
|
@@ -89,6 +113,10 @@ const Create: React.FC = () => {
|
|
|
} else {
|
|
|
params.siteSet = siteSet
|
|
|
}
|
|
|
+ params.taskType = putInType
|
|
|
+ if (putInType === 'GAME') {
|
|
|
+ params.marketingSubGoal = marketingSubGoal
|
|
|
+ }
|
|
|
getCreativeDetails.run(params).then(res => {
|
|
|
if (res?.adcreativeTemplateStructAdpermits?.length > 0) {
|
|
|
let adcreativeTemplateStructAdpermits = res?.adcreativeTemplateStructAdpermits[0]
|
|
@@ -115,7 +143,7 @@ const Create: React.FC = () => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- }, [creativeTemplateId, deliveryMode, marketingGoal, marketingAssetOuterSpec, marketingCarrierType, siteSet, sceneSpec?.wechatPosition, automaticSiteEnabled])
|
|
|
+ }, [creativeTemplateId, deliveryMode, marketingGoal, marketingAssetOuterSpec, marketingCarrierType, siteSet, sceneSpec?.wechatPosition, automaticSiteEnabled, putInType])
|
|
|
|
|
|
/** 获取分组里账号 */
|
|
|
const getGroupAccountList = (ids: number[]) => {
|
|
@@ -132,7 +160,7 @@ const Create: React.FC = () => {
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- setAccountCreateLogs(userArr?.map((item) => ({ accountId: item?.accountId })))
|
|
|
+ setAccountCreateLogs(userArr?.filter((item: any) => putInType === 'NOVEL' ? ['NOVEL', 'NOVEL_IAA'].includes(item.adUnitType) : putInType === 'GAME' ? ['GAME', 'GAME_IAA'].includes(item.adUnitType) : false)?.map((item) => ({ accountId: item?.accountId })))
|
|
|
clearData()
|
|
|
setAddelivery({ adgroups: {}, targeting: [], dynamic: {}, dynamicMaterialDTos: {}, dynamicCreativesTextDTOS: {}, mediaType: 0 })
|
|
|
} else {
|
|
@@ -146,18 +174,23 @@ const Create: React.FC = () => {
|
|
|
|
|
|
/** 存为预设 */
|
|
|
const severBd = () => {
|
|
|
- localStorage.setItem('ADQADV3', JSON.stringify({
|
|
|
- addelivery,
|
|
|
- accountCreateLogs,
|
|
|
- materialData,
|
|
|
- textData
|
|
|
- }))
|
|
|
- message.success('存储成功')
|
|
|
+ if (putInType) {
|
|
|
+ localStorage.setItem(putInType === 'GAME' ? 'ADQADV3_GAME' : 'ADQADV3', JSON.stringify({
|
|
|
+ addelivery,
|
|
|
+ accountCreateLogs,
|
|
|
+ materialData,
|
|
|
+ textData,
|
|
|
+ putInType
|
|
|
+ }))
|
|
|
+ message.success('存储成功')
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 清除 */
|
|
|
- const delBdPlan = () => {
|
|
|
- localStorage.removeItem('ADQADV3')
|
|
|
+ const delBdPlan = ({ isRemoveItem = true }: { isRemoveItem?: boolean }) => {
|
|
|
+ if (isRemoveItem) {
|
|
|
+ localStorage.removeItem(putInType === 'GAME' ? 'ADQADV3_GAME' : 'ADQADV3')
|
|
|
+ }
|
|
|
setAccountCreateLogs([])
|
|
|
setMaterialData({})
|
|
|
setTextData({})
|
|
@@ -175,124 +208,131 @@ const Create: React.FC = () => {
|
|
|
|
|
|
/**数据回填 */
|
|
|
useEffect(() => {
|
|
|
- let taskId = sessionStorage.getItem('TASKID3.0')
|
|
|
- let adqAdData = localStorage.getItem('ADQADV3')
|
|
|
- if (taskId) {
|
|
|
- getSelectTaskDetail.run(taskId).then(res => {
|
|
|
- if (res) {
|
|
|
- const { adgroupDTO, accountIdParamVOMap, targetings, dynamicCreativesDTO: { mediaType, ...dynamic }, dynamicCreativesTextDTO, dynamicMaterialDTOS, id, uuid } = res
|
|
|
- setCopyTask({ copyTaskId: id, uuid })
|
|
|
- let beginDate = adgroupDTO.beginDate
|
|
|
- let endDate = adgroupDTO.endDate
|
|
|
- if (adgroupDTO?.deepConversionSpec) {
|
|
|
- adgroupDTO.depthConversionEnabled = true
|
|
|
- } else {
|
|
|
- adgroupDTO.depthConversionEnabled = false
|
|
|
- }
|
|
|
- if (beginDate && moment(beginDate) < moment()) {
|
|
|
- beginDate = moment().format('YYYY-MM-DD')
|
|
|
- endDate = moment().add(7, 'day').format('YYYY-MM-DD')
|
|
|
- message.warning('请注意,检测投放开始日期小于今天,已自动改成今天,如需修改,请重新设置')
|
|
|
- }
|
|
|
- let dynamicGroup: any[] = []
|
|
|
- if (dynamic.deliveryMode === 'DELIVERY_MODE_CUSTOMIZE') {
|
|
|
- dynamicGroup = dynamicMaterialDTOS?.map((item: any[]) => {
|
|
|
- let { type, valueJson } = item[0]
|
|
|
- let value = JSON.parse(valueJson).value
|
|
|
- if (type === 'image') {
|
|
|
- return { image_id: { id: value.imageId, url: value.imageUrl, materialType: value.materialType } }
|
|
|
- } else if (type === 'image_list' || type === 'element_story') {
|
|
|
- return { [type]: value.list.map((l: { imageUrl: any; imageId: any; materialType: any }) => ({ url: l.imageUrl, id: l.imageId, materialType: l.materialType })) }
|
|
|
- } else if (type === 'short_video' || type === 'video') {
|
|
|
- let field = type === 'video' ? 'video_id' : 'short_video1'
|
|
|
- let videoData: any = {}
|
|
|
- videoData[field] = { materialType: value.materialType, url: value.videoUrl, id: value.videoId }
|
|
|
- if (value.imageUrl) {
|
|
|
- videoData['cover_id'] = { materialType: value.materialCoverType, url: value.imageUrl, id: value.iamgeId }
|
|
|
- }
|
|
|
- return videoData
|
|
|
+ if (putInTypeList?.length > 0) {
|
|
|
+ let taskId = sessionStorage.getItem('TASKID3.0')
|
|
|
+ let adqAdData = localStorage.getItem(putInType === 'GAME' ? 'ADQADV3_GAME' : 'ADQADV3')
|
|
|
+ if (taskId) {
|
|
|
+ getSelectTaskDetail.run(taskId).then(res => {
|
|
|
+ if (res) {
|
|
|
+ const { adgroupDTO, accountIdParamVOMap, targetings, dynamicCreativesDTO: { mediaType, ...dynamic }, dynamicCreativesTextDTO, dynamicMaterialDTOS, taskType = 'NOVEL', id, uuid } = res
|
|
|
+ setCopyTask({ copyTaskId: id, uuid })
|
|
|
+ if (putInTypeList.some(item => item.value === taskType)) {
|
|
|
+ setPutInType(() => taskType)
|
|
|
+ let beginDate = adgroupDTO.beginDate
|
|
|
+ let endDate = adgroupDTO.endDate
|
|
|
+ if (adgroupDTO?.deepConversionSpec) {
|
|
|
+ adgroupDTO.depthConversionEnabled = true
|
|
|
} else {
|
|
|
- return {}
|
|
|
+ adgroupDTO.depthConversionEnabled = false
|
|
|
}
|
|
|
- })
|
|
|
- } else { // 组件化创意
|
|
|
- dynamicGroup = dynamicMaterialDTOS?.map((item: any[]) => {
|
|
|
- return {
|
|
|
- list: item?.map((i: any) => {
|
|
|
- let { type, valueJson } = i
|
|
|
+ if (beginDate && moment(beginDate) < moment()) {
|
|
|
+ beginDate = moment().format('YYYY-MM-DD')
|
|
|
+ endDate = moment().add(7, 'day').format('YYYY-MM-DD')
|
|
|
+ message.warning('请注意,检测投放开始日期小于今天,已自动改成今天,如需修改,请重新设置')
|
|
|
+ }
|
|
|
+ let dynamicGroup: any[] = []
|
|
|
+ if (dynamic.deliveryMode === 'DELIVERY_MODE_CUSTOMIZE') {
|
|
|
+ dynamicGroup = dynamicMaterialDTOS?.map((item: any[]) => {
|
|
|
+ let { type, valueJson } = item[0]
|
|
|
let value = JSON.parse(valueJson).value
|
|
|
if (type === 'image') {
|
|
|
- return { id: value.imageId, url: value.imageUrl, materialType: value.materialType }
|
|
|
- } else if (type === 'image_list') {
|
|
|
- return value.list.map((l: { imageUrl: any; imageId: any; materialType: any }) => ({ url: l.imageUrl, id: l.imageId, materialType: l.materialType }))
|
|
|
- } else if (type === 'video') {
|
|
|
- return { materialType: value.materialType, url: value.videoUrl, id: value.videoId }
|
|
|
+ return { image_id: { id: value.imageId, url: value.imageUrl, materialType: value.materialType } }
|
|
|
+ } else if (type === 'image_list' || type === 'element_story') {
|
|
|
+ return { [type]: value.list.map((l: { imageUrl: any; imageId: any; materialType: any }) => ({ url: l.imageUrl, id: l.imageId, materialType: l.materialType })) }
|
|
|
+ } else if (type === 'short_video' || type === 'video') {
|
|
|
+ let field = type === 'video' ? 'video_id' : 'short_video1'
|
|
|
+ let videoData: any = {}
|
|
|
+ videoData[field] = { materialType: value.materialType, url: value.videoUrl, id: value.videoId }
|
|
|
+ if (value.imageUrl) {
|
|
|
+ videoData['cover_id'] = { materialType: value.materialCoverType, url: value.imageUrl, id: value.iamgeId }
|
|
|
+ }
|
|
|
+ return videoData
|
|
|
} else {
|
|
|
return {}
|
|
|
}
|
|
|
})
|
|
|
+ } else { // 组件化创意
|
|
|
+ dynamicGroup = dynamicMaterialDTOS?.map((item: any[]) => {
|
|
|
+ return {
|
|
|
+ list: item?.map((i: any) => {
|
|
|
+ let { type, valueJson } = i
|
|
|
+ let value = JSON.parse(valueJson).value
|
|
|
+ if (type === 'image') {
|
|
|
+ return { id: value.imageId, url: value.imageUrl, materialType: value.materialType }
|
|
|
+ } else if (type === 'image_list') {
|
|
|
+ return value.list.map((l: { imageUrl: any; imageId: any; materialType: any }) => ({ url: l.imageUrl, id: l.imageId, materialType: l.materialType }))
|
|
|
+ } else if (type === 'video') {
|
|
|
+ return { materialType: value.materialType, url: value.videoUrl, id: value.videoId }
|
|
|
+ } else {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
|
|
|
- let isConversion = false
|
|
|
- setAccountCreateLogs(Object.keys(accountIdParamVOMap || {}).map(accountId => {
|
|
|
- const { productDTOS, wechatOfficialAccountsVO, pageList, landingPageVOS, userActionSetsList, conversionInfo, wechatChannelVO, wechatAppletList } = accountIdParamVOMap[accountId]
|
|
|
- let data: PULLIN.AccountCreateLogsProps = {
|
|
|
- accountId: Number(accountId),
|
|
|
- productList: productDTOS
|
|
|
- }
|
|
|
- if (wechatOfficialAccountsVO) {
|
|
|
- data.wechatChannelList = [wechatOfficialAccountsVO]
|
|
|
- }
|
|
|
- if (pageList || landingPageVOS || wechatAppletList) {
|
|
|
- data.pageList = pageList || landingPageVOS || wechatAppletList?.map((item: { appletName: any; id: any }) => ({ ...item, pageName: item.appletName, pageId: item.id }))
|
|
|
- }
|
|
|
- if (userActionSetsList) {
|
|
|
- data.userActionSetsList = userActionSetsList
|
|
|
- }
|
|
|
- if (conversionInfo) {
|
|
|
- isConversion = true
|
|
|
- data.newConversionList = [conversionInfo]
|
|
|
- }
|
|
|
- if (wechatChannelVO) {
|
|
|
- data.videoChannelList = [wechatChannelVO]
|
|
|
- }
|
|
|
- return data
|
|
|
- }))
|
|
|
+ let isConversion = false
|
|
|
+ setAccountCreateLogs(Object.keys(accountIdParamVOMap || {}).map(accountId => {
|
|
|
+ const { productDTOS, wechatOfficialAccountsVO, pageList, landingPageVOS, userActionSetsList, conversionInfo, wechatChannelVO, wechatAppletList } = accountIdParamVOMap[accountId]
|
|
|
+ let data: PULLIN.AccountCreateLogsProps = {
|
|
|
+ accountId: Number(accountId),
|
|
|
+ productList: productDTOS
|
|
|
+ }
|
|
|
+ if (wechatOfficialAccountsVO) {
|
|
|
+ data.wechatChannelList = [wechatOfficialAccountsVO]
|
|
|
+ }
|
|
|
+ if (pageList || landingPageVOS || wechatAppletList) {
|
|
|
+ data.pageList = pageList || landingPageVOS || wechatAppletList?.map((item: { appletName: any; id: any }) => ({ ...item, pageName: item.appletName, pageId: item.id }))
|
|
|
+ }
|
|
|
+ if (userActionSetsList) {
|
|
|
+ data.userActionSetsList = userActionSetsList
|
|
|
+ }
|
|
|
+ if (conversionInfo) {
|
|
|
+ isConversion = true
|
|
|
+ data.newConversionList = [conversionInfo]
|
|
|
+ }
|
|
|
+ if (wechatChannelVO) {
|
|
|
+ data.videoChannelList = [wechatChannelVO]
|
|
|
+ }
|
|
|
+ return data
|
|
|
+ }))
|
|
|
|
|
|
- setAddelivery({
|
|
|
- adgroups: { ...adgroupDTO, isConversion, adgroupName: adgroupDTO.adgroupName + '_副本' + randomString(true, 3, 5), endDate, beginDate },
|
|
|
- targeting: targetings.map((item: any) => {
|
|
|
- const { targetingName, ...targeting } = item
|
|
|
- return { targetingName, targeting }
|
|
|
- }),
|
|
|
- dynamic,
|
|
|
- dynamicMaterialDTos: dynamicGroup.length > 0 ? { dynamicGroup } : {},
|
|
|
- dynamicCreativesTextDTOS: dynamicCreativesTextDTO,
|
|
|
- mediaType: mediaType || 0
|
|
|
- })
|
|
|
- sessionStorage.removeItem('TASKID3.0')
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (adqAdData) {
|
|
|
- const { addelivery, accountCreateLogs, materialData, textData } = JSON.parse(adqAdData)
|
|
|
- if (addelivery?.adgroups) {
|
|
|
- if (addelivery?.adgroups?.beginDate && moment(addelivery?.adgroups?.beginDate) < moment()) {
|
|
|
- addelivery.adgroups.beginDate = moment().format('YYYY-MM-DD')
|
|
|
- message.warning('请注意,检测投放开始日期小于今天,已自动改成今天,如需修改,请重新设置')
|
|
|
- }
|
|
|
- if (addelivery?.adgroups?.endDate && moment(addelivery?.adgroups?.endDate) < moment()) {
|
|
|
- addelivery.adgroups.endDate = moment().format('YYYY-MM-DD')
|
|
|
- message.warning('请注意,检测投放结束日期小于今天,已自动改成今天,如需修改,请重新设置')
|
|
|
+ setAddelivery({
|
|
|
+ adgroups: { ...adgroupDTO, isConversion, adgroupName: adgroupDTO.adgroupName + '_副本' + randomString(true, 3, 5), endDate, beginDate },
|
|
|
+ targeting: targetings.map((item: any) => {
|
|
|
+ const { targetingName, ...targeting } = item
|
|
|
+ return { targetingName, targeting }
|
|
|
+ }),
|
|
|
+ dynamic,
|
|
|
+ dynamicMaterialDTos: dynamicGroup.length > 0 ? { dynamicGroup } : {},
|
|
|
+ dynamicCreativesTextDTOS: dynamicCreativesTextDTO,
|
|
|
+ mediaType: mediaType || 0
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ message.error(`没有${taskType === 'NOVEL' ? '小说/短剧' : taskType === 'GAME' ? '游戏' : taskType}投放权限`)
|
|
|
+ }
|
|
|
+ sessionStorage.removeItem('TASKID3.0')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (adqAdData) {
|
|
|
+ const { addelivery, accountCreateLogs, materialData, textData } = JSON.parse(adqAdData)
|
|
|
+ if (addelivery?.adgroups) {
|
|
|
+ if (addelivery?.adgroups?.beginDate && moment(addelivery?.adgroups?.beginDate) < moment()) {
|
|
|
+ addelivery.adgroups.beginDate = moment().format('YYYY-MM-DD')
|
|
|
+ message.warning('请注意,检测投放开始日期小于今天,已自动改成今天,如需修改,请重新设置')
|
|
|
+ }
|
|
|
+ if (addelivery?.adgroups?.endDate && moment(addelivery?.adgroups?.endDate) < moment()) {
|
|
|
+ addelivery.adgroups.endDate = moment().format('YYYY-MM-DD')
|
|
|
+ message.warning('请注意,检测投放结束日期小于今天,已自动改成今天,如需修改,请重新设置')
|
|
|
+ }
|
|
|
}
|
|
|
+ setAddelivery({ ...addelivery })
|
|
|
+ setAccountCreateLogs(accountCreateLogs)
|
|
|
+ setMaterialData(materialData)
|
|
|
+ setTextData(textData)
|
|
|
}
|
|
|
- setAddelivery({ ...addelivery })
|
|
|
- setAccountCreateLogs(accountCreateLogs)
|
|
|
- setMaterialData(materialData)
|
|
|
- setTextData(textData)
|
|
|
}
|
|
|
- }, [])
|
|
|
+ }, [putInType, putInTypeList])
|
|
|
|
|
|
// 预览
|
|
|
const preview = () => {
|
|
@@ -350,7 +390,7 @@ const Create: React.FC = () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (!accountCreateLogs?.some(item => item?.pageList?.length)) {
|
|
|
+ if (!accountCreateLogs?.some(item => item?.pageList?.length) && !['PAGE_TYPE_WECHAT_MINI_GAME'].includes(dynamic?.creativeComponents?.mainJumpInfo?.[0]?.value?.pageType)) {
|
|
|
message.error('请先选择落地页')
|
|
|
return
|
|
|
}
|
|
@@ -484,6 +524,7 @@ const Create: React.FC = () => {
|
|
|
|
|
|
newAdCount += data.length
|
|
|
let newData: any[] = []
|
|
|
+ // 激励
|
|
|
if ([910].includes(dynamic.creativeTemplateId)) {
|
|
|
if (dynamic?.landingPageType === 1) {
|
|
|
let averageAdPageList: any[] = distributeArray(item.pageList, productList.length * targeting.length)
|
|
@@ -731,7 +772,9 @@ const Create: React.FC = () => {
|
|
|
|
|
|
let map: any = {
|
|
|
userActionSetsList: userActionSetsListDto,
|
|
|
- pageList: pageList?.map((item: { pageId: any }) => item.pageId)
|
|
|
+ }
|
|
|
+ if (!['PAGE_TYPE_WECHAT_MINI_GAME'].includes(dynamic?.creativeComponents?.mainJumpInfo?.[0]?.value?.pageType)) {
|
|
|
+ map.pageList = pageList?.map((item: { pageId: any }) => item.pageId)
|
|
|
}
|
|
|
if (productList && ['MARKETING_TARGET_TYPE_FICTION', 'MARKETING_TARGET_TYPE_SHORT_DRAMA'].includes(marketingAssetOuterSpec?.marketingTargetType)) {
|
|
|
map.productDTOS = productList?.map(item => {
|
|
@@ -763,9 +806,9 @@ const Create: React.FC = () => {
|
|
|
dynamicCreativesTextDTOS,
|
|
|
dynamicMaterialDTOS,
|
|
|
accountIdParamDTOMap,
|
|
|
+ taskType: putInType,
|
|
|
...copyTask
|
|
|
}
|
|
|
- // setSubVisible(false)
|
|
|
createAdgroupTask.run(params).then(res => {
|
|
|
if (res) {
|
|
|
Modal.success({
|
|
@@ -793,8 +836,19 @@ const Create: React.FC = () => {
|
|
|
<Spin spinning={createAdgroupTask.loading || getSelectTaskDetail.loading || getCreativeDetails.loading}>
|
|
|
<Card
|
|
|
size="small"
|
|
|
- title={<Space>
|
|
|
+ title={<Space size={18}>
|
|
|
<div className={style.cardTitle}>配置区</div>
|
|
|
+ {putInTypeList.length >= 1 && <Radio.Group
|
|
|
+ buttonStyle="solid"
|
|
|
+ value={putInType}
|
|
|
+ onChange={(e) => {
|
|
|
+ setPutInType(e.target.value)
|
|
|
+ delBdPlan({ isRemoveItem: false })
|
|
|
+ }}
|
|
|
+ options={putInTypeList}
|
|
|
+ optionType='button'
|
|
|
+ size="small"
|
|
|
+ />}
|
|
|
</Space>}
|
|
|
className={style.createAd}
|
|
|
>
|
|
@@ -861,7 +915,7 @@ const Create: React.FC = () => {
|
|
|
<Checkbox onChange={(e) => {
|
|
|
let data = []
|
|
|
if (e.target.checked) {
|
|
|
- data = JSON.parse(JSON.stringify(getAllUserAccount?.data?.data))
|
|
|
+ data = JSON.parse(JSON.stringify(getAllUserAccount?.data?.data?.filter((item: any) => putInType === 'NOVEL' ? ['NOVEL', 'NOVEL_IAA'].includes(item.adUnitType) : putInType === 'GAME' ? ['GAME', 'GAME_IAA'].includes(item.adUnitType) : false)))
|
|
|
if (accSearch) {
|
|
|
let newAccSearch = accSearch?.split(/[,,\n\s]+/ig).filter((item: any) => item)
|
|
|
data = data?.filter((item: any) => newAccSearch?.some(val => item!.accountId?.toString().toLowerCase()?.includes(val)))
|
|
@@ -873,7 +927,7 @@ const Create: React.FC = () => {
|
|
|
</>
|
|
|
)}
|
|
|
>
|
|
|
- {getAllUserAccount?.data?.data?.map((item: any) => <Select.Option value={item.accountId} key={item.id}>{item.remark ? item.accountId + '_' + item.remark : item.accountId}</Select.Option>)}
|
|
|
+ {getAllUserAccount?.data?.data?.filter((item: any) => putInType === 'NOVEL' ? ['NOVEL', 'NOVEL_IAA'].includes(item.adUnitType) : putInType === 'GAME' ? ['GAME', 'GAME_IAA'].includes(item.adUnitType) : false)?.map((item: any) => <Select.Option value={item.accountId} key={item.id}>{item.remark ? item.accountId + '_' + item.remark : item.accountId}</Select.Option>)}
|
|
|
</Select>
|
|
|
</Selector>
|
|
|
|
|
@@ -901,7 +955,8 @@ const Create: React.FC = () => {
|
|
|
setMaterialData,
|
|
|
textData,
|
|
|
setTextData,
|
|
|
- clearData
|
|
|
+ clearData,
|
|
|
+ putInType
|
|
|
}}>
|
|
|
<div className={style.settingsBody_content_right}>
|
|
|
{/* 广告信息 */}
|
|
@@ -926,11 +981,11 @@ const Create: React.FC = () => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<Space className={style.bts} wrap>
|
|
|
- <Save addelivery={addelivery} />
|
|
|
+ <Save addelivery={addelivery} putInType={putInType} />
|
|
|
<Button type='primary' onClick={severBd}>存为预设</Button>
|
|
|
<Popconfirm
|
|
|
title="确定清空?"
|
|
|
- onConfirm={delBdPlan}
|
|
|
+ onConfirm={() => delBdPlan({})}
|
|
|
>
|
|
|
<Button>清空配置/预设</Button>
|
|
|
</Popconfirm>
|
|
@@ -985,6 +1040,7 @@ const Create: React.FC = () => {
|
|
|
{/* 转化归因 */}
|
|
|
{conversionVisible && <ConversionSelect
|
|
|
adgroups={addelivery.adgroups}
|
|
|
+ putInType={putInType}
|
|
|
visible={conversionVisible}
|
|
|
data={accountCreateLogs}
|
|
|
onClose={() => setConversionVisible(false)}
|