var api = require('../api/api.js')
import {
  http
} from '../utils/http.js'
var app = getApp()

//api地址
const url = api.url;

module.exports = {

  //GET:首页轮播图列表获取
  getBanner(params) {
    return http({
      url: url.banner,
      header: {},
      data: params
    })
  },

  //GET:首页热门岗位列表分页获取
  getIndexList(params) {
    return http({
      url: url.hotPosition,
      header: {},
      data: params
    })
  },
  //GET:首页全职岗位列表分页获取
  getFullList(params) {
    return http({
      url: url.fullPosition,
      header: {},
      data: params
    })
  },
  //GET:首页兼职岗位列表分页获取
  getParttimeList(params) {
    return http({
      url: url.parttimePosition,
      header: {},
      data: params
    })
  },
  //GET:首页入职奖励岗位列表分页获取
  getRewardList(params) {
    return http({
      url: url.rewardPosition,
      header: {},
      data: params
    })
  },
  //GET:首页高薪急聘岗位列表分页获取
  getGoodMoneyList(params) {
    return http({
      url: url.goodMoneyPosition,
      header: {},
      data: params
    })
  },
  //GET:首页福利岗位列表分页获取
  getWelfareList(params) {
    return http({
      url: url.welfarePosition,
      header: {},
      data: params
    })
  },

  //GET:拼团岗位列表分页获取
  getGroupList(params) {
    return http({
      url: url.groupPosition,
      header: {},
      data: params
    })
  },

  //GET: 岗位：招聘岗位详情页
  getPositionDetail(params) {
    return http({
      url: url.positionDetail,
      header: {},
      data: params
    })
  },
  //搜索岗位
  getSearchList(params) {
    return http({
      url: url.searchPosition,
      header: {},
      data: params
    })
  },

  //POST:岗位申请：用户申请职位
  positionApply(params) {
    return http({
      url: url.positionApply,
      method: 'POST',
      header: {},
      data: params
    })
  },

  //GET:获取我的收藏
  myFavoriteList(params) {
    return http({
      url: url.myFavoriteList,
      method: 'GET',
      header: {},
      data: params
    })
  },
  //GET:获取面试邀请
  myInterViewList(params) {
    return http({
      url: url.myInterViewList,
      method: 'GET',
      header: {},
      data: params
    })
  },
  //GET:获取面试邀请详情
  myInterViewDetail(params) {
    return http({
      url: url.myInterViewDetail,
      method: 'GET',
      header: {},
      data: params
    })
  },
  //POST:岗位申请：用户发起拼团
  groupApply(params) {
    return http({
      url: url.groupApply,
      method: 'POST',
      header: {},
      data: params
    })
  },

  //GET:我的页面进入后获取个人信息(认证状态)
  getCenterInfo(params) {
    return http({
      url: url.centerInfo,
      header: {},
      data: params
    })
  },

  //post 用户认证信息提交,图片先上传获取连接
  postApprove(params) {
    return http({
      url: url.approve,
      method: 'POST',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      data: params
    })
  },

  //get 用户简历：用户简历详情信息
  getResume(params) {
    return http({
      url: url.resume,
      header: {},
      data: params
    })
  },

  //post 用户简历基本信息添加、修改：第一次创建简历、简历基本信息编辑，hpUserResumeId存在编辑、否新增
  resumeBase(params) {
    return http({
      url: url.resumeBase,
      method: 'POST',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      data: params
    })
  },

  //post 用户简历：用户求职意向编辑、新增
  resumeIntent(params) {
    return http({
      url: url.resumeIntent,
      method: 'POST',
      header: {},
      data: params
    })
  },

  //post 用户简历：用户工作经验编辑、新增
  resumeExp(params) {
    return http({
      url: url.resumeExp,
      method: 'POST',
      header: {},
      data: params
    })
  },

  // 发送手机短信验证码 
  sendPhoneCode(params) {
    return http({
      url: url.phoneCode,
      data: params,
      method: "POST",
      header: {},
    })
  },

  //  薪资查询：根据手机号码，短信验证码获取身份信息
  getPayrollId(params) {
    return http({
      url: url.payrollId,
      data: params,
      method: "GET",
      header: {},
    })
  },

  //  薪资查询：获取工资条信息
  getPayroll(params) {
    return http({
      url: url.payroll,
      data: params,
      method: "GET",
      header: {},
    })
  },

  //get 岗位拼团：拼团岗位详情页面获取正在进行的所有拼团列表
  groupList(params) {
    return http({
      url: url.groupList,
      data: params,
      method: "GET",
      header: {},
    })
  },

  //get:获取拼团详情信息
  getGroupDetail(params) {
    return http({
      url: url.groupDetail,
      data: params,
      header: {},
    })
  },

  //保存经纪人
  saveAgent(params) {
    return http({
      url: url.saveAgent,
      data: params,
      method: "POST",
      header: {},
    })
  },

  //收藏岗位
  saveFavoritePosition(params) {
    return http({
      url: url.saveFavoritePosition,
      data: params,
      method: "POST",
      header: {},
    })
  },

  selectInfo(params) {
    return http({
      url: url.selectInfo,
      data: params,
      method: "POST",
      header: {},
    })
  },
  // 获取用户认证信息
  getHpMemberDetail(params) {
    return http({
      url: url.getHpMemberDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 查询钱包余额
  getMoneyAccountDetail(params) {
    return http({
      url: url.getMoneyAccountDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 查询收支明细
  getMoneyDetail(params) {
    return http({
      url: url.getMoneyDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 我的积分页
  myPoint(params) {
    return http({
      url: url.myPoint,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 积分明细
  pointsDetail(params) {
    return http({
      url: url.pointsDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 今日签到
  todaySign(params) {
    return http({
      url: url.todaySign,
      data: params,
      method: 'POST',
      header: {}
    })
  },

  // 今日补签
  todaySupSign(params) {
    return http({
      url: url.todaySupSign,
      data: params,
      method: 'POST',
      header: {}
    })
  },

  // 保存任务明细（日常任务-分享岗位）
  saveTask(params) {
    return http({
      url: url.saveTask,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 领取奖励
  getReward(params) {
    return http({
      url: url.getReward,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 好礼列表
  getMpCompaignsReward(params) {
    return http({
      url: url.getMpCompaignsReward,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 好礼详情
  getMpCompaignsRewardDetail(params) {
    return http({
      url: url.getMpCompaignsRewardDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 好礼兑换接口
  changeMpCompaignsRewards(params) {
    return http({
      url: url.changeMpCompaignsRewards,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 好礼兑换成功添加手机号
  changeMpCompaignsRewardsPhone(params) {
    return http({
      url: url.changeMpCompaignsRewardsPhone,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 活动列表
  getMpCompaignsActivity(params) {
    return http({
      url: url.getMpCompaignsActivity,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 活动详情
  getMpCompaignsActivityDetail(params) {
    return http({
      url: url.getMpCompaignsActivityDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 活动兑换接口
  changeMpCompaignsActivity(params) {
    return http({
      url: url.changeMpCompaignsActivity,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 活动兑换成功添加手机号
  changeMpCompaignsActivityPhone(params) {
    return http({
      url: url.changeMpCompaignsActivityPhone,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 任务列表
  taskList(params) {
    return http({
      url: url.taskList,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 用户兑换好礼列表
  getMpMemberCompaignsReward(params) {
    return http({
      url: url.getMpMemberCompaignsReward,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 用户兑换活动列表
  getMpMemberCompaignsActivity(params) {
    return http({
      url: url.getMpMemberCompaignsActivity,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 用户兑换活动/好礼详情接口
  getMpMemberCompaignsActivityAndRewardDetail(params) {
    return http({
      url: url.getMpMemberCompaignsActivityAndRewardDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 生成订单
  saveMpOrder(params) {
    return http({
      url: url.saveMpOrder,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 微信小程序支付
  wxPayOrder(params) {
    return http({
      url: url.wxPayOrder,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 用户薪资查询列表接口
  myPayRollList(params) {
    return http({
      url: url.myPayRollList,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 我的薪资详情
  myPayRollDetail(params) {
    return http({
      url: url.myPayRollDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 返费列表
  myHpAgencyFeeList(params) {
    return http({
      url: url.myHpAgencyFeeList,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 奖励详情
  myHpAgencyFeeDetail(params) {
    return http({
      url: url.myHpAgencyFeeDetail,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 入职奖励
  confirmHpAgencyFee(params) {
    return http({
      url: url.confirmHpAgencyFee,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 保存日志
  saveHpUserLog(params) {
    return http({
      url: url.saveHpUserLog,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 保存日志
  saveHpComplaintAdvice(params) {
    return http({
      url: url.saveHpComplaintAdvice,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 注销账户
  logout_new(params) {
    return http({
      url: url.logout_new,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 面试登记获取企业状态
  getCompanyStatus(params) {
    return http({
      url: url.getCompanyStatus,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 查询用户是否签到并在用户未签到情况下返回意向企业
  getIntentCompany(params) {
    return http({
      url: url.getIntentCompany,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 进入打卡页面获取打卡信息
  punchClockNeedInfo(params) {
    return http({
      url: url.punchClockNeedInfo,
      data: params,
      method: 'GET',
      header: {},
      noLoading:true
    })
  },
  // 打卡接口
  savePunchClock(params) {
    return http({
      url: url.savePunchClock,
      data: params,
      method: 'POST',
      header: {}
    })
  },
  // 当月汇总
  currentSettlement(params) {
    return http({
      url: url.currentSettlement,
      data: params,
      method: 'GET',
      header: {}
    })
  },

  // 月打卡情况集合
  monthTotalSettlement(params) {
    return http({
      url: url.monthTotalSettlement,
      data: params,
      method: 'GET',
      header: {}
    })
  },
  // 月数据统计
  monthSettlement(params) {
    return http({
      url: url.monthSettlement,
      data: params,
      method: 'GET',
      header: {}
    })
  },

  // 日数据查询
  daySettlement(params) {
    return http({
      url: url.daySettlement,
      data: params,
      method: 'GET',
      header: {}
    })
  },


  // 周数据统计
  weekSettlement(params) {
    return http({
      url: url.weekSettlement,
      data: params,
      method: 'GET',
      header: {}
    })
  },


  // 编辑用户信息
  editUserPhone(params) {
    return http({
      url: url.editUserPhone,
      data: params,
      method: 'POST',
      header: {}
    })
  },

  // 获取ocr秘钥
  getOcrKey() {
    return http({
      url: url.getOcrKey,
      data: {},
      method: 'GET',
      header: {}
    })
  },
  /**************************废弃接口**************************** */
  //post 用户简历：用户教育背景编辑、新增
  resumeEdu(params) {
    return http({
      url: url.resumeEdu,
      method: 'POST',
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
        "Content-Type": "application/json"
      },
      data: JSON.stringify(params)
    })
  },

  //POST:用户中心：我的岗位申请列表
  getPositionList(params) {
    return http({
      url: url.positionList,
      header: {},
      data: params
    })
  },


  //GET: 岗位搜索记录查询
  searchHistory() {
    return http({
      url: url.searchHistory,
      header: {
        oid: app.globalData.oid
      },
      data: {
        delOn: 0,
        isPage: 1,
        currentPage: 1,
        showCount: 10
      }
    })
  },

  //delete: 刪除搜索记录
  deleteHistory(id) {
    return http({
      url: url.searchHistory,
      method: 'DELETE',
      header: {
        oid: app.globalData.oid
      },
      data: {
        hpUserSearchId: id
      }
    })
  },


  //get 岗位拼团详情
  group(id) {
    return http({
      url: url.positionApply,
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
      },
      data: {
        hpPositionGroupId: id
      }
    })
  },

  //get: 获取教育水平选项
  eduList() {
    return http({
      url: url.eduList,
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
      }
    })
  },

  //get:获取薪资水平选项列表
  getSalaryList() {
    return http({
      url: url.salaryList,
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
      }
    })
  },

  //  手机号：用户手机号码绑定、更换
  usePhoneBound(params) {
    return http({
      url: url.phoneBound,
      data: params,
      method: "POST",
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
        sessionId: wx.getStorageSync('sessionid'),
      },
    })
  },
  //  手机号：用户手机号码绑定、更换
  shareBound(params) {
    return http({
      url: url.shareBound,
      data: params,
      method: "POST",
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
        shareToken: params.shareToken,
      },
    })
  },

  //二维码生成接口B
  shareQrCodeA(targetUrl) {
    return http({
      url: url.shareQrCodeA,
      data: {
        targetUrl: targetUrl
      },
      method: "POST",
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
      },
    })
  },

  //二维码生成接口B
  shareQrCodeB(targetUrl) {
    return http({
      url: url.shareQrCodeB,
      data: {
        targetUrl: targetUrl
      },
      method: "POST",
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
      },
    })
  },

  //二维码生成接口C
  shareQrCodeC(targetUrl) {
    return http({
      url: url.shareQrCodeC,
      data: {
        targetUrl: targetUrl
      },
      method: "POST",
      header: {
        oid: app.globalData.oid,
        sid: app.globalData.sid,
      },
    })
  },

  //地址编码：城市、详细地址查询经纬度值
  getIp(params) {
    return http({
      url: url.addrdecode,
      data: params,
      method: 'POST',
    })
  }
}