import { Pagination } from "@/types"; import { server } from "@/utils/client"; export type ActionType = 1 | 2 | 3 | 4 | 5 | 6 | 7 | undefined; /** * entity.HomeCategory */ export interface GroupType { category: Category[]; /** * 分类名字 */ category_name: string; /** * 隐藏模板中的厂商、类型两个标签。1:开启,2:关闭 */ hide_status: number; /** * 正序排序 */ sort: number; /** * 展示风格 展示风格,1:横排,2:竖排,3:竖排-分类左边-连续,4:竖排-分类左边-拆开 */ style_type: number; } /** * entity.Category */ export interface Category { /** * 多语言名字 */ category_name: string; /** * 游戏列表 */ game_list: GameListRep[]; /** * 前置图标 -就是名字前面的那个小标签 */ icon: string; /** * 图标类型,1:游戏图标,2:厂商图标', */ icon_type: string; /** * 跳转ID */ jump_id: number; /** * 每页展示多少条 */ line_config_amount: number; /** * 每页条数 */ line_num: number; /** * 是否显示厂商名称 厂商模块,1:开启,2:关闭 */ show_factory_name: number; /** * 是否显示游戏类型 游戏类型,1:开启,2:关闭 */ show_game_type: number; /** * 是否显示体育模块 体育模块,1:开启,2:关闭 */ show_sport: number; /** * 特殊显示 特殊显示,1:开启,2:关闭 */ special_show: string; /** * 标签 */ tag: string; /** * 当前分类的数量 */ to_tal: number; /** * 类型 1:game 2:brand 3:title */ type: number; } /** * entity.GameListRep */ export interface GameListRep { /** * 游戏ICON */ game_icon: string; /** * 游戏ID */ game_id: string; /** * 游戏名称 */ game_name: string; /** * 游戏名称中文 */ game_name_cn: string; /** * 游戏类型 */ game_type: string; /** * id */ id: number; /** * 厂商名字 besoft 等等 */ provider: string; /** * 时间 */ release_date: string; } export const getGamesApi = () => { return server.post({ url: "/v1/api/front/game_list", data: {}, }); }; /** * @description * entity.GameInfo */ export interface GameInfo { game_url: string; } /** * form.LoginGameReq */ export interface GameRequest { /** * 玩家渠道,pc/mobile */ channel?: string; /** * 用于显示全画面(部份游戏提供此功能) */ full_screen?: boolean; /** * 游戏列表ID */ id?: number; /** * 语言,cn/en */ language?: string; /** * 用于主页按钮和重新导向 URL (部份游戏提供此功能) */ return_url?: string; } export const getGameDetailApi = (data: GameRequest) => { return server.post({ url: "/v1/api/front/game_info_by_id", data, }); }; export interface BannerRep { /** * 点击参数 */ action_params?: string; /** * 点击功能, 1:无功能,2:跳转外部链接,3:跳转页面,4:跳转弹窗,5:跳转打开游戏,6:跳转Live Chat客服,7:跳转内部文档 */ action_type?: ActionType; /** * '轮播地址({"en": "https://www.baidu.com", "zh": "https://www.baidu.com"})', */ content?: string; /** * id */ id?: number; /** * 显示平台,1:全部,2:手机,3:PC */ show_platform?: number; /** * sort 排序 */ sort?: number; } //获取banner export const getBannerApi = (data: any) => { return server.post({ url: "/v1/api/front/banner_list", data, }); }; export interface Content { image?: string; lang?: string; text?: string; title?: string; word?: string; } export interface NoticeRep { renter_id: number; id: number; send_time: number; action_type: ActionType; action_params: string; is_window: 1 | 2; desc: string; notice_type: string; status: number; content: Content; } export interface PromotionRep extends Omit { content: Content; } export type SearchProps = { search_game_name: string; current_page: number; page_size: number; use_page: boolean; }; // 获取游戏列表-(跳转 搜索) export const searchGameListApi = (props: SearchProps) => { return server.post({ url: "/v1/api/front/game_list_search", data: props, }); }; //获取公告系统 export interface GlobalNoticeRep extends Omit { content?: Content; send_time?: number; send_user_time?: number; } export const getGlobalNoticeApi = () => { return server.post({ url: "/v1/api/front/notice_list", data: {}, }); };