home.ts 8.0 KB

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