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

import { req } from "../request"

// 订单首页
const list = data => req({
    url : "mall/orders",
    data: data
})

// 订单详情
const goodsDet = (order_no) => req({
    url : "mall/orders/" + order_no
})

// 订单取消
const goodsCancel = (order_no) => req({
    url : "mall/orders/" + order_no + "/cancel",
    method: "PUT"
})

// 订单删除
const goodsDel = (order_no) => req({
    url : "mall/orders/" + order_no,
    method: "DELETE"
})

// 订单签收
const goodsSign = (order_no) => req({
    url : "mall/orders/" + order_no + "/sign",
    method: "PUT"
})

// 快递100-免费
// const kuaiDi = (data) => req({
//     url : "mall/orders/express",
//     data: data
// })

// 快递100-花钱
const kuaiDi = (order_no) => req({
    url : "mall/orders/" + order_no + "/logistic"
})

// 退款售后列表
const refundList = data => req({
    url : "mall/refunds",
    data: data
})

// 退款售后详情
const refundSee = (refund) => req({
    url : "mall/refunds/" + refund
})

// 退货
const refundPost = (order_no, data) => req({
    url : "mall/orders/" +  order_no + "/refund",
    data: data,
    method: "POST"
})

// 获取退货信息
const reason = (order_no) => req({
    url : "mall/orders/" + order_no + "/refund"
})

// 用户退货
const refundDeliver = (refund_no, data) => req({
    url : "mall/refunds/" +  refund_no + "/deliver",
    data: data,
    method: "POST"
})

export default ({
    list,
    goodsDet,
    goodsCancel,
    goodsDel,
    goodsSign,
    kuaiDi,
    refundList,
    refundSee,
    refundPost,
    reason,
    refundDeliver
})