/* * @Author: ZhengXiaowei * @Date: 2019-10-15 14:05:33 * @LastEditors: ZhengXiaowei * @LastEditTime: 2019-10-15 14:05:59 * @Description: api */ import fly from "./fly"; // 获取首页数据 export const getHomeList = sex => { console.log(sex); return fly.get(`/books/${sex}/index`); }; //充值记录 export const rechargeApi = params => { return fly.get("/order/chargeRecordLists", params); }; // 获取分类 export const getCategory = () => { return fly.get("/books/getCategory"); }; // 获取书库 export const getBooksList = params => { return fly.get("/books/library", params); }; // 获取图书详情 export const getBooksInfo = bid => { return fly.get(`/book/${bid}`); }; // 获取详情页相似数据 export const getSimilarBooks = (category_id, bid) => { return fly.get("/books/similar", { category_id, bid }); }; //获取章节消费记录 export const chapterApi = params => { return fly.get("/order/chapterOrderList", params); }; //获取全本消费记录 export const bookApi = params => { return fly.get("/order/bookOrderList", params); }; // 获取详情页中的目录 export const getShortCatalog = bid => { return fly .get(`/books/${bid}/catalog`, { page_size: 10, page: 1 }) .then(r => r.list); }; // 获取充值列表 export const getChargeList = () => { return fly.get("/order/chargeList"); }; // 添加书籍进书架 export const postUserShelfBooks = params => { return fly.post(`/userShelfBooks`, params); }; // 获取书架数据 export const getUserShelfBooks = () => { return fly.get(`/userShelfBooks`); }; // 获取章节 export const getCatalog = params => { return fly.get(`/books/${params.bid}/catalog`, params); }; //获取签到记录 export const getSignRecord = params => { return fly.get(`/user/sign_record`, params); }; // 获取章节内容 export const getChapters = params => { return fly.get(`/books/${params.bid}/chapters/${params.chapter_id}`); }; // 获取书籍是否在书架 export const getIsonshelf = params => { return fly.get(`/userShelfBooks/isonshelf`, params); }; // 删除书架书籍 export const deleteShelfBook = params => { return fly.get(`/userShelfBooks/delete`, params); }; // 充值h5 export const getConfigOfWxH5Pay = params => { return fly.get("/goToH5Pay", params); }; // 充值app export const getConfigOfWxAppPay = params => { return fly.get("/goToPay", params); }; // 支付宝充值 export const getConfigOfAliPay = params => { return fly.get("/goToAliPay", params); }; //获取用户信息 export const getUserInfo = () => { return fly.get(`/userinfo`); }; //发送短信 export const sendCode = params => { return fly.post(`/user/sendCode`, params); }; //用户绑定 export const userBind = params => { return fly.post(`/user/bindPhone`, params); }; //用户签到 export const userSign = () => { return fly.get(`/sign`); }; // 查询微信支付订单的成功性 - h5 export const checkWxOrder = order => { return fly.get("/checkOrder", { order: order }); }; //用户签到 export const chapterOrders = params => { return fly.get( `/books/${params.bid}/balance/chapterOrders/${params.chapter_id}` ); }; //用户客服二维码 export const getCustomQrcode = () => { return fly.get(`/customer_img`); }; // 尾页推荐 export const readOverRecommend = params => { return fly.get("/books/readOverRecommend", params); }; //催更 export const urgeUpdate = params => { return fly.post(`/user/urgeUpdate`, params); };