index.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. * @Author: ZhengXiaowei
  3. * @Date: 2019-10-15 14:05:33
  4. * @LastEditors: ZhengXiaowei
  5. * @LastEditTime: 2019-10-15 14:05:59
  6. * @Description: api
  7. */
  8. import fly from "./fly";
  9. // 获取首页数据
  10. export const getHomeList = sex => {
  11. console.log(sex);
  12. return fly.get(`/books/${sex}/index`);
  13. };
  14. //充值记录
  15. export const rechargeApi = params => {
  16. return fly.get("/order/chargeRecordLists", params);
  17. };
  18. // 获取分类
  19. export const getCategory = () => {
  20. return fly.get("/books/getCategory");
  21. };
  22. // 获取书库
  23. export const getBooksList = params => {
  24. return fly.get("/books/library", params);
  25. };
  26. // 获取图书详情
  27. export const getBooksInfo = bid => {
  28. return fly.get(`/book/${bid}`);
  29. };
  30. // 获取详情页相似数据
  31. export const getSimilarBooks = (category_id, bid) => {
  32. return fly.get("/books/similar", {
  33. category_id,
  34. bid
  35. });
  36. };
  37. //获取章节消费记录
  38. export const chapterApi = params => {
  39. return fly.get("/order/chapterOrderList", params);
  40. };
  41. //获取全本消费记录
  42. export const bookApi = params => {
  43. return fly.get("/order/bookOrderList", params);
  44. };
  45. // 获取详情页中的目录
  46. export const getShortCatalog = bid => {
  47. return fly
  48. .get(`/books/${bid}/catalog`, {
  49. page_size: 10,
  50. page: 1
  51. })
  52. .then(r => r.list);
  53. };
  54. // 获取充值列表
  55. export const getChargeList = () => {
  56. return fly.get("/order/chargeList");
  57. };
  58. // 添加书籍进书架
  59. export const postUserShelfBooks = params => {
  60. return fly.post(`/userShelfBooks`, params);
  61. };
  62. // 获取书架数据
  63. export const getUserShelfBooks = () => {
  64. return fly.get(`/userShelfBooks`);
  65. };
  66. // 获取章节
  67. export const getCatalog = params => {
  68. return fly.get(`/books/${params.bid}/catalog`, params);
  69. };
  70. //获取签到记录
  71. export const getSignRecord = params => {
  72. return fly.get(`/user/sign_record`, params);
  73. };
  74. // 获取章节内容
  75. export const getChapters = params => {
  76. return fly.get(`/books/${params.bid}/chapters/${params.chapter_id}`);
  77. };
  78. // 获取书籍是否在书架
  79. export const getIsonshelf = params => {
  80. return fly.get(`/userShelfBooks/isonshelf`, params);
  81. };
  82. // 删除书架书籍
  83. export const deleteShelfBook = params => {
  84. return fly.get(`/userShelfBooks/delete`, params);
  85. };
  86. // 充值h5
  87. export const getConfigOfWxH5Pay = params => {
  88. return fly.get("/goToH5Pay", params);
  89. };
  90. // 充值app
  91. export const getConfigOfWxAppPay = params => {
  92. return fly.get("/goToPay", params);
  93. };
  94. // 支付宝充值
  95. export const getConfigOfAliPay = params => {
  96. return fly.get("/goToAliPay", params);
  97. };
  98. //获取用户信息
  99. export const getUserInfo = () => {
  100. return fly.get(`/userinfo`);
  101. };
  102. //发送短信
  103. export const sendCode = params => {
  104. return fly.post(`/user/sendCode`, params);
  105. };
  106. //用户绑定
  107. export const userBind = params => {
  108. return fly.post(`/user/bindPhone`, params);
  109. };
  110. //用户签到
  111. export const userSign = () => {
  112. return fly.get(`/sign`);
  113. };
  114. // 查询微信支付订单的成功性 - h5
  115. export const checkWxOrder = order => {
  116. return fly.get("/checkOrder", { order: order });
  117. };
  118. //用户签到
  119. export const chapterOrders = params => {
  120. return fly.get(
  121. `/books/${params.bid}/balance/chapterOrders/${params.chapter_id}`
  122. );
  123. };
  124. //用户客服二维码
  125. export const getCustomQrcode = () => {
  126. return fly.get(`/customer_img`);
  127. };
  128. // 尾页推荐
  129. export const readOverRecommend = params => {
  130. return fly.get("/books/readOverRecommend", params);
  131. };
  132. //催更
  133. export const urgeUpdate = params => {
  134. return fly.post(`/user/urgeUpdate`, params);
  135. };