index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. console.log('aaaa')
  44. return fly.get("/order/bookOrderList",params);
  45. };
  46. // 获取充值列表
  47. export const getChargeList = () => {
  48. return fly.get("/order/chargeList");
  49. }
  50. // 获取书架数据
  51. export const getUserShelfBooks = () => {
  52. return fly.get(`/userShelfBooks`);
  53. };
  54. //获取用户信息
  55. export const getUserInfo = () => {
  56. return fly.get(`/userinfo`);
  57. };