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

import { req } from "../request"

// 产品首页
const mallIndex = () => req({
    url: "mall"
})

// 产品列表
const mallList = data => req({
    url: "mall/goods",
    data: data
})

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

// 产品下单
const mallPlace = data => req({
    url: "mall/buy/goods",
    data: data
})

// 产品下单提交
const mallAffirm = data => req({
    url: "mall/buy/goods",
    data: data,
    method: "POST",
})

// 产品支付
const mallPay = (order_no, data) => req({
    url: "mall/pay/" + order_no + "/wechat",
    data: data
})

// 绑定邀请码
const levelBind = (data) => req({
    url: "user/bind",
    data: data,
    method: "POST",
})

// 我的兑换券
const mycoupon = (data) => req({
    url: "coupons",
    data: data
})

export default ({
    mallIndex,
    mallList,
    mallSee,
    mallPlace,
    mallAffirm,
    mallPay,
    levelBind,
    mycoupon
})