Files
lingji-work-fe/src/utils/platform.ts

56 lines
1.2 KiB
TypeScript
Raw Normal View History

import icon1 from '@/assets/img/media-account/icon-jl.png';
import icon2 from '@/assets/img/media-account/icon-jg.png';
import icon3 from '@/assets/img/media-account/icon-bili.png';
2025-08-15 10:32:00 +08:00
import icon4 from '@/assets/img/platform/icon-dy.png';
import icon5 from '@/assets/img/platform/icon-xhs.png';
// 投放账户
export enum ENUM_PUT_ACCOUNT_PLATFORM {
jl = 0,
jg = 1,
bili = 2,
};
// 新媒体账号
export enum ENUM_MEDIA_ACCOUNT_PLATFORM {
dy = 0,
xhs = 1,
}
export const PLATFORM_LIST = [
{
label: '巨量',
value: ENUM_PUT_ACCOUNT_PLATFORM.jl,
icon: icon1,
},
{
label: '聚光',
value: ENUM_PUT_ACCOUNT_PLATFORM.jg,
icon: icon2,
},
{
label: 'B站',
value: ENUM_PUT_ACCOUNT_PLATFORM.bili,
icon: icon3,
},
];
export const MEDIA_ACCOUNT_PLATFORMS = [
{
label: '抖音',
value: 0,
icon: icon4,
},
{
label: '小红书',
value: 1,
icon: icon5,
},
];
export const getPutAccountPlatformLogo = (value: ENUM_PUT_ACCOUNT_PLATFORM) => {
return PLATFORM_LIST.find((v) => v.value === value)?.icon ?? null;
};
export const getMediaAccountPlatformLogo = (value: ENUM_MEDIA_ACCOUNT_PLATFORM) => {
return MEDIA_ACCOUNT_PLATFORMS.find((v) => v.value === value)?.icon ?? null;
};