|
@@ -27,6 +27,7 @@ import Save from "./Save"
|
|
import { useLocalStorageState } from "ahooks"
|
|
import { useLocalStorageState } from "ahooks"
|
|
import SelectAccount from "./SelectAccount"
|
|
import SelectAccount from "./SelectAccount"
|
|
import PositionPackage from "../../components/PositionPackage"
|
|
import PositionPackage from "../../components/PositionPackage"
|
|
|
|
+import Audience from "../../components/Audience"
|
|
|
|
|
|
export const DispatchAddelivery = React.createContext<PULLIN.DispatchAddelivery | null>(null);
|
|
export const DispatchAddelivery = React.createContext<PULLIN.DispatchAddelivery | null>(null);
|
|
|
|
|
|
@@ -49,6 +50,7 @@ const Create: React.FC = () => {
|
|
const [sourceVisible, setSourceVisible] = useState<boolean>(false) // 选择数据源弹窗控制
|
|
const [sourceVisible, setSourceVisible] = useState<boolean>(false) // 选择数据源弹窗控制
|
|
const [conversionVisible, setConversionVisible] = useState<boolean>(false) // 选择转化归因控制
|
|
const [conversionVisible, setConversionVisible] = useState<boolean>(false) // 选择转化归因控制
|
|
const [positionPackageVisible, setPositionPackageVisible] = useState<boolean>(false) // 选择优量汇流量包
|
|
const [positionPackageVisible, setPositionPackageVisible] = useState<boolean>(false) // 选择优量汇流量包
|
|
|
|
+ const [audienceVisible, setAudienceVisible] = useState<boolean>(false) // 选择定向人群宝
|
|
const [materialData, setMaterialData] = useState<any>({}) // 素材数据
|
|
const [materialData, setMaterialData] = useState<any>({}) // 素材数据
|
|
const [textData, setTextData] = useState<any>({})
|
|
const [textData, setTextData] = useState<any>({})
|
|
const [tableData, setTableData] = useState<any>({})
|
|
const [tableData, setTableData] = useState<any>({})
|
|
@@ -269,7 +271,7 @@ const Create: React.FC = () => {
|
|
|
|
|
|
let isConversion = false
|
|
let isConversion = false
|
|
setAccountCreateLogs(Object.keys(accountIdParamVOMap || {}).map(accountId => {
|
|
setAccountCreateLogs(Object.keys(accountIdParamVOMap || {}).map(accountId => {
|
|
- const { productDTOS, wechatOfficialAccountsVO, pageList, landingPageVOS, userActionSetsList, excludeUnionPositionPackages, unionPositionPackages, conversionInfo, wechatChannelVO, wechatAppletList } = accountIdParamVOMap[accountId]
|
|
|
|
|
|
+ const { productDTOS, wechatOfficialAccountsVO, pageList, landingPageVOS, userActionSetsList, excludeUnionPositionPackages, unionPositionPackages, conversionInfo, wechatChannelVO, wechatAppletList, customAudience, excludedCustomAudience } = accountIdParamVOMap[accountId]
|
|
let data: PULLIN.AccountCreateLogsProps = {
|
|
let data: PULLIN.AccountCreateLogsProps = {
|
|
accountId: Number(accountId),
|
|
accountId: Number(accountId),
|
|
productList: productDTOS
|
|
productList: productDTOS
|
|
@@ -296,6 +298,12 @@ const Create: React.FC = () => {
|
|
if (wechatChannelVO) {
|
|
if (wechatChannelVO) {
|
|
data.videoChannelList = [wechatChannelVO]
|
|
data.videoChannelList = [wechatChannelVO]
|
|
}
|
|
}
|
|
|
|
+ if (customAudience) {
|
|
|
|
+ data.customAudience = customAudience
|
|
|
|
+ }
|
|
|
|
+ if (excludedCustomAudience) {
|
|
|
|
+ data.excludedCustomAudience = excludedCustomAudience
|
|
|
|
+ }
|
|
return data
|
|
return data
|
|
}))
|
|
}))
|
|
|
|
|
|
@@ -788,7 +796,7 @@ const Create: React.FC = () => {
|
|
if (l.materialType === 4) {
|
|
if (l.materialType === 4) {
|
|
return {
|
|
return {
|
|
type: l?.componentSubType?.includes('IMAGE_LIST') ? 'image_list' : l?.keyFrameImageUrl ? 'video' : 'image',
|
|
type: l?.componentSubType?.includes('IMAGE_LIST') ? 'image_list' : l?.keyFrameImageUrl ? 'video' : 'image',
|
|
- valueJson: JSON.stringify({
|
|
|
|
|
|
+ valueJson: JSON.stringify({
|
|
componentId: l.id,
|
|
componentId: l.id,
|
|
componentValue: l
|
|
componentValue: l
|
|
})
|
|
})
|
|
@@ -842,7 +850,7 @@ const Create: React.FC = () => {
|
|
}
|
|
}
|
|
const accountIdParamDTOMap: any = {}
|
|
const accountIdParamDTOMap: any = {}
|
|
accountCreateLogs.forEach(item => {
|
|
accountCreateLogs.forEach(item => {
|
|
- const { pageList, productList, userActionSetsList, unionPositionPackage, excludeUnionPositionPackage, accountId, wechatChannelList, newConversionList, videoChannelList } = item
|
|
|
|
|
|
+ const { pageList, productList, userActionSetsList, unionPositionPackage, excludeUnionPositionPackage, accountId, wechatChannelList, newConversionList, videoChannelList, customAudience, excludedCustomAudience } = item
|
|
|
|
|
|
const userActionSetsListDto = userActionSetsList?.map((item: any) => ({ id: item?.userActionSetId, type: item?.type })) // dataSourceId
|
|
const userActionSetsListDto = userActionSetsList?.map((item: any) => ({ id: item?.userActionSetId, type: item?.type })) // dataSourceId
|
|
|
|
|
|
@@ -868,6 +876,12 @@ const Create: React.FC = () => {
|
|
if (videoChannelList && creativeComponents?.brand?.[0]?.value?.jumpInfo?.pageType === 'PAGE_TYPE_WECHAT_CHANNELS_PROFILE') {
|
|
if (videoChannelList && creativeComponents?.brand?.[0]?.value?.jumpInfo?.pageType === 'PAGE_TYPE_WECHAT_CHANNELS_PROFILE') {
|
|
map.videoChannelId = videoChannelList?.[0]?.wechatChannelsAccountId
|
|
map.videoChannelId = videoChannelList?.[0]?.wechatChannelsAccountId
|
|
}
|
|
}
|
|
|
|
+ if (customAudience?.length) {
|
|
|
|
+ map.customAudience = customAudience
|
|
|
|
+ }
|
|
|
|
+ if (excludedCustomAudience?.length) {
|
|
|
|
+ map.excludedCustomAudience = excludedCustomAudience
|
|
|
|
+ }
|
|
|
|
|
|
accountIdParamDTOMap[accountId] = map
|
|
accountIdParamDTOMap[accountId] = map
|
|
})
|
|
})
|
|
@@ -993,6 +1007,7 @@ const Create: React.FC = () => {
|
|
<Button type="primary" danger={!accountCreateLogs?.some(item => item?.newConversionList?.length)} onClick={() => { setConversionVisible(true) }}>{accountCreateLogs?.some(item => item?.newConversionList?.length) ? <>重新选择转化归因<CheckOutlined style={{ color: '#FFF' }} /></> : '请选择转化归因'}</Button>
|
|
<Button type="primary" danger={!accountCreateLogs?.some(item => item?.newConversionList?.length)} onClick={() => { setConversionVisible(true) }}>{accountCreateLogs?.some(item => item?.newConversionList?.length) ? <>重新选择转化归因<CheckOutlined style={{ color: '#FFF' }} /></> : '请选择转化归因'}</Button>
|
|
}
|
|
}
|
|
{(siteSet?.includes('SITE_SET_MOBILE_UNION') || automaticSiteEnabled) && <Button onClick={() => { setPositionPackageVisible(true) }}>优量汇流量包(选填){accountCreateLogs?.some(item => item?.unionPositionPackage?.length || item?.excludeUnionPositionPackage?.length) && <CheckOutlined style={{ color: accountCreateLogs?.every(item => item?.unionPositionPackage?.length && item?.excludeUnionPositionPackage?.length) ? '#1890ff' : '#52C41A' }} />}</Button>}
|
|
{(siteSet?.includes('SITE_SET_MOBILE_UNION') || automaticSiteEnabled) && <Button onClick={() => { setPositionPackageVisible(true) }}>优量汇流量包(选填){accountCreateLogs?.some(item => item?.unionPositionPackage?.length || item?.excludeUnionPositionPackage?.length) && <CheckOutlined style={{ color: accountCreateLogs?.every(item => item?.unionPositionPackage?.length && item?.excludeUnionPositionPackage?.length) ? '#1890ff' : '#52C41A' }} />}</Button>}
|
|
|
|
+ <Button onClick={() => { setAudienceVisible(true) }}>自定义人群包(选填){accountCreateLogs?.some(item => item?.customAudience?.length || item?.excludedCustomAudience?.length) && <CheckOutlined style={{ color: accountCreateLogs?.every(item => item?.customAudience?.length && item?.excludedCustomAudience?.length) ? '#1890ff' : '#52C41A' }} />}</Button>
|
|
</>}
|
|
</>}
|
|
</Space>
|
|
</Space>
|
|
|
|
|
|
@@ -1123,6 +1138,18 @@ const Create: React.FC = () => {
|
|
clearData()
|
|
clearData()
|
|
}}
|
|
}}
|
|
/>}
|
|
/>}
|
|
|
|
+ {/* 自定义人群包 */}
|
|
|
|
+ {audienceVisible && <Audience
|
|
|
|
+ visible={audienceVisible}
|
|
|
|
+ data={accountCreateLogs}
|
|
|
|
+ onClose={() => setAudienceVisible(false)}
|
|
|
|
+ onChange={(e) => {
|
|
|
|
+ setIsDqSubmit(false)
|
|
|
|
+ setAccountCreateLogs(e);
|
|
|
|
+ setAudienceVisible(false);
|
|
|
|
+ clearData()
|
|
|
|
+ }}
|
|
|
|
+ />}
|
|
</Card>
|
|
</Card>
|
|
</Spin>
|
|
</Spin>
|
|
|
|
|