home.ts 4.8 KB

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