home.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. import { Pagination } from "@/types";
  2. import { server } from "@/utils/client";
  3. export type ActionType = 1 | 2 | 3 | 4 | 5 | 6 | 7 | undefined;
  4. /**
  5. * entity.HomeCategory
  6. */
  7. export interface GroupType {
  8. category: Category[];
  9. /**
  10. * 分类名字
  11. */
  12. category_name: string;
  13. /**
  14. * 隐藏模板中的厂商、类型两个标签。1:开启,2:关闭
  15. */
  16. hide_status: number;
  17. /**
  18. * 正序排序
  19. */
  20. sort: number;
  21. /**
  22. * 展示风格 展示风格,1:横排,2:竖排,3:竖排-分类左边-连续,4:竖排-分类左边-拆开
  23. */
  24. style_type: number;
  25. }
  26. /**
  27. * entity.Category
  28. */
  29. export interface Category {
  30. /**
  31. * 多语言名字
  32. */
  33. category_name: string;
  34. /**
  35. * 游戏列表
  36. */
  37. game_list: GameListRep[];
  38. /**
  39. * 前置图标 -就是名字前面的那个小标签
  40. */
  41. icon: string;
  42. /**
  43. * 图标类型,1:游戏图标,2:厂商图标',
  44. */
  45. icon_type: string;
  46. /**
  47. * 跳转ID
  48. */
  49. jump_id: number;
  50. /**
  51. * 每页展示多少条
  52. */
  53. line_config_amount: number;
  54. /**
  55. * 每页条数
  56. */
  57. line_num: number;
  58. /**
  59. * 是否显示厂商名称 厂商模块,1:开启,2:关闭
  60. */
  61. show_factory_name: number;
  62. /**
  63. * 是否显示游戏类型 游戏类型,1:开启,2:关闭
  64. */
  65. show_game_type: number;
  66. /**
  67. * 是否显示体育模块 体育模块,1:开启,2:关闭
  68. */
  69. show_sport: number;
  70. /**
  71. * 特殊显示 特殊显示,1:开启,2:关闭
  72. */
  73. special_show: string;
  74. /**
  75. * 标签
  76. */
  77. tag: string;
  78. /**
  79. * 当前分类的数量
  80. */
  81. to_tal: number;
  82. /**
  83. * 类型 1:game 2:brand 3:title
  84. */
  85. type: number;
  86. }
  87. /**
  88. * entity.GameListRep
  89. */
  90. export interface GameListRep {
  91. /**
  92. * 游戏ICON
  93. */
  94. game_icon: string;
  95. /**
  96. * 游戏ID
  97. */
  98. game_id: string;
  99. /**
  100. * 游戏名称
  101. */
  102. game_name: string;
  103. /**
  104. * 游戏名称中文
  105. */
  106. game_name_cn: string;
  107. /**
  108. * 游戏类型
  109. */
  110. game_type: string;
  111. /**
  112. * id
  113. */
  114. id: number;
  115. /**
  116. * 厂商名字 besoft 等等
  117. */
  118. provider: string;
  119. /**
  120. * 时间
  121. */
  122. release_date: string;
  123. }
  124. export const getGamesApi = () => {
  125. return server.post<GroupType[]>({
  126. url: "/v1/api/front/game_list",
  127. data: {},
  128. });
  129. };
  130. /**
  131. * @description
  132. * entity.GameInfo
  133. */
  134. export interface GameInfo {
  135. game_url: string;
  136. }
  137. /**
  138. * form.LoginGameReq
  139. */
  140. export interface GameRequest {
  141. /**
  142. * 玩家渠道,pc/mobile
  143. */
  144. channel?: string;
  145. /**
  146. * 用于显示全画面(部份游戏提供此功能)
  147. */
  148. full_screen?: boolean;
  149. /**
  150. * 游戏列表ID
  151. */
  152. id?: number;
  153. /**
  154. * 语言,cn/en
  155. */
  156. language?: string;
  157. /**
  158. * 用于主页按钮和重新导向 URL (部份游戏提供此功能)
  159. */
  160. return_url?: string;
  161. }
  162. export const getGameDetailApi = (data: GameRequest) => {
  163. return server.post<GameInfo>({
  164. url: "/v1/api/front/game_info_by_id",
  165. data,
  166. });
  167. };
  168. export interface BannerRep {
  169. /**
  170. * 点击参数
  171. */
  172. action_params?: string;
  173. /**
  174. * 点击功能, 1:无功能,2:跳转外部链接,3:跳转页面,4:跳转弹窗,5:跳转打开游戏,6:跳转Live Chat客服,7:跳转内部文档
  175. */
  176. action_type?: ActionType;
  177. /**
  178. * '轮播地址({"en": "https://www.baidu.com", "zh": "https://www.baidu.com"})',
  179. */
  180. content?: string;
  181. /**
  182. * id
  183. */
  184. id?: number;
  185. /**
  186. * 显示平台,1:全部,2:手机,3:PC
  187. */
  188. show_platform?: number;
  189. /**
  190. * sort 排序
  191. */
  192. sort?: number;
  193. }
  194. //获取banner
  195. export const getBannerApi = (data: any) => {
  196. return server.post<any>({
  197. url: "/v1/api/front/banner_list",
  198. data,
  199. });
  200. };
  201. export interface Content {
  202. image?: string;
  203. lang?: string;
  204. text?: string;
  205. title?: string;
  206. word?: string;
  207. }
  208. export interface NoticeRep {
  209. renter_id: number;
  210. id: number;
  211. send_time: number;
  212. action_type: ActionType;
  213. action_params: string;
  214. is_window: 1 | 2;
  215. desc: string;
  216. notice_type: string;
  217. status: number;
  218. content: Content;
  219. }
  220. export interface PromotionRep extends Omit<BannerRep, "content"> {
  221. content: Content;
  222. }
  223. export type SearchProps = {
  224. search_game_name: string;
  225. current_page: number;
  226. page_size: number;
  227. use_page: boolean;
  228. };
  229. // 获取游戏列表-(跳转 搜索)
  230. export const searchGameListApi = (props: SearchProps) => {
  231. return server.post<GameListRep[], Pagination>({
  232. url: "/v1/api/front/game_list_search",
  233. data: props,
  234. });
  235. };
  236. //获取公告系统
  237. export interface GlobalNoticeRep extends Omit<BannerRep, "content"> {
  238. content?: Content;
  239. send_time?: number;
  240. send_user_time?: number;
  241. }
  242. export const getGlobalNoticeApi = () => {
  243. return server.post<NoticeRep[]>({
  244. url: "/v1/api/front/notice_list",
  245. data: {},
  246. });
  247. };