index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.get(`/books/${bid}/catalog`, {
  48. page_size: 10,
  49. page: 1
  50. }).then(r => r.list);
  51. }
  52. // 获取充值列表
  53. export const getChargeList = () => {
  54. return fly.get("/order/chargeList");
  55. }
  56. // 获取书架数据
  57. export const getUserShelfBooks = () => {
  58. return fly.get(`/userShelfBooks`);
  59. };
  60. //获取用户信息
  61. export const getUserInfo = () => {
  62. return fly.get(`/userinfo`);
  63. };