home.ts 5.9 KB

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