import request from '@/utils/request'

export function findUserByPhoneNumber(query) {
  return request({
    url: '/mapi/app/user/getUserByPhone',
    method: 'get',
    params: query
  })
}

// 查询用户列表
export function listUser(query) {
  return request({
    url: '/mapi/app/user/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getUser(id) {
  return request({
    url: '/mapi/app/user/' + id,
    method: 'get'
  })
}

// 新增用户
export function addUser(data) {
  return request({
    url: '/mapi/app/user',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/mapi/app/user',
    method: 'put',
    data: data
  })
}

// 删除用户
export function delUser(id) {
  return request({
    url: '/mapi/app/user/' + id,
    method: 'delete'
  })
}

// 修改用户状态
export function updateUserStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/app/user/updateStatus',
    method: 'post',
    data: data
  })
}



// 获取会员详情基本信息
export function getMemberInfoById(query) {
  return request({
    url: '/mapi/app/user/getMemberInfoById',
    method: 'get',
    params: query
  })
}
// 获取会员优惠券列表
export function getMemberCouponInfo(data) {
  return request({
    url: '/mapi/app/couponItem/getMemberCouponInfo',
    method: 'post',
    data: data
  })
}
// 获取会员消费明细
export function getMemberBillMstrInfo(data) {
  return request({
    url: '/mapi/app/user/getMemberBillMstrInfo',
    method: 'post',
    data: data
  })
}
// 获取会员商品订单信息
export function getMemberOrderGoodsInfo(data) {
  return request({
    url: '/mapi/order/goods/getMemberOrderGoodsInfo',
    method: 'post',
    data: data
  })
}
// 获取会员洗衣订单信息
export function getMemberOrderClothInfo(data) {
  return request({
    url: '/mapi/order/cloth/getMemberOrderClothInfo',
    method: 'post',
    data: data
  })
}
// 总部客户管理- 会员卡列表查询
export function getMemberCardInfoList(data) {
  return request({
    url: '/mapi/recharge/card/getMemberCardInfoList',
    method: 'post',
    data: data
  })
}


// 获取会员可抵用充值优惠券列表
export function getMemberCouponInfoByRecharge(data) {
  return request({
    url: '/mapi/app/couponItem/getMemberCouponInfoByRecharge',
    method: 'post',
    data: data
  })
}


