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

import { req } from "../request"

//首页
const home = () => req({
    url: "user"
})

// 我的推广码
const invite = () => req({
    url: "user/invite"
})

//任务列表
const taskList = (data) => req({
    url: "tasks",
    data: data
})

//任务分类
const taskIndex = () => req({
    url: "tasks/categories"
})

//上传头像
const setting = (key,data) => req({
    url: "user/setting/" + key,
    method: 'PUT',
    data: data
})

//小程序码
const miniShare = (data) => req({
    url: "user/mini_share",
    data: data
})

//我的收藏
const favorites = (data) => req({
    url: "user/favorites",
    data: data
})

//产品中心-分类
const mallCategories = (data) => req({
    url: "mall/categories",
    data: data
})

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

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

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

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

// 邀请码背景
const poster = (data) => req({
    url: "poster",
    data: data
})

export default ({
    home,
    invite,
    taskList,
    taskIndex,
    setting,
    miniShare,
    favorites,
    mallCategories,
    mallGoods,
    orders,
    goodsDet,
    goodsSign,
    poster
})