home.ts 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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. * @description 分组类型
  26. * 1 普通游戏(现金+ 彩金) 2:免费币 3:重玩币"
  27. */
  28. bet_type: 1 | 2 | 3;
  29. image: string;
  30. }
  31. /**
  32. * entity.Category
  33. */
  34. export interface Category {
  35. /**
  36. * 厂商图标
  37. */
  38. image: string;
  39. /**
  40. * 多语言名字
  41. */
  42. category_name: string;
  43. /**
  44. * 游戏列表
  45. */
  46. game_list: GameListRep[];
  47. /**
  48. * 前置图标 -就是名字前面的那个小标签
  49. */
  50. icon: string;
  51. /**
  52. * 图标类型,1:游戏图标,2:厂商图标',
  53. */
  54. icon_type: string;
  55. /**
  56. * 跳转ID
  57. */
  58. jump_id: number;
  59. /**
  60. * 每页展示多少条
  61. */
  62. line_config_amount: number;
  63. /**
  64. * 每页条数
  65. */
  66. line_num: number;
  67. /**
  68. * 是否显示厂商名称 厂商模块,1:开启,2:关闭
  69. */
  70. show_factory_name: number;
  71. /**
  72. * 是否显示游戏类型 游戏类型,1:开启,2:关闭
  73. */
  74. show_game_type: number;
  75. /**
  76. * 是否显示体育模块 体育模块,1:开启,2:关闭
  77. */
  78. show_sport: number;
  79. /**
  80. * 特殊显示 特殊显示,1:开启,2:关闭
  81. */
  82. special_show: string;
  83. /**
  84. * 标签
  85. */
  86. tag: string;
  87. /**
  88. * 当前分类的数量
  89. */
  90. to_tal: number;
  91. /**
  92. * 类型 1:game 2:brand 3:title
  93. */
  94. type: number;
  95. /**
  96. * @description 分组类型
  97. * 1 普通游戏(现金+ 彩金) 2:免费币 3:重玩币"
  98. */
  99. bet_type: 1 | 2 | 3;
  100. }
  101. /**
  102. * entity.GameListRep
  103. */
  104. export interface GameListRep {
  105. /**
  106. * 游戏ICON
  107. */
  108. game_icon: string;
  109. /**
  110. * 游戏ID
  111. */
  112. game_id: string;
  113. /**
  114. * 游戏名称
  115. */
  116. game_name: string;
  117. /**
  118. * 游戏名称中文
  119. */
  120. game_name_cn: string;
  121. /**
  122. * 游戏类型
  123. */
  124. game_type: string;
  125. /**
  126. * id
  127. */
  128. id: number;
  129. /**
  130. * 厂商名字 besoft 等等
  131. */
  132. provider: string;
  133. /**
  134. * 时间
  135. */
  136. release_date: string;
  137. // 自定义demo试玩
  138. demo?: number;
  139. // 自定义游戏类型
  140. category_name?: string;
  141. coin_types?: number;
  142. }
  143. /**
  144. * @description 大奖展示
  145. */
  146. export interface PrizeTypes {
  147. amount: number;
  148. phone: string;
  149. id: number;
  150. provider: string;
  151. game_id: string;
  152. game_name: string;
  153. game_name_cn: string;
  154. release_date: string;
  155. game_icon: string;
  156. game_type: string;
  157. coin_types: number;
  158. }
  159. export const getGamesApi = () => {
  160. return server.post<GroupType[]>({
  161. url: "/v1/api/front/game_list",
  162. data: {},
  163. });
  164. };
  165. /**
  166. * @description
  167. * entity.GameInfo
  168. */
  169. export interface GameInfo {
  170. game_url: string;
  171. brand_id: string;
  172. }
  173. /**
  174. * form.LoginGameReq
  175. */
  176. export interface GameRequest {
  177. /**
  178. * 玩家渠道,pc/mobile
  179. */
  180. channel?: string;
  181. /**
  182. * 用于显示全画面(部份游戏提供此功能)
  183. */
  184. full_screen?: boolean;
  185. /**
  186. * 游戏列表ID
  187. */
  188. id: string;
  189. /**
  190. * 语言,cn/en
  191. */
  192. language?: string;
  193. /**
  194. * 用于主页按钮和重新导向 URL (部份游戏提供此功能)
  195. */
  196. return_url?: string;
  197. mode?: 1 | 2 | 3;
  198. }
  199. export const getGameDetailApi = (data: GameRequest) => {
  200. return server.post<GameInfo>({
  201. url: "/v1/api/front/game_info_by_id",
  202. data,
  203. });
  204. };
  205. export interface BannerRep {
  206. /**
  207. * 点击参数
  208. */
  209. action_params?: string;
  210. /**
  211. * 点击功能, 1:无功能,2:跳转外部链接,3:跳转页面,4:跳转弹窗,5:跳转打开游戏,6:跳转Live Chat客服,7:跳转内部文档
  212. */
  213. action_type?: ActionType;
  214. /**
  215. * '轮播地址({"en": "https://www.baidu.com", "zh": "https://www.baidu.com"})',
  216. */
  217. content?: string;
  218. /**
  219. * id
  220. */
  221. id?: number;
  222. /**
  223. * 显示平台,1:全部,2:手机,3:PC
  224. */
  225. show_platform?: number;
  226. /**
  227. * sort 排序
  228. */
  229. sort?: number;
  230. is_badge?: boolean;
  231. }
  232. export interface Content {
  233. image?: string;
  234. lang?: string;
  235. text?: string;
  236. title?: string;
  237. word?: string;
  238. }
  239. export interface NoticeRep {
  240. renter_id: number;
  241. id: number;
  242. send_time: number;
  243. action_type: ActionType;
  244. action_params: string;
  245. is_window: 1 | 2;
  246. desc: string;
  247. notice_type: string;
  248. status: number;
  249. content: Content;
  250. is_read: boolean;
  251. }
  252. export interface PromotionRep extends Omit<BannerRep, "content"> {
  253. content: Content;
  254. activity_id: number;
  255. pop_type: 1 | 2 | 3; //1一天一次;2登录弹出;3返回大厅弹出
  256. content_type: 1 | 2 | 3; //1图片,2文本,3方法
  257. }
  258. export type SearchProps = {
  259. search_game_name?: string;
  260. current_page: number;
  261. page_size: number;
  262. use_page: boolean;
  263. provider_id?: number;
  264. category_id?: number;
  265. };
  266. // 获取游戏列表-(跳转 搜索)
  267. export const searchGameListApi = (props: SearchProps) => {
  268. return server.post<GameListRep[]>({
  269. url: "/v1/api/front/game_list_search",
  270. data: props,
  271. });
  272. };
  273. /**
  274. * 获取免费游戏列表
  275. * POST /v1/api/front/game_list_free
  276. * 接口ID:240705427
  277. * 接口地址:https://app.apifox.com/link/project/4790544/apis/api-240705427
  278. */
  279. export const getFreeGamesApi = (props: SearchProps) => {
  280. return server.post<GameListRep[]>({
  281. url: "/v1/api/front/game_list_free",
  282. data: props,
  283. });
  284. };
  285. /**
  286. * 获取重玩游戏列表
  287. * POST /v1/api/front/game_list_again
  288. * 接口ID:240731148
  289. * 接口地址:https://app.apifox.com/link/project/4790544/apis/api-240731148
  290. */
  291. export const getReplayGamesApi = (props: SearchProps) => {
  292. return server.post<GameListRep[]>({
  293. url: "/v1/api/front/game_list_again",
  294. data: props,
  295. });
  296. };
  297. //获取公告系统
  298. export interface GlobalNoticeRep extends Omit<NoticeRep, "content"> {
  299. content?: Content;
  300. send_time: number;
  301. send_user_time: number;
  302. }
  303. export const getGlobalNoticeApi = () => {
  304. return server.post<NoticeRep[], { summery: { unread: number; promotion_count: number } }>({
  305. url: "/v1/api/front/notice_list",
  306. data: {},
  307. });
  308. };
  309. export const getGlobalUserNoticeApi = () => {
  310. return server.post<NoticeRep[], { summery: { unread: number } }>({
  311. url: "/v1/api/front/notice_user_list",
  312. data: {},
  313. });
  314. };
  315. // 系统通知信息回执
  316. // POST /v1/api/front/notice_user_receipt
  317. // 接口ID:224339957
  318. // 接口地址:https://app.apifox.com/link/project/4790544/apis/api-224339957
  319. export const updateGlobalNoticeApi = (notice_id: number) => {
  320. return server.post({
  321. url: "/v1/api/front/notice_user_receipt",
  322. data: { notice_id },
  323. });
  324. };
  325. // 用户站内信回执
  326. // POST /v1/api/front/letter_user_receipt
  327. // 接口ID:224339829
  328. // 接口地址:https://app.apifox.com/link/project/4790544/apis/api-224339829
  329. export const updateUserNoticeApi = (letter_id: number) => {
  330. return server.post({
  331. url: "/v1/api/front/letter_user_receipt",
  332. data: { letter_id },
  333. });
  334. };
  335. // 获取中奖配置列表
  336. export const gamesNoticeWinApi = () => {
  337. return server.post({
  338. url: "/v1/api/front/games_notice_win",
  339. });
  340. };