//新的接口 开始

//就诊人列表
export const getPatientList = (params) => {
  return uni.$u.http.get(`/patient/patient/list`, { params: params })
}
//新增就诊人
export const addPatient = (data) => {
  return uni.$u.http.post(`/patient/patient/add`, data)
}
//编辑就诊人
export const editPatient = (data) => {
  return uni.$u.http.post(`/patient/patient/edit`, data)
}
//删除就诊人
export const delPatient = (id) => {	
  return uni.$u.http.post(`/patient/patient/del/${id}`) 
}
//获取就诊人详情
export const getPatientDetail = (id) => {
  return uni.$u.http.get(`/patient/patient/info/${id}`)
}
//设置默认就诊人
export const setDefaultPatient = (id) => {
  return uni.$u.http.post(`/patient/patient/setDefaulted/${id}`)
}

//新的接口 结束


// 获取用户管理详细信息
export const userInfo = () => {
  return uni.$u.http.get(`/user/info`)
}

// 修改个人资料
export const updateUserInfo = (data) => {
  return uni.$u.http.post(`/user/personalData/update`, data)
}

// 小程序授权登录
export const miniappAuthLogin = (data) => {
  return uni.$u.http.post(`/miniapp/user/user/authorization/login`, data)
}

// 注册用户，小程序授权且获取了手机号
export const miniappAuthRegister = (data) => {
  return uni.$u.http.post(`/miniapp/user/user/authorization/register`, data)
}

// 获取小程序openId
export const miniappOpenId = (data) => {
  return uni.$u.http.post(`/miniapp/user/user/getOpenId`, data)
}

// 小程序获取手机号
export const miniappPhone = (data) => {
  return uni.$u.http.post(`/miniapp/user/user/phone`, data)
}


// 查询我总共获得的红包
export const totalRedPacket = () => {
  return uni.$u.http.get(`/games/rechargeRedPacket/count`)
}

// 查询充值红包列表
export const redPacketPage = (params) => {
  return uni.$u.http.get(`/games/rechargeRedPacket/page`, { params: params })
}

// 获取用户收藏
export const mineFavoriteDetail = (data) => {
  return uni.$u.http.post(`/user/userCollect/getUserCollect`, data)
}

// 新增用户收藏
export const addFavorite = (data) => {
  return uni.$u.http.post(`/user/userCollect/add`, data)
}

// 删除用户收藏
export const delFavorite = (ids) => {
  return uni.$u.http.post(`/user/userCollect/del/${ids}`)
}

// 用户收藏列表
// 查询用户收藏列表中的门票 ticket/businessProduct/collect/page
// 查询用户收藏列表中的景点 ticket/business/collect/page
export const mineFavorite = (params, entityType = 0) => {
  if (entityType == 0) {
    return uni.$u.http.get(`/ticket/business/collect/page`, { params: params })
  }
  return uni.$u.http.get(`/ticket/businessProduct/collect/page`, { params: params })
}
// 获取用户管理详细信息
export const protocolInfo = (params) => {
  return uni.$u.http.get(`/protocol/info`, { params: params })
}
// 查询常见问题列表
export const problemPage = (params) => {
  return uni.$u.http.get(`/common/problem/page`, { params: params })
}
// 获取常见问题详细信息
export const problemInfo = (id) => {
  return uni.$u.http.get(`/common/problem/info/${id}`)
}
// 获取地推信息详细信息
export const promotionInfo = (id) => {
  return uni.$u.http.get(`/promotion/info`)
}
// 查询C端用户未读消息数
export const userNoticeCount = () => {
  return uni.$u.http.get(`/userNotice/count`)
}
// 查询分销提现列表
export const withdrawalPage = (params) => {
  return uni.$u.http.get(`/distribution/withdrawal/page`, { params: params })
}
// 检查是否是地推人员
export const promotioncheck = (params) => {
  return uni.$u.http.get(`/promotion/check`)
}
// 查询分销订单列表
export const orderPage = (params) => {
  return uni.$u.http.get(`/distribution/order/page`, { params: params })
}
// 查询C端用户通知列表
export const userNoticePage = (params) => {
  return uni.$u.http.get(`/userNotice/page`, { params: params })
}
// 创建分销提现
export const withdrawalCreate = (data) => {
  return uni.$u.http.post(`/distribution/withdrawal/create`, data)
}
// 获取地推二维码
export const getQrCode = (data) => {
  return uni.$u.http.post(`/user/getQrCode`, data)
}
// 获取地推下用户分页列表
export const promotionUserPage = (params) => {
  return uni.$u.http.get(`/promotion/user-page`, { params: params })
}
// 获取地推下用户总数
export const promotionUserCount = (params) => {
  return uni.$u.http.get(`/promotion/user-count`)
}
// 设置已读
export const userNoticeSetStatus = (data) => {
  return uni.$u.http.post(`/userNotice/setStatus`, data)
}
// 设置全部已读
export const userNoticeSetAllStatus = (data) => {
  return uni.$u.http.post(`/userNotice/setAllStatus`, data)
}
// 订单统计
export const shoporderCount = () => {
  return uni.$u.http.get(`/shoporder/count`)
}