 /*
 * 手太欠
 * 愿这世界都如故事里一样 美好而动人~
 */

import {req} from "../request"

//商城首页
const index = () => req({url: "mall"})

//商品详情
const goodsShow = (goods) => req({url: "mall/goods/" + goods})

//创建订单
const foundOrder = (data) => req({url: "mall/buy/goods", data: data})

//确认订单
const affirmOrder = (data) => req({url: "mall/buy/goods", method: 'POST', data: data})

//水滴支付
const affirmPay = (order_no, data) => req({url: "mall/pay/" + order_no + "/score", method: 'POST', data: data})

//文章详情
const articlesSee = (article_id) => req({url: "cms/articles/" + article_id})

// //文章列表
const articlesList = (data) => req({url: "cms/articles", data: data})
//收藏
const favorite = (article_id) => req({url: "cms/articles/favorite/" + article_id})
//点赞
const subscribe = (article_id) => req({url: "cms/articles/subscribe/" + article_id})
//文章列表-全部分类
const classifysAll = () => req({url: "cms/categories"})
//文章列表-全部
const favorites = (data) => req({url: "cms/articles", data: data})

export default({
    index,
    goodsShow,
    foundOrder,
    affirmOrder,
    affirmPay,
    articlesSee,
    articlesList,
    favorite,
    subscribe,
    classifysAll,
    favorites
})