import request from '@/utils/request'

// api地址
const api = {
  userInfo: 'user/info',
  assets: 'user/assets',
  bindMobile: 'user/bindMobile',
  personal: 'user/personal',
  todoCounts: "order/todoCounts",
  delUser: "user/delete",
}

// 邀请码
export const getDealerInviteQrcode = (param) => {
  return request.post('user/getDealerInviteQrcode', param)
}

// 会员码
export const getMembershipInviteQrcode = (param) => {
  return request.post('user/getMembershipInviteQrcode', param)
}

// 注销
export const delUser = (param) => {
  return request.post(api.delUser, param)
}
 // 当前登录的用户信息
export const info = (param, option) => {
  const options = {
    isPrompt: true, //（默认 true 说明：本接口抛出的错误是否提示）
    load: true, //（默认 true 说明：本接口是否提示加载动画）
    ...option
  }
  return request.get(api.userInfo, param, options)
}

// 订单数量
export const actionCounts = (param, option) => {
  return request.post('order/actionCounts', param, option)
}

// 订单数量
export const todoCounts = (param, option) => {
  return request.post(api.todoCounts, param, option)
}

// 账户资产
export const assets = (param, option) => {
  return request.get(api.assets, param, option)
}

// 绑定手机号
export const bindMobile = (data, option) => {
  return request.post(api.bindMobile, data, option)
}

// 修改个人信息（头像昵称）
export const personal = (data, option) => {
  return request.post(api.personal, data, option)
}
// 修改用户信息设置
export const editUser = (data, option) => {
  return request.post('user/editUser', data, option)
}
//// 修改个人信息（头像昵称）
export const wxHeadImgUpload = (data, option) => {
  return request.post('upload/wxHeadImgUpload', data, option)
}
