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

91 lines
1.9 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';
2025-08-19 10:53:03 +08:00
import icon6 from '@/assets/img/platform/icon-bilibili.png';
import icon7 from '@/assets/img/platform/icon-ks.png';
import icon8 from '@/assets/img/platform/icon-sph.png';
import icon9 from '@/assets/img/platform/icon-wb.png';
import icon10 from '@/assets/img/platform/icon-gzh.png';
// 投放账户
export enum ENUM_PUT_ACCOUNT_PLATFORM {
jl = 0,
jg = 1,
bili = 2,
};
// 新媒体账号
export enum ENUM_MEDIA_ACCOUNT_PLATFORM {
dy = 0,
xhs = 1,
2025-08-19 10:53:03 +08:00
bili = 2,
ks = 3,
sph = 4,
wb = 5,
gzh = 6,
}
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,
},
2025-08-19 10:53:03 +08:00
{
label: 'B站',
value: 2,
icon: icon6,
},
{
label: '快手',
value: 3,
icon: icon7,
},
{
label: '视频号',
value: 4,
icon: icon8,
},
{
label: '微博',
value: 5,
icon: icon9,
},
{
label: '公众号',
value: 6,
icon: icon10,
},
];
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;
};