index.js 855 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 getCategory = () => {
  16. return fly.get("/books/getCategory");
  17. }
  18. // 获取书库
  19. export const getBooksList = (params) => {
  20. return fly.get("/books/library", params);
  21. }
  22. // 获取图书详情
  23. export const getBooksInfo = (bid) => {
  24. return fly.get(`/book/${bid}`);
  25. }
  26. // 获取详情页相似数据
  27. export const getSimilarBooks = (category_id, bid) => {
  28. return fly.get("/books/similar", {
  29. category_id,
  30. bid
  31. })
  32. }
  33. // 获取充值列表
  34. export const getChargeList = () => {
  35. return fly.get("/order/chargeList");
  36. }